diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-11-10 21:05:07 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-11-10 21:05:07 +0000 |
commit | 8eb95dbc559008de0a791633109476d4cbd840e4 (patch) | |
tree | 627197d52f30e641201d75393af1726f3c018702 /sys/arch/vax/include | |
parent | 958872a868e1d3b880930ae4d3daf3e60c550244 (diff) |
Get rid of the "struct pte" bitfield, and use straight integers.
Makes the code slightly more readble, removes casts, and makes some
specific constants defined for the bitfields disappear in pmap.c...
No functional change.
Diffstat (limited to 'sys/arch/vax/include')
-rw-r--r-- | sys/arch/vax/include/cpu.h | 5 | ||||
-rw-r--r-- | sys/arch/vax/include/pcb.h | 7 | ||||
-rw-r--r-- | sys/arch/vax/include/pmap.h | 10 | ||||
-rw-r--r-- | sys/arch/vax/include/pte.h | 20 | ||||
-rw-r--r-- | sys/arch/vax/include/sgmap.h | 6 |
5 files changed, 18 insertions, 30 deletions
diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h index 24f3111826a..03bd14a720d 100644 --- a/sys/arch/vax/include/cpu.h +++ b/sys/arch/vax/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.14 2003/05/11 19:41:12 deraadt Exp $ */ +/* $OpenBSD: cpu.h,v 1.15 2003/11/10 21:05:06 miod Exp $ */ /* $NetBSD: cpu.h,v 1.41 1999/10/21 20:01:36 ragge Exp $ */ /* @@ -39,6 +39,7 @@ #include <sys/device.h> #include <machine/mtpr.h> +#include <machine/pte.h> #include <machine/pcb.h> #include <machine/uvax.h> #include <machine/psl.h> @@ -124,7 +125,7 @@ void dumpconf(void); void dumpsys(void); void swapconf(void); void disk_printtype(int, int); -void disk_reallymapin(struct buf *, struct pte *, int, int); +void disk_reallymapin(struct buf *, pt_entry_t *, int, int); vaddr_t vax_map_physmem(paddr_t, int); void vax_unmap_physmem(vaddr_t, int); void ioaccess(vaddr_t, paddr_t, int); diff --git a/sys/arch/vax/include/pcb.h b/sys/arch/vax/include/pcb.h index da4b0e1de2d..4f1f787aa42 100644 --- a/sys/arch/vax/include/pcb.h +++ b/sys/arch/vax/include/pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcb.h,v 1.5 2000/10/09 22:57:42 bjc Exp $ */ +/* $OpenBSD: pcb.h,v 1.6 2003/11/10 21:05:06 miod Exp $ */ /* $NetBSD: pcb.h,v 1.10 1996/02/02 18:08:26 mycroft Exp $ */ /* @@ -37,6 +37,7 @@ #define _VAX_PCB_H_ #include <machine/reg.h> +#include <machine/pte.h> struct pcb { @@ -51,9 +52,9 @@ struct pcb { long FP; /* Frame Pointer */ long PC; /* Program Counter */ long PSL; /* Program Status Longword */ - struct pte *P0BR; /* Page 0 Base Register */ + pt_entry_t *P0BR; /* Page 0 Base Register */ long P0LR; /* Page 0 Length Register */ - struct pte *P1BR; /* Page 1 Base Register */ + pt_entry_t *P1BR; /* Page 1 Base Register */ long P1LR; /* Page 1 Length Register */ /* Software registers, only used by kernel software */ diff --git a/sys/arch/vax/include/pmap.h b/sys/arch/vax/include/pmap.h index e0e3e1114a6..512f10b6c80 100644 --- a/sys/arch/vax/include/pmap.h +++ b/sys/arch/vax/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.19 2003/06/02 23:27:57 millert Exp $ */ +/* $OpenBSD: pmap.h,v 1.20 2003/11/10 21:05:06 miod Exp $ */ /* $NetBSD: pmap.h,v 1.37 1999/08/01 13:48:07 ragge Exp $ */ /* @@ -54,7 +54,7 @@ #define LTOHPS (PGSHIFT - VAX_PGSHIFT) #define LTOHPN (1 << LTOHPS) #define USRPTSIZE ((MAXTSIZ + MAXDSIZ + MAXSSIZ + MMAPSPACE) / VAX_NBPG) -#define NPTEPGS (USRPTSIZE / (sizeof(struct pte) * LTOHPN)) +#define NPTEPGS (USRPTSIZE / (sizeof(pt_entry_t) * LTOHPN)) /* * Pmap structure @@ -64,9 +64,9 @@ typedef struct pmap { vaddr_t pm_stack; /* Base of alloced p1 pte space */ int ref_count; /* reference count */ - struct pte *pm_p0br; /* page 0 base register */ + pt_entry_t *pm_p0br; /* page 0 base register */ long pm_p0lr; /* page 0 length register */ - struct pte *pm_p1br; /* page 1 base register */ + pt_entry_t *pm_p1br; /* page 1 base register */ long pm_p1lr; /* page 1 length register */ int pm_lock; /* Lock entry in MP environment */ struct pmap_statistics pm_stats; /* Some statistics */ @@ -80,7 +80,7 @@ typedef struct pmap { struct pv_entry { struct pv_entry *pv_next; /* next pv_entry */ - struct pte *pv_pte; /* pte for this physical page */ + pt_entry_t *pv_pte; /* pte for this physical page */ struct pmap *pv_pmap; /* pmap this entry belongs to */ int pv_attr; /* write/modified bits */ }; diff --git a/sys/arch/vax/include/pte.h b/sys/arch/vax/include/pte.h index 3a746725810..e586d11cd1c 100644 --- a/sys/arch/vax/include/pte.h +++ b/sys/arch/vax/include/pte.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pte.h,v 1.8 2003/11/06 22:54:29 miod Exp $ */ +/* $OpenBSD: pte.h,v 1.9 2003/11/10 21:05:06 miod Exp $ */ /* $NetBSD: pte.h,v 1.13 1999/08/03 19:53:23 ragge Exp $ */ /* @@ -35,22 +35,8 @@ #define _VAX_PTE_H_ #ifndef _LOCORE -/* - * VAX page table entries - */ -struct pte { - unsigned int pg_pfn:21; /* Page Frame Number or 0 */ - unsigned int pg_illegal:2; /* Don't use these bits */ - unsigned int pg_sref:1; /* Help for ref simulation */ - unsigned int pg_w:1; /* Wired bit */ - unsigned int pg_z:1; /* Zero DIGITAL = 0 */ - unsigned int pg_m:1; /* Modify DIGITAL */ - unsigned int pg_prot:4; /* reserved at zero */ - unsigned int pg_v:1; /* valid bit */ -}; - -typedef struct pte pt_entry_t; /* Mach page table entry */ +typedef u_int32_t pt_entry_t; /* Mach page table entry */ #endif /* _LOCORE */ @@ -83,7 +69,7 @@ extern pt_entry_t *Sysmap; #define ptetokv(pt) \ ((((pt_entry_t *)(pt) - Sysmap) << VAX_PGSHIFT) + 0x80000000) #define kvtophys(va) \ - (((kvtopte(va))->pg_pfn << VAX_PGSHIFT) | ((int)(va) & VAX_PGOFSET)) + (((*kvtopte(va) & PG_FRAME) << VAX_PGSHIFT) | ((int)(va) & VAX_PGOFSET)) #define uvtopte(va, pcb) \ (((unsigned)va < 0x40000000) ? \ &((pcb->P0BR)[PG_PFNUM(va)]) : \ diff --git a/sys/arch/vax/include/sgmap.h b/sys/arch/vax/include/sgmap.h index 52d1f68cd57..74e7d750bd0 100644 --- a/sys/arch/vax/include/sgmap.h +++ b/sys/arch/vax/include/sgmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sgmap.h,v 1.5 2002/03/14 01:26:48 millert Exp $ */ +/* $OpenBSD: sgmap.h,v 1.6 2003/11/10 21:05:06 miod Exp $ */ /* $NetBSD: sgmap.h,v 1.3 2000/05/17 21:22:18 matt Exp $ */ /*- @@ -56,7 +56,7 @@ */ struct vax_sgmap { struct extent *aps_ex; /* extent map to manage sgva space */ - struct pte *aps_pt; /* page table */ + pt_entry_t *aps_pt; /* page table */ bus_addr_t aps_sgvabase; /* base of the sgva space */ bus_size_t aps_sgvasize; /* size of the sgva space */ bus_addr_t aps_pa; /* Address in region */ @@ -64,7 +64,7 @@ struct vax_sgmap { }; void vax_sgmap_init(bus_dma_tag_t, struct vax_sgmap *, - const char *, bus_addr_t, bus_size_t, struct pte *, bus_size_t); + const char *, bus_addr_t, bus_size_t, pt_entry_t *, bus_size_t); int vax_sgmap_alloc(bus_dmamap_t, bus_size_t, struct vax_sgmap *, int); |