allocate page tables for drivers at boot time
[unix-history] / usr / src / sys / tahoe / include / pte.h
CommitLineData
1fd9cec2 1/* pte.h 1.3 86/01/17 */
dbccc6a3
SL
2
3/*
4 * Tahoe 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
13#ifndef LOCORE
14struct pte
15{
16unsigned int
17 pg_v:1, /* valid bit */
18 pg_prot:4, /* access control */
19 pg_fod:1, /* is fill on demand (=0) */
a55e280b 20 :1, /* must write back to swap (unused) */
dbccc6a3
SL
21 pg_nc:1, /* 'uncacheable page' bit */
22 pg_m:1, /* hardware maintained modified bit */
a55e280b 23 pg_u:1, /* hardware maintained 'used' bit */
dbccc6a3
SL
24 pg_pfnum:22; /* core page frame number or 0 */
25};
26struct hpte
27{
28unsigned int
29 pg_high:10, /* special for clustering */
30 pg_pfnum:22;
31};
32struct fpte
33{
34unsigned int
35 pg_v:1,
36 pg_prot:4,
37 pg_fod:1, /* is fill on demand (=1) */
38 :1,
a55e280b
SL
39 pg_fileno:1, /* file mapped from or TEXT or ZERO */
40 pg_blkno:24; /* file system block number */
dbccc6a3
SL
41};
42#endif
43
44#define PG_V 0x80000000
45#define PG_PROT 0x78000000 /* all protection bits (dorit). */
46#define PG_FOD 0x04000000
47#define PG_SWAPM 0x02000000
48#define PG_N 0x01000000 /* Non-cacheable */
49#define PG_M 0x00800000
a55e280b 50#define PG_U 0x00400000 /* not currently used */
dbccc6a3
SL
51#define PG_PFNUM 0x003fffff
52
a55e280b
SL
53#define PG_FZERO 0
54#define PG_FTEXT 1
dbccc6a3
SL
55#define PG_FMAX (PG_FTEXT)
56
57#define PG_NOACC 0
58#define PG_KR 0x40000000
59#define PG_KW 0x60000000
60#define PG_URKR 0x50000000
61#define PG_URKW 0x70000000
62#define PG_UW 0x78000000
63
64/*
65 * Pte related macros
66 */
a55e280b 67#define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && (pte)->pg_m)
dbccc6a3
SL
68
69#ifndef LOCORE
70#ifdef KERNEL
dbccc6a3
SL
71/* utilities defined in locore.s */
72extern struct pte Sysmap[];
73extern struct pte Usrptmap[];
74extern struct pte usrpt[];
75extern struct pte Swapmap[];
76extern struct pte Forkmap[];
77extern struct pte Xswapmap[];
78extern struct pte Xswap2map[];
79extern struct pte Pushmap[];
80extern struct pte Vfmap[];
dbccc6a3
SL
81extern struct pte mmap[];
82extern struct pte msgbufmap[];
83extern struct pte camap[];
84#endif
85#endif