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