|
|
1.1 root 1: /* cmap.h 4.1 11/9/80 */
2:
3: /*
4: * core map entry
5: *
6: * NB: THE SIZE OF THIS STRUCTURE IS WELL KNOWN IN cmap.m
7: */
8: struct cmap
9: {
10: unsigned int c_next:13, /* index of next free list entry */
11: c_prev:13, /* index of previous free list entry */
12: c_mdev:4, /* which mounted dev this is from */
13: c_lock:1, /* locked for raw i/o or pagein */
14: c_want:1, /* wanted */
15: c_page:16, /* virtual page number in segment */
16: c_hlink:13, /* hash link for <blkno,mdev> */
17: c_intrans:1, /* intransit bit */
18: c_free:1, /* on the free list */
19: c_gone:1, /* associated page has been released */
20: c_type:2, /* type CSYS or CTEXT or CSTACK or CDATA */
21: c_blkno:20, /* disk block this is a copy of */
22: c_ndx:10; /* index of owner proc or text */
23: };
24:
25: #define CMHEAD 0
26:
27: /*
28: * Shared text pages are not totally abandoned when a process
29: * exits, but are remembered while in the free list hashed by <mdev,blkno>
30: * off the cmhash structure so that they can be reattached
31: * if another instance of the program runs again soon.
32: */
33: #define CMHSIZ 512 /* SHOULD BE DYNAMIC */
34: #define CMHASH(bn) ((bn)&(CMHSIZ-1))
35:
36: #ifdef KERNEL
37: extern struct cmap *cmap;
38: extern struct cmap *ecmap;
39: struct cmap *mfind();
40: struct cmap zcmap;
41: int firstfree, maxfree;
42: int ecmx; /* cmap index of ecmap */
43: short cmhash[CMHSIZ];
44: #endif
45:
46: /* bits defined in c_type */
47:
48: #define CSYS 0 /* none of below */
49: #define CTEXT 1 /* belongs to shared text segment */
50: #define CDATA 2 /* belongs to data segment */
51: #define CSTACK 3 /* belongs to stack segment */
52:
53: #define pgtocm(x) ((((x)-firstfree) / CLSIZE) + 1)
54: #define cmtopg(x) ((((x)-1) * CLSIZE) + firstfree)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.