xref: /csrg-svn/sys/vax/include/pte.h (revision 2174)
1*2174Swnj /*	pte.h	4.2	01/15/81	*/
269Sbill 
369Sbill /*
469Sbill  * VAX page table entry
569Sbill  *
669Sbill  * There are two major kinds of pte's: those which have ever existed (and are
769Sbill  * thus either now in core or on the swap device), and those which have
869Sbill  * never existed, but which will be filled on demand at first reference.
969Sbill  * There is a structure describing each.  There is also an ancillary
1069Sbill  * structure used in page clustering.
1169Sbill  */
1269Sbill 
1369Sbill struct pte
1469Sbill {
1569Sbill unsigned int	pg_pfnum:21,		/* core page frame number or 0 */
1669Sbill 		:2,
1769Sbill 		pg_vreadm:1,		/* modified since vread (or with _m) */
1869Sbill 		pg_swapm:1,		/* have to write back to swap */
1969Sbill 		pg_fod:1,		/* is fill on demand (=0) */
2069Sbill 		pg_m:1,			/* hardware maintained modified bit */
2169Sbill 		pg_prot:4,		/* access control */
2269Sbill 		pg_v:1;			/* valid bit */
2369Sbill };
2469Sbill struct hpte
2569Sbill {
2669Sbill unsigned int	pg_pfnum:21,
2769Sbill 		:2,
2869Sbill 		pg_high:9;		/* special for clustering */
2969Sbill };
3069Sbill struct fpte
3169Sbill {
3269Sbill unsigned int	pg_blkno:20,		/* file system block number */
3369Sbill 		pg_fileno:5,		/* file mapped from or TEXT or ZERO */
3469Sbill 		pg_fod:1,		/* is fill on demand (=1) */
3569Sbill 		:1,
3669Sbill 		pg_prot:4,
3769Sbill 		pg_v:1;
3869Sbill };
3969Sbill 
4069Sbill #define	PG_V		0x80000000
4169Sbill #define	PG_PROT		0x78000000
4269Sbill #define	PG_M		0x04000000
4369Sbill #define	PG_VREADM	0x00800000
4469Sbill #define	PG_PFNUM	0x001fffff
4569Sbill 
4669Sbill #define	PG_FZERO	(NOFILE)
4769Sbill #define	PG_FTEXT	(NOFILE+1)
4869Sbill #define	PG_FMAX		(PG_FTEXT)
4969Sbill 
5069Sbill #define	PG_NOACC	0
5169Sbill #define	PG_KW		0x10000000
5269Sbill #define	PG_KR		0x18000000
5369Sbill #define	PG_UW		0x20000000
5469Sbill #define	PG_URKW		0x70000000
5569Sbill #define	PG_URKR		0x78000000
5669Sbill 
5769Sbill /*
5869Sbill  * Pte related macros
5969Sbill  */
6069Sbill #define	dirty(pte)	((pte)->pg_fod == 0 && (pte)->pg_pfnum && \
6169Sbill 			    ((pte)->pg_m || (pte)->pg_swapm))
6269Sbill 
6369Sbill #ifdef KERNEL
6469Sbill struct	pte *vtopte();
6569Sbill 
6669Sbill /* utilities defined in locore.s */
6769Sbill extern	struct pte Sysmap[];
6869Sbill extern	struct pte Usrptmap[];
6969Sbill extern	struct pte usrpt[];
7069Sbill extern	struct pte Swapmap[];
7169Sbill extern	struct pte Forkmap[];
7269Sbill extern	struct pte Xswapmap[];
7369Sbill extern	struct pte Xswap2map[];
7469Sbill extern	struct pte Pushmap[];
7569Sbill extern	struct pte Vfmap[];
7669Sbill extern	struct pte mmap[];
7769Sbill extern	struct pte mcrmap[];
78730Sbill extern	struct pte bufmap[];
79*2174Swnj extern	struct pte msgbufmap[];
8069Sbill #endif
81