Commit | Line | Data |
---|---|---|
a0eab615 | 1 | /* pte.h 4.8 81/03/09 */ |
cb3a5783 BJ |
2 | |
3 | /* | |
4 | * VAX page table entry | |
5 | * | |
6 | * There are two major kinds of pte's: those which have ever existed (and are | |
7 | * thus either now in core or on the swap device), and those which have | |
8 | * never existed, but which will be filled on demand at first reference. | |
9 | * There is a structure describing each. There is also an ancillary | |
10 | * structure used in page clustering. | |
11 | */ | |
12 | ||
5d1a7b0a | 13 | #ifndef LOCORE |
cb3a5783 BJ |
14 | struct pte |
15 | { | |
16 | unsigned int pg_pfnum:21, /* core page frame number or 0 */ | |
17 | :2, | |
18 | pg_vreadm:1, /* modified since vread (or with _m) */ | |
19 | pg_swapm:1, /* have to write back to swap */ | |
20 | pg_fod:1, /* is fill on demand (=0) */ | |
21 | pg_m:1, /* hardware maintained modified bit */ | |
22 | pg_prot:4, /* access control */ | |
23 | pg_v:1; /* valid bit */ | |
24 | }; | |
25 | struct hpte | |
26 | { | |
27 | unsigned int pg_pfnum:21, | |
28 | :2, | |
29 | pg_high:9; /* special for clustering */ | |
30 | }; | |
31 | struct fpte | |
32 | { | |
33 | unsigned int pg_blkno:20, /* file system block number */ | |
34 | pg_fileno:5, /* file mapped from or TEXT or ZERO */ | |
35 | pg_fod:1, /* is fill on demand (=1) */ | |
36 | :1, | |
37 | pg_prot:4, | |
38 | pg_v:1; | |
39 | }; | |
5d1a7b0a | 40 | #endif |
cb3a5783 BJ |
41 | |
42 | #define PG_V 0x80000000 | |
43 | #define PG_PROT 0x78000000 | |
44 | #define PG_M 0x04000000 | |
45 | #define PG_VREADM 0x00800000 | |
46 | #define PG_PFNUM 0x001fffff | |
47 | ||
48 | #define PG_FZERO (NOFILE) | |
49 | #define PG_FTEXT (NOFILE+1) | |
50 | #define PG_FMAX (PG_FTEXT) | |
51 | ||
52 | #define PG_NOACC 0 | |
53 | #define PG_KW 0x10000000 | |
54 | #define PG_KR 0x18000000 | |
55 | #define PG_UW 0x20000000 | |
56 | #define PG_URKW 0x70000000 | |
57 | #define PG_URKR 0x78000000 | |
58 | ||
59 | /* | |
60 | * Pte related macros | |
61 | */ | |
62 | #define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \ | |
63 | ((pte)->pg_m || (pte)->pg_swapm)) | |
64 | ||
5d1a7b0a | 65 | #ifndef LOCORE |
cb3a5783 BJ |
66 | #ifdef KERNEL |
67 | struct pte *vtopte(); | |
68 | ||
69 | /* utilities defined in locore.s */ | |
70 | extern struct pte Sysmap[]; | |
71 | extern struct pte Usrptmap[]; | |
72 | extern struct pte usrpt[]; | |
73 | extern struct pte Swapmap[]; | |
74 | extern struct pte Forkmap[]; | |
75 | extern struct pte Xswapmap[]; | |
76 | extern struct pte Xswap2map[]; | |
77 | extern struct pte Pushmap[]; | |
78 | extern struct pte Vfmap[]; | |
79 | extern struct pte mmap[]; | |
a5e17cf9 | 80 | extern struct pte msgbufmap[]; |
b7c71f19 | 81 | extern struct pte camap[]; |
4d752f43 | 82 | extern struct pte Nexmap[][16]; |
cb3a5783 | 83 | #endif |
5d1a7b0a | 84 | #endif |