diff options
Diffstat (limited to 'sys/arch/mips64/include')
-rw-r--r-- | sys/arch/mips64/include/param.h | 7 | ||||
-rw-r--r-- | sys/arch/mips64/include/pmap.h | 21 | ||||
-rw-r--r-- | sys/arch/mips64/include/pte.h | 3 |
3 files changed, 22 insertions, 9 deletions
diff --git a/sys/arch/mips64/include/param.h b/sys/arch/mips64/include/param.h index 85629e6df67..ce39ab7c97b 100644 --- a/sys/arch/mips64/include/param.h +++ b/sys/arch/mips64/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.20 2009/05/22 20:37:53 miod Exp $ */ +/* $OpenBSD: param.h,v 1.21 2009/12/07 18:58:32 miod Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -61,11 +61,6 @@ #define PAGE_SIZE (1 << PAGE_SHIFT) #define PAGE_MASK (PAGE_SIZE - 1) -#define NPTEPG (NBPG/4) - -#define NBSEG 0x400000 /* bytes/segment */ -#define SEGOFSET (NBSEG-1) /* byte offset into segment */ -#define SEGSHIFT 22 /* LOG2(NBSEG) */ #ifdef __LP64__ #define KERNBASE 0xffffffff80000000L /* start of kernel virtual */ diff --git a/sys/arch/mips64/include/pmap.h b/sys/arch/mips64/include/pmap.h index 26c379b7ca0..002dcb012d1 100644 --- a/sys/arch/mips64/include/pmap.h +++ b/sys/arch/mips64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.15 2009/11/18 20:58:50 miod Exp $ */ +/* $OpenBSD: pmap.h,v 1.16 2009/12/07 18:58:32 miod Exp $ */ /* * Copyright (c) 1987 Carnegie-Mellon University @@ -64,11 +64,28 @@ * dynamically allocated at boot time. */ +/* + * Size of second level page structs (page tables, and segment table) used + * by this pmap. + */ + +#define PMAP_L2SHIFT 12 +#define PMAP_L2SIZE (1UL << PMAP_L2SHIFT) + +/* + * Segment sizes + */ + +/* -2 below is for log2(sizeof pt_entry_t) */ +#define SEGSHIFT (PAGE_SHIFT + PMAP_L2SHIFT - 2) +#define NBSEG (1UL << SEGSHIFT) +#define SEGOFSET (NBSEG - 1) + #define mips_trunc_seg(x) ((vaddr_t)(x) & ~SEGOFSET) #define mips_round_seg(x) (((vaddr_t)(x) + SEGOFSET) & ~SEGOFSET) #define pmap_segmap(m, v) ((m)->pm_segtab->seg_tab[((v) >> SEGSHIFT)]) -#define PMAP_SEGTABSIZE 512 +#define PMAP_SEGTABSIZE (PMAP_L2SIZE / sizeof(void *)) struct segtab { pt_entry_t *seg_tab[PMAP_SEGTABSIZE]; diff --git a/sys/arch/mips64/include/pte.h b/sys/arch/mips64/include/pte.h index b2490befd85..1860aaa16ad 100644 --- a/sys/arch/mips64/include/pte.h +++ b/sys/arch/mips64/include/pte.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pte.h,v 1.8 2009/11/18 20:58:50 miod Exp $ */ +/* $OpenBSD: pte.h,v 1.9 2009/12/07 18:58:32 miod Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -55,6 +55,7 @@ struct tlb_entry { }; typedef u_int32_t pt_entry_t; /* Mips page table entry */ +#define NPTEPG (PMAP_L2SIZE / sizeof(pt_entry_t)) #endif /* _LOCORE */ |