1*3774Sroot /* pte.h 4.9 81/05/14 */ 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 132642Swnj #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 }; 402642Swnj #endif 4169Sbill 4269Sbill #define PG_V 0x80000000 4369Sbill #define PG_PROT 0x78000000 4469Sbill #define PG_M 0x04000000 45*3774Sroot #define PG_FOD 0x02000000 4669Sbill #define PG_VREADM 0x00800000 4769Sbill #define PG_PFNUM 0x001fffff 4869Sbill 4969Sbill #define PG_FZERO (NOFILE) 5069Sbill #define PG_FTEXT (NOFILE+1) 5169Sbill #define PG_FMAX (PG_FTEXT) 5269Sbill 5369Sbill #define PG_NOACC 0 5469Sbill #define PG_KW 0x10000000 5569Sbill #define PG_KR 0x18000000 5669Sbill #define PG_UW 0x20000000 5769Sbill #define PG_URKW 0x70000000 5869Sbill #define PG_URKR 0x78000000 5969Sbill 6069Sbill /* 6169Sbill * Pte related macros 6269Sbill */ 6369Sbill #define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \ 6469Sbill ((pte)->pg_m || (pte)->pg_swapm)) 6569Sbill 662642Swnj #ifndef LOCORE 6769Sbill #ifdef KERNEL 6869Sbill struct pte *vtopte(); 6969Sbill 7069Sbill /* utilities defined in locore.s */ 7169Sbill extern struct pte Sysmap[]; 7269Sbill extern struct pte Usrptmap[]; 7369Sbill extern struct pte usrpt[]; 7469Sbill extern struct pte Swapmap[]; 7569Sbill extern struct pte Forkmap[]; 7669Sbill extern struct pte Xswapmap[]; 7769Sbill extern struct pte Xswap2map[]; 7869Sbill extern struct pte Pushmap[]; 7969Sbill extern struct pte Vfmap[]; 8069Sbill extern struct pte mmap[]; 812174Swnj extern struct pte msgbufmap[]; 822365Swnj extern struct pte camap[]; 832748Swnj extern struct pte Nexmap[][16]; 8469Sbill #endif 852642Swnj #endif 86