diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-09-05 03:08:56 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-09-05 03:08:56 +0000 |
commit | 41a8c51cff4ae8c4aa06a77b6563d3c13cc34b06 (patch) | |
tree | 3c33151669825c73a6a14714306d9932363c253a /sys/arch/powerpc | |
parent | 07625360c6ff5e00fbb971c99b2955011b31715a (diff) |
Prepare the bat for kernels greater > 8MB of code, why because clang.
ok kettenis
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r-- | sys/arch/powerpc/powerpc/pmap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c index a1bbe01da38..98d05ecd8cf 100644 --- a/sys/arch/powerpc/powerpc/pmap.c +++ b/sys/arch/powerpc/powerpc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.170 2019/09/03 14:34:41 deraadt Exp $ */ +/* $OpenBSD: pmap.c,v 1.171 2019/09/05 03:08:55 deraadt Exp $ */ /* * Copyright (c) 2015 Martin Pieuchot @@ -1633,13 +1633,18 @@ pmap_enable_mmu(void) int i; if (!ppc_nobat) { + extern caddr_t etext; + /* DBAT0 used for initial segment */ ppc_mtdbat0l(battable[0].batl); ppc_mtdbat0u(battable[0].batu); /* IBAT0 only covering the kernel .text */ ppc_mtibat0l(battable[0].batl); - ppc_mtibat0u(BATU(0x00000000, BAT_BL_8M)); + if (round_page((vaddr_t)&etext) < 8*1024*1024) + ppc_mtibat0u(BATU(0x00000000, BAT_BL_8M)); + else + ppc_mtibat0u(BATU(0x00000000, BAT_BL_16M)); } for (i = 0; i < 16; i++) |