add definitions for 730 SID
[unix-history] / usr / src / sys / vax / include / pte.h
CommitLineData
da7c5cc6
KM
1/*
2 * Copyright (c) 1982 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
6 * @(#)pte.h 6.5 (Berkeley) %G%
7 */
cb3a5783
BJ
8
9/*
10 * VAX page table entry
11 *
12 * There are two major kinds of pte's: those which have ever existed (and are
13 * thus either now in core or on the swap device), and those which have
14 * never existed, but which will be filled on demand at first reference.
15 * There is a structure describing each. There is also an ancillary
16 * structure used in page clustering.
17 */
18
5d1a7b0a 19#ifndef LOCORE
cb3a5783
BJ
20struct pte
21{
22unsigned int pg_pfnum:21, /* core page frame number or 0 */
23 :2,
24 pg_vreadm:1, /* modified since vread (or with _m) */
25 pg_swapm:1, /* have to write back to swap */
26 pg_fod:1, /* is fill on demand (=0) */
27 pg_m:1, /* hardware maintained modified bit */
28 pg_prot:4, /* access control */
29 pg_v:1; /* valid bit */
30};
31struct hpte
32{
33unsigned int pg_pfnum:21,
34 :2,
35 pg_high:9; /* special for clustering */
36};
37struct fpte
38{
b834dc16
KM
39unsigned int pg_blkno:24, /* file system block number */
40 pg_fileno:1, /* file mapped from or TEXT or ZERO */
cb3a5783
BJ
41 pg_fod:1, /* is fill on demand (=1) */
42 :1,
43 pg_prot:4,
44 pg_v:1;
45};
5d1a7b0a 46#endif
cb3a5783
BJ
47
48#define PG_V 0x80000000
49#define PG_PROT 0x78000000
50#define PG_M 0x04000000
3e2f54af 51#define PG_FOD 0x02000000
cb3a5783
BJ
52#define PG_VREADM 0x00800000
53#define PG_PFNUM 0x001fffff
54
3765e049
MK
55#define PG_FZERO 0
56#define PG_FTEXT 1
cb3a5783
BJ
57#define PG_FMAX (PG_FTEXT)
58
59#define PG_NOACC 0
60#define PG_KW 0x10000000
61#define PG_KR 0x18000000
62#define PG_UW 0x20000000
63#define PG_URKW 0x70000000
64#define PG_URKR 0x78000000
65
66/*
67 * Pte related macros
68 */
69#define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \
70 ((pte)->pg_m || (pte)->pg_swapm))
71
5d1a7b0a 72#ifndef LOCORE
cb3a5783 73#ifdef KERNEL
cb3a5783
BJ
74
75/* utilities defined in locore.s */
76extern struct pte Sysmap[];
77extern struct pte Usrptmap[];
78extern struct pte usrpt[];
79extern struct pte Swapmap[];
80extern struct pte Forkmap[];
81extern struct pte Xswapmap[];
82extern struct pte Xswap2map[];
83extern struct pte Pushmap[];
84extern struct pte Vfmap[];
85extern struct pte mmap[];
a5e17cf9 86extern struct pte msgbufmap[];
b7c71f19 87extern struct pte camap[];
4d752f43 88extern struct pte Nexmap[][16];
cb3a5783 89#endif
5d1a7b0a 90#endif