|
|
Power 6/32 Unix version 1.2b
/* cmap.h 6.1 83/07/29 */
/*
* core map entry
*/
struct cmap
{
unsigned int c_next:32, /* index of next free list entry */
c_prev:32, /* index of previous free list entry */
c_hlink:32, /* hash link for <blkno,mdev> */
c_page:20, /* virtual page number in segment */
c_ndx:9, /* index of owner proc,text, shared memory */
c_lock:1, /* locked for raw i/o or pagein */
c_want:1, /* wanted */
c_intrans:1, /* intransit bit */
c_blkno:20, /* disk block this is a copy of */
c_mdev:6, /* which mounted dev this is from */
c_type:3, /* type CSYS or CTEXT or CSTACK or CDATA */
c_free:1, /* on the free list */
c_gone:1, /* associated page has been released */
:1;
};
#define CMHEAD 0
/*
* Shared text pages are not totally abandoned when a process
* exits, but are remembered while in the free list hashed by <mdev,blkno>
* off the cmhash structure so that they can be reattached
* if another instance of the program runs again soon.
*/
#define CMHSIZ 512 /* SHOULD BE DYNAMIC */
#define CMHASH(bn) ((bn)&(CMHSIZ-1))
#ifdef KERNEL
struct cmap *cmap;
struct cmap *ecmap;
int ncmap;
struct cmap *mfind();
int firstfree, maxfree;
int ecmx; /* cmap index of ecmap */
short cmhash[CMHSIZ];
#endif
/* bits defined in c_type */
#define CSYS 0 /* none of below */
#define CTEXT 1 /* belongs to shared text segment */
#define CDATA 2 /* belongs to data segment */
#define CSTACK 3 /* belongs to stack segment */
#define CSHMEM 4 /* shared memory data page */
#define pgtocm(x) ((((x)-firstfree) / CLSIZE) + 1)
#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.