diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc/include/pmap.h | 6 | ||||
-rw-r--r-- | sys/arch/sparc/include/vmparam.h | 5 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/autoconf.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/pmap.c | 44 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/trap.c | 4 |
6 files changed, 38 insertions, 29 deletions
diff --git a/sys/arch/sparc/include/pmap.h b/sys/arch/sparc/include/pmap.h index e774a05dfb4..03881858700 100644 --- a/sys/arch/sparc/include/pmap.h +++ b/sys/arch/sparc/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.58 2015/03/18 20:56:40 miod Exp $ */ +/* $OpenBSD: pmap.h,v 1.59 2015/03/27 20:25:39 miod Exp $ */ /* $NetBSD: pmap.h,v 1.30 1997/08/04 20:00:47 pk Exp $ */ /* @@ -132,8 +132,8 @@ * */ #define NKREG_4C \ - ((unsigned int)(-VM_MIN_KERNEL_ADDRESS_OLD / NBPRG)) /* 8 */ -#define NUREG_4C (256 - NKREG_4C) /* 248 */ + ((unsigned int)(-VM_MIN_KERNEL_ADDRESS_SUN4 / NBPRG)) /* 16 */ +#define NUREG_4C (256 - NKREG_4C) /* 240 */ #define NKREG_4M \ ((unsigned int)(-VM_MIN_KERNEL_ADDRESS_SRMMU / NBPRG)) /* 64 */ #define NUREG_4M (256 - NKREG_4M) /* 192 */ diff --git a/sys/arch/sparc/include/vmparam.h b/sys/arch/sparc/include/vmparam.h index 5e678c920e6..b7356412985 100644 --- a/sys/arch/sparc/include/vmparam.h +++ b/sys/arch/sparc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.43 2015/03/18 20:56:40 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.44 2015/03/27 20:25:39 miod Exp $ */ /* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */ /* @@ -87,6 +87,7 @@ */ #define VM_MIN_KERNEL_ADDRESS_OLD ((vaddr_t)KERNBASE) +#define VM_MIN_KERNEL_ADDRESS_SUN4 ((vaddr_t)0xf0000000) #define VM_MIN_KERNEL_ADDRESS_SRMMU ((vaddr_t)0xc0000000) #if defined(SMALL_KERNEL) @@ -105,7 +106,7 @@ extern vsize_t vm_kernel_space_size; #define USRSTACK vm_min_kernel_address #elif (defined(SUN4) || defined(SUN4C) || defined(SUN4E)) /* old Sun MMU with address hole */ -#define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS_OLD +#define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS_SUN4 #define VM_MAXUSER_ADDRESS VM_MIN_KERNEL_ADDRESS #define VM_MAX_ADDRESS VM_MIN_KERNEL_ADDRESS #define USRSTACK VM_MIN_KERNEL_ADDRESS diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index 05955e3936a..7b33c80842d 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.98 2015/03/18 20:56:40 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.99 2015/03/27 20:25:39 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */ /* @@ -251,7 +251,7 @@ bootstrap() #if (defined(SUN4) || defined(SUN4C) || defined(SUN4E)) && \ (defined(SUN4D) || defined(SUN4M)) && !defined(SMALL_KERNEL) if (CPU_ISSUN4OR4COR4E) - vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS_OLD; + vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS_SUN4; else vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS_SRMMU; vm_kernel_space_size = VM_MAX_KERNEL_ADDRESS - vm_min_kernel_address; diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 017ccc0d5b2..45390ce5772 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.169 2015/03/18 20:56:40 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.170 2015/03/27 20:25:39 miod Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -175,7 +175,7 @@ cpu_startup() printf("real mem = %lu (%luMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); -#if (defined(SUN4D) || defined(SUN4M)) && !defined(SMALL_KERNEL) +#if !defined(SMALL_KERNEL) /* * uvm_km_init() has allocated all the virtual memory below the * end of the kernel image. If VM_MIN_KERNEL_ADDRESS is below diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c index ce0116198a5..b8c94f4d1ff 100644 --- a/sys/arch/sparc/sparc/pmap.c +++ b/sys/arch/sparc/sparc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.176 2015/03/18 20:56:40 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.177 2015/03/27 20:25:39 miod Exp $ */ /* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */ /* @@ -89,10 +89,17 @@ * boot blocks which do not map enough data after the kernel image to * cover pmap_bootstrap() needs.) */ -#undef NUREG_4M +#define NKREG_OLD \ + ((unsigned int)(-VM_MIN_KERNEL_ADDRESS_OLD / NBPRG)) /* 8 */ +#define NUREG_OLD (256 - NKREG_OLD) /* 248 */ +#undef NKREG_4C +#undef NUREG_4C #undef NKREG_4M -#define NUREG_4M NUREG_4C -#define NKREG_4M NKREG_4C +#undef NUREG_4M +#define NKREG_4C NKREG_OLD +#define NUREG_4C NUREG_OLD +#define NKREG_4M NKREG_OLD +#define NUREG_4M NUREG_OLD #endif #ifdef DEBUG @@ -177,7 +184,7 @@ int pmapdebug = 0; static __inline struct pvlist *pvhead(int); #if defined(SUN4M) -static u_int VA2PA(caddr_t); +u_int VA2PA(caddr_t); #endif /* @@ -492,9 +499,9 @@ void setpte4m(vaddr_t va, int pte); */ #if defined(SUN4M) -static void mmu_setup4m_L1(int, struct pmap *); -static void mmu_setup4m_L2(int, struct regmap *); -static void mmu_setup4m_L3(int, struct segmap *); +void mmu_setup4m_L1(int, struct pmap *); +void mmu_setup4m_L2(int, struct regmap *); +void mmu_setup4m_L3(int, struct segmap *); void mmu_reservemon4m(struct pmap *); void pmap_rmk4m(struct pmap *, vaddr_t, vaddr_t, int, int); @@ -585,7 +592,7 @@ void (*pmap_rmu_p)(struct pmap *, vaddr_t, vaddr_t, int, int); * This routine should work with any level of mapping, as it is used * during bootup to interact with the ROM's initial L1 mapping of the kernel. */ -static u_int +u_int VA2PA(addr) caddr_t addr; { @@ -684,7 +691,7 @@ setpte4m(va, pte) u_int protection_codes[2][8]; #define pte_prot4m(pm, prot) (protection_codes[pm == pmap_kernel()?0:1][prot]) -static void +void sparc_protection_init4m(void) { u_int prot, *kp, *up; @@ -766,7 +773,7 @@ sparc_protection_init4m(void) } while (0) -static void get_phys_mem(void **); +void get_phys_mem(void **); void ctx_alloc(struct pmap *); void ctx_free(struct pmap *); void pg_flushcache(struct vm_page *); @@ -862,7 +869,7 @@ pmap_virtual_space(v_start, v_end) /* * Helper routine that hands off available physical pages to the VM system. */ -static void +void pmap_page_upload(void) { int n; @@ -2660,10 +2667,10 @@ int nptesg; #endif #if defined(SUN4M) -static void pmap_bootstrap4m(void *); +void pmap_bootstrap4m(void *); #endif #if defined(SUN4) || defined(SUN4C) || defined(SUN4E) -static void pmap_bootstrap4_4c(void *, int, int, int); +void pmap_bootstrap4_4c(void *, int, int, int); #endif /* @@ -2748,6 +2755,7 @@ pmap_bootstrap4_4c(void *top, int nctx, int nregion, int nsegment) ((getpte4(kernel_text) & PG_PFNUM) << PGSHIFT); switch (cputyp) { + default: case CPU_SUN4C: case CPU_SUN4E: mmu_has_hole = 1; @@ -2919,9 +2927,9 @@ pmap_bootstrap4_4c(void *top, int nctx, int nregion, int nsegment) */ lastpage = NPTESG; - p = (caddr_t)VM_MIN_KERNEL_ADDRESS_OLD; /* first va */ - vs = VA_VSEG(VM_MIN_KERNEL_ADDRESS_OLD);/* first virtual segment */ - vr = VA_VREG(VM_MIN_KERNEL_ADDRESS_OLD);/* first virtual region */ + p = (caddr_t)KERNBASE; /* first kernel va */ + vs = VA_VSEG((vaddr_t)p);/* first virtual segment */ + vr = VA_VREG((vaddr_t)p);/* first virtual region */ rp = &pmap_kernel()->pm_regmap[vr]; /* Get region/segment where kernel addresses start */ @@ -3107,7 +3115,7 @@ pmap_bootstrap4_4c(void *top, int nctx, int nregion, int nsegment) * * Switches from ROM to kernel page tables, and sets up initial mappings. */ -static void +void pmap_bootstrap4m(void *top) { int i, j; diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index 11478c6c26b..751a50b13e9 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.70 2015/03/18 20:56:40 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.71 2015/03/27 20:25:39 miod Exp $ */ /* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */ /* @@ -633,7 +633,7 @@ mem_access_fault(type, ser, v, pc, psr, tf) */ if (cold) goto kfault; - if (va >= VM_MIN_KERNEL_ADDRESS_OLD) { + if (va >= vm_min_kernel_address) { if (uvm_fault(kernel_map, va, 0, ftype) == 0) return; goto kfault; |