summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/arch/macppc/macppc/machdep.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index 0b6548f9f4f..18ed83f1a52 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.180 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.181 2017/06/13 01:42:12 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -331,16 +331,17 @@ install_extint(void (*handler)(void))
void extint(void);
void extsize(void);
extern u_long extint_call;
- u_long offset = (u_long)handler - (u_long)&extint_call;
+ long offset = (u_long)handler - (u_long)&extint_call;
int omsr, msr;
-#ifdef DIAGNOSTIC
- if (offset > 0x1ffffff)
+#ifdef DIAGNOSTIC
+ if (offset > 0x1ffffff || offset < -0x1ffffff)
panic("install_extint: too far away");
#endif
omsr = ppc_mfmsr();
msr = omsr & ~PSL_EE;
ppc_mtmsr(msr);
+ offset &= 0x3ffffff;
extint_call = (extint_call & 0xfc000003) | offset;
bcopy(&extint, (void *)EXC_EXI, (size_t)&extsize);
syncicache((void *)&extint_call, sizeof extint_call);