123270Smckusick /* 223270Smckusick * Copyright (c) 1982 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*24180Sbloom * @(#)pte.h 6.6 (Berkeley) 08/05/85 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) */ 2569Sbill pg_swapm:1, /* have to write back to swap */ 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 */ 6969Sbill #define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \ 7069Sbill ((pte)->pg_m || (pte)->pg_swapm)) 7169Sbill 722642Swnj #ifndef LOCORE 7369Sbill #ifdef KERNEL 7469Sbill 7569Sbill /* utilities defined in locore.s */ 7669Sbill extern struct pte Sysmap[]; 7769Sbill extern struct pte Usrptmap[]; 7869Sbill extern struct pte usrpt[]; 7969Sbill extern struct pte Swapmap[]; 8069Sbill extern struct pte Forkmap[]; 8169Sbill extern struct pte Xswapmap[]; 8269Sbill extern struct pte Xswap2map[]; 8369Sbill extern struct pte Pushmap[]; 8469Sbill extern struct pte Vfmap[]; 8569Sbill extern struct pte mmap[]; 862174Swnj extern struct pte msgbufmap[]; 872365Swnj extern struct pte camap[]; 882748Swnj extern struct pte Nexmap[][16]; 89*24180Sbloom extern struct pte Ioamap[][1]; 9069Sbill #endif 912642Swnj #endif 92