1*2642Swnj /* pte.h 4.6 81/02/23 */ 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 13*2642Swnj #ifndef LOCORE 1469Sbill struct pte 1569Sbill { 1669Sbill unsigned int pg_pfnum:21, /* core page frame number or 0 */ 1769Sbill :2, 1869Sbill pg_vreadm:1, /* modified since vread (or with _m) */ 1969Sbill pg_swapm:1, /* have to write back to swap */ 2069Sbill pg_fod:1, /* is fill on demand (=0) */ 2169Sbill pg_m:1, /* hardware maintained modified bit */ 2269Sbill pg_prot:4, /* access control */ 2369Sbill pg_v:1; /* valid bit */ 2469Sbill }; 2569Sbill struct hpte 2669Sbill { 2769Sbill unsigned int pg_pfnum:21, 2869Sbill :2, 2969Sbill pg_high:9; /* special for clustering */ 3069Sbill }; 3169Sbill struct fpte 3269Sbill { 3369Sbill unsigned int pg_blkno:20, /* file system block number */ 3469Sbill pg_fileno:5, /* file mapped from or TEXT or ZERO */ 3569Sbill pg_fod:1, /* is fill on demand (=1) */ 3669Sbill :1, 3769Sbill pg_prot:4, 3869Sbill pg_v:1; 3969Sbill }; 40*2642Swnj #endif 4169Sbill 4269Sbill #define PG_V 0x80000000 4369Sbill #define PG_PROT 0x78000000 4469Sbill #define PG_M 0x04000000 4569Sbill #define PG_VREADM 0x00800000 4669Sbill #define PG_PFNUM 0x001fffff 4769Sbill 4869Sbill #define PG_FZERO (NOFILE) 4969Sbill #define PG_FTEXT (NOFILE+1) 5069Sbill #define PG_FMAX (PG_FTEXT) 5169Sbill 5269Sbill #define PG_NOACC 0 5369Sbill #define PG_KW 0x10000000 5469Sbill #define PG_KR 0x18000000 5569Sbill #define PG_UW 0x20000000 5669Sbill #define PG_URKW 0x70000000 5769Sbill #define PG_URKR 0x78000000 5869Sbill 5969Sbill /* 6069Sbill * Pte related macros 6169Sbill */ 6269Sbill #define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \ 6369Sbill ((pte)->pg_m || (pte)->pg_swapm)) 6469Sbill 65*2642Swnj #ifndef LOCORE 6669Sbill #ifdef KERNEL 6769Sbill struct pte *vtopte(); 6869Sbill 6969Sbill /* utilities defined in locore.s */ 7069Sbill extern struct pte Sysmap[]; 7169Sbill extern struct pte Usrptmap[]; 7269Sbill extern struct pte usrpt[]; 7369Sbill extern struct pte Swapmap[]; 7469Sbill extern struct pte Forkmap[]; 7569Sbill extern struct pte Xswapmap[]; 7669Sbill extern struct pte Xswap2map[]; 7769Sbill extern struct pte Pushmap[]; 7869Sbill extern struct pte Vfmap[]; 7969Sbill extern struct pte mmap[]; 8069Sbill extern struct pte mcrmap[]; 81730Sbill extern struct pte bufmap[]; 822174Swnj extern struct pte msgbufmap[]; 832365Swnj extern struct pte camap[]; 842428Swnj extern struct pte Nexmap[16][16]; 8569Sbill #endif 86*2642Swnj #endif 87