cleaned up printfs on errors... (still scrawed, tho)
[unix-history] / usr / src / sys / vax / include / pte.h
CommitLineData
4e0c95d7 1/* pte.h 4.1 %G% */
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
13struct pte
14{
15unsigned int pg_pfnum:21, /* core page frame number or 0 */
16 :2,
17 pg_vreadm:1, /* modified since vread (or with _m) */
18 pg_swapm:1, /* have to write back to swap */
19 pg_fod:1, /* is fill on demand (=0) */
20 pg_m:1, /* hardware maintained modified bit */
21 pg_prot:4, /* access control */
22 pg_v:1; /* valid bit */
23};
24struct hpte
25{
26unsigned int pg_pfnum:21,
27 :2,
28 pg_high:9; /* special for clustering */
29};
30struct fpte
31{
32unsigned int pg_blkno:20, /* file system block number */
33 pg_fileno:5, /* file mapped from or TEXT or ZERO */
34 pg_fod:1, /* is fill on demand (=1) */
35 :1,
36 pg_prot:4,
37 pg_v:1;
38};
39
40#define PG_V 0x80000000
41#define PG_PROT 0x78000000
42#define PG_M 0x04000000
43#define PG_VREADM 0x00800000
44#define PG_PFNUM 0x001fffff
45
46#define PG_FZERO (NOFILE)
47#define PG_FTEXT (NOFILE+1)
48#define PG_FMAX (PG_FTEXT)
49
50#define PG_NOACC 0
51#define PG_KW 0x10000000
52#define PG_KR 0x18000000
53#define PG_UW 0x20000000
54#define PG_URKW 0x70000000
55#define PG_URKR 0x78000000
56
57/*
58 * Pte related macros
59 */
60#define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \
61 ((pte)->pg_m || (pte)->pg_swapm))
62
63#ifdef KERNEL
64struct pte *vtopte();
65
66/* utilities defined in locore.s */
67extern struct pte Sysmap[];
68extern struct pte Usrptmap[];
69extern struct pte usrpt[];
70extern struct pte Swapmap[];
71extern struct pte Forkmap[];
72extern struct pte Xswapmap[];
73extern struct pte Xswap2map[];
74extern struct pte Pushmap[];
75extern struct pte Vfmap[];
76extern struct pte mmap[];
77extern struct pte mcrmap[];
4b84dfbd 78extern struct pte bufmap[];
cb3a5783 79#endif