xref: /csrg-svn/sys/vax/include/pte.h (revision 31834)
123270Smckusick /*
229194Smckusick  * Copyright (c) 1982, 1986 Regents of the University of California.
323270Smckusick  * All rights reserved.  The Berkeley software License Agreement
423270Smckusick  * specifies the terms and conditions for redistribution.
523270Smckusick  *
6*31834Skarels  *	@(#)pte.h	7.3 (Berkeley) 07/11/87
723270Smckusick  */
869Sbill 
969Sbill /*
1069Sbill  * VAX page table entry
1169Sbill  *
1269Sbill  * There are two major kinds of pte's: those which have ever existed (and are
1369Sbill  * thus either now in core or on the swap device), and those which have
1469Sbill  * never existed, but which will be filled on demand at first reference.
1569Sbill  * There is a structure describing each.  There is also an ancillary
1669Sbill  * structure used in page clustering.
1769Sbill  */
1869Sbill 
192642Swnj #ifndef LOCORE
2069Sbill struct pte
2169Sbill {
2269Sbill unsigned int	pg_pfnum:21,		/* core page frame number or 0 */
2369Sbill 		:2,
2469Sbill 		pg_vreadm:1,		/* modified since vread (or with _m) */
25*31834Skarels 		:1,
2669Sbill 		pg_fod:1,		/* is fill on demand (=0) */
2769Sbill 		pg_m:1,			/* hardware maintained modified bit */
2869Sbill 		pg_prot:4,		/* access control */
2969Sbill 		pg_v:1;			/* valid bit */
3069Sbill };
3169Sbill struct hpte
3269Sbill {
3369Sbill unsigned int	pg_pfnum:21,
3469Sbill 		:2,
3569Sbill 		pg_high:9;		/* special for clustering */
3669Sbill };
3769Sbill struct fpte
3869Sbill {
3918657Smckusick unsigned int	pg_blkno:24,		/* file system block number */
4018657Smckusick 		pg_fileno:1,		/* file mapped from or TEXT or ZERO */
4169Sbill 		pg_fod:1,		/* is fill on demand (=1) */
4269Sbill 		:1,
4369Sbill 		pg_prot:4,
4469Sbill 		pg_v:1;
4569Sbill };
462642Swnj #endif
4769Sbill 
4869Sbill #define	PG_V		0x80000000
4969Sbill #define	PG_PROT		0x78000000
5069Sbill #define	PG_M		0x04000000
513774Sroot #define	PG_FOD		0x02000000
5269Sbill #define	PG_VREADM	0x00800000
5369Sbill #define	PG_PFNUM	0x001fffff
5469Sbill 
5517547Skarels #define	PG_FZERO	0
5617547Skarels #define	PG_FTEXT	1
5769Sbill #define	PG_FMAX		(PG_FTEXT)
5869Sbill 
5969Sbill #define	PG_NOACC	0
6069Sbill #define	PG_KW		0x10000000
6169Sbill #define	PG_KR		0x18000000
6269Sbill #define	PG_UW		0x20000000
6369Sbill #define	PG_URKW		0x70000000
6469Sbill #define	PG_URKR		0x78000000
6569Sbill 
6669Sbill /*
6769Sbill  * Pte related macros
6869Sbill  */
69*31834Skarels #define	dirty(pte)	((pte)->pg_m)
7069Sbill 
712642Swnj #ifndef LOCORE
7269Sbill #ifdef KERNEL
7369Sbill 
7469Sbill /* utilities defined in locore.s */
7569Sbill extern	struct pte Sysmap[];
7669Sbill extern	struct pte Usrptmap[];
7769Sbill extern	struct pte usrpt[];
7869Sbill extern	struct pte Swapmap[];
7969Sbill extern	struct pte Forkmap[];
8069Sbill extern	struct pte Xswapmap[];
8169Sbill extern	struct pte Xswap2map[];
8269Sbill extern	struct pte Pushmap[];
8369Sbill extern	struct pte Vfmap[];
8469Sbill extern	struct pte mmap[];
852174Swnj extern	struct pte msgbufmap[];
8631645Smckusick extern	struct pte kmempt[], ekmempt[];
872748Swnj extern	struct pte Nexmap[][16];
8824180Sbloom extern	struct pte Ioamap[][1];
8927249Skridle #ifdef VAX630
9027249Skridle extern	struct pte Clockmap[];
9127249Skridle extern	struct pte Ka630map[];
9269Sbill #endif
932642Swnj #endif
9427249Skridle #endif
95