# 2.11BSD#431 - /usr/include/vmf.h

##### Variables

    nmapsegs          X
    nswaps            X

##### Macros

    BYTESPERSEG       X
    LOG2BPS           X
    MAXSEGNO          X
    S_DIRTY           X
    VMMODIFY          X
    VOFF              X
    VSEG              X
    WORDSPERSEG       X
    s_cinfo           X
    s_winfo           X

##### struct's

    dlink             X
    vseg              X
    vspace            X

##### typedef's

    VADDR             X

       1: /*      Program Name:   vmf.h
       2:  *      Author:  S.M. Schultz
       3:  *
       4:  *      -----------   Modification History   ------------
       5:  *      Version Date            Reason For Modification
       6:  *      1.0     01Jan80         1. Initial release.
       7:  *      2.0     31Mar83         2. Cleanup.
       8:  *	3.0	08Sep93		3. Change v_foffset to off_t instead of int.
       9:  *	3.1	21Oct93		4. Create union member of structure to
      10:  *				   make 'int' or 'char' access to data easy.
      11:  *				   Define segment+offset and modified macros.
      12:  *				   Place into the public domain.
      13:  *      --------------------------------------------------
      14: */
      15:
      16: #include <sys/types.h>
      17:
      18: #define MAXSEGNO    512 /* max number of segments in a space */
      19: #define BYTESPERSEG     1024    /* must be power of two! */
      20: #define LOG2BPS     10  /* log2(BYTESPERSEG) */
      21: #define WORDSPERSEG     (BYTESPERSEG/sizeof (int))
      22:
      23: struct vspace {
      24:     int     v_fd;           /* file for swapping */
      25:     off_t   v_foffset;      /* offset for computing file addresses */
      26:     int     v_maxsegno;     /* number of segments in this space */
      27:     };
      28:
      29: struct dlink {                  /* general double link structure */
      30:     struct dlink *fwd;      /* forward link */
      31:     struct dlink *back;     /* back link */
      32:     };
      33:
      34: struct  vseg {                    /* structure of a segment in memory */
      35:     struct  dlink   s_link;     /* for linking into lru list */
      36:     int s_segno;            /* segment number */
      37:     struct  vspace  *s_vspace;      /* which virtual space */
      38:     int s_lock_count;
      39:     int     s_flags;
      40:     union
      41:         {
      42:         int _winfo[WORDSPERSEG];    /* the actual segment */
      43:         char    _cinfo[BYTESPERSEG];
      44:         } v_un;
      45:     };
      46:
      47: #define s_winfo v_un._winfo
      48: #define s_cinfo v_un._cinfo
      49:
      50: /* masks for s_flags */
      51: #define S_DIRTY 01                  /* segment has been modified */
      52:
      53:     long    nswaps;             /* number of swaps */
      54:     long    nmapsegs;           /* number of mapseg calls */
      55:
      56:     int vminit(), vmopen();
      57:     struct  vseg    *vmmapseg();
      58:     void    vmlock(), vmunlock(), vmclrseg(), vmmodify();
      59:     void    vmflush(), vmclose();
      60:
      61: typedef long    VADDR;
      62: #define VMMODIFY(seg) (seg->s_flags |= S_DIRTY)
      63: #define VSEG(va) ((short)(va >> LOG2BPS))
      64: #define VOFF(va) ((u_short)va % BYTESPERSEG)

#### Defined variables

nmapsegs defined in line 54; used 2 times

- in /usr/src/bin/ld/ld.c line 505
- in /usr/src/usr.lib/libvmf/vmf.c line 94

nswaps defined in line 53; used 2 times

- in /usr/src/bin/ld/ld.c line 504
- in /usr/src/usr.lib/libvmf/vmf.c line 185

#### Defined struct's

dlink defined in line 29; used 14 times

- in line 30-35(6)
- in /usr/src/usr.lib/libvmf/vmf.c line 45(2), 74(2), 149(2), 357(2)

vseg defined in line 34; used 64 times

- in line 57(2)
- in /usr/src/bin/ld/ld.c line 825(2), 992(2), 1161(2), 1866(2)
- in /usr/src/usr.lib/libvmf/vmf.c line 59-62(8), 87-92(4), 105-116(12), 178(2), 209(2), 222(2), 236(2), 250(2), 264-267(8), 279(2), 325-330(8), 349(2)

vspace defined in line 23; used 12 times

- in line 37(2)
- in /usr/src/bin/ld/ld.c line 292(2)
- in /usr/src/usr.lib/libvmf/vmf.c line 89(2), 182(2), 292(2), 323(2)

#### Defined typedef's

VADDR defined in line 61; used 14 times

- in /usr/src/bin/ld/ld.c line 197, 298, 584, 729, 820, 989, 1160, 1181, 1269, 1406, 1487, 1829, 1865, 1957

#### Defined macros

BYTESPERSEG defined in line 19; used 7 times

- in line 21, 43, 64
- in /usr/src/bin/ld/ld.c line 128
- in /usr/src/usr.lib/libvmf/vmf.c line 187, 196, 212

LOG2BPS defined in line 20; used 2 times

- in line 63
- in /usr/src/bin/ld/ld.c line 592

MAXSEGNO defined in line 18; used 1 times

- in /usr/src/usr.lib/libvmf/vmf.c line 311

S_DIRTY defined in line 51; used 5 times

- in line 62
- in /usr/src/usr.lib/libvmf/vmf.c line 121, 131, 268, 337

VMMODIFY defined in line 62; used 11 times

- in /usr/src/bin/ld/ld.c line 933, 1039, 1055, 1081, 1132-1145(4), 1176, 1892
- in /usr/src/usr.lib/libvmf/vmf.c line 253

VOFF defined in line 64; used 16 times

- in /usr/src/bin/ld/ld.c line 778, 917, 1011, 1034, 1047, 1078, 1109, 1168, 1213, 1368, 1461, 1503, 1580, 1840, 1880, 1966

VSEG defined in line 63; used 16 times

- in /usr/src/bin/ld/ld.c line 777, 916, 1010, 1033, 1046, 1077, 1108, 1167, 1212, 1367, 1460, 1502, 1579, 1839, 1879, 1966

WORDSPERSEG defined in line 21; used 1 times

- in line 42

s_cinfo defined in line 48; used 18 times

- in /usr/src/bin/ld/ld.c line 777, 917, 1010, 1034, 1047, 1078, 1109, 1168, 1212, 1367, 1460, 1502, 1579, 1839, 1880, 1966
- in /usr/src/usr.lib/libvmf/vmf.c line 196, 212

s_winfo defined in line 47; never used

#### Usage of this include

vmf.h used 2 times

- in /usr/src/bin/ld/ld.c line 66
- in /usr/src/usr.lib/libvmf/vmf.c line 16

Last modified: 1993-10-22 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 541 |