Index: oea_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/powerpc/oea/oea_machdep.c,v retrieving revision 1.73 diff -p -u -r1.73 oea_machdep.c --- oea_machdep.c 30 May 2016 13:04:24 -0000 1.73 +++ oea_machdep.c 10 Feb 2018 11:08:02 -0000 @@ -144,7 +144,11 @@ oea_init(void (*handler)(void)) #ifdef PPC_HIGH_VEC exc_base = EXC_HIGHVEC; #else - exc_base = 0; + /* + * Load "pointer" with 0 behind GCC's back, otherwise it will + * emit a "trap" instead. + */ + __asm volatile ("li %0, 0" : "=r"(exc_base) :); #endif KASSERT(mfspr(SPR_SPRG0) == (uintptr_t)ci); @@ -289,8 +293,15 @@ oea_init(void (*handler)(void)) * Install a branch absolute to trap0 to force a panic. */ if ((uintptr_t)trap0 < 0x2000000) { - *(volatile uint32_t *) 0 = 0x7c6802a6; - *(volatile uint32_t *) 4 = 0x48000002 | (uintptr_t) trap0; + uint32_t *p; + + /* + * Load "pointer" with 0 behind GCC's back, otherwise it will + * emit a "trap" instead. + */ + __asm volatile ("li %0, 0" : "=r"(p) :); + p[0] = 0x7c6802a6; + p[1] = 0x48000002 | (uintptr_t) trap0; } /*