|
|
1.1 root 1: /*
2: * core map entry
3: *
4: * the 20-bit fields imply a maximum of 1GB with 1K pages
5: * which is scant compensation for the enormous space this
6: * damned structure takes.
7: */
8: struct cmap
9: {
10: unsigned int c_next:20, /* index of next free list entry */
11: c_lock:1, /* locked for raw i/o or pagein */
12: c_want:1, /* wanted */
13: c_intrans:1, /* intransit bit */
14: c_free:1, /* on the free list */
15: c_gone:1, /* associated page has been released */
16:
17: c_prev:20, /* index of previous */
18: c_type:2, /* type CSYS or CTEXT or CSTACK or CDATA */
19:
20: c_page:20, /* virtual page number in segment */
21: c_ndx:10, /* index of owner proc or text */
22:
23: c_hlink:20, /* hash link for <blkno,mdev> */
24:
25: c_blkno:20, /* disk block this is a copy of */
26: c_mdev:6; /* which mounted dev this is from (NMOUNT) */
27: };
28:
29: #define CMHEAD 0
30:
31: #ifdef KERNEL
32: struct cmap *cmap;
33: struct cmap *ecmap;
34: int ncmap;
35: struct cmap *mfind();
36: int firstfree, maxfree;
37: int ecmx; /* cmap index of ecmap */
38: #endif
39:
40: /* bits defined in c_type */
41:
42: #define CSYS 0 /* none of below */
43: #define CTEXT 1 /* belongs to shared text segment */
44: #define CDATA 2 /* belongs to data segment */
45: #define CSTACK 3 /* belongs to stack segment */
46:
47: #define pgtocm(x) ((((x)-firstfree) / CLSIZE) + 1)
48: #define cmtopg(x) ((((x)-1) * CLSIZE) + firstfree)
49:
50: /*
51: * magic for c_mdev
52: */
53: #define MSWAPX 63 /* the swap device */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.