diff options
Diffstat (limited to 'sys/arch/m88k')
-rw-r--r-- | sys/arch/m88k/m88k/m88k_machdep.c | 15 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/trap.c | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/arch/m88k/m88k/m88k_machdep.c b/sys/arch/m88k/m88k/m88k_machdep.c index 2d20ef838b0..be41eeb193a 100644 --- a/sys/arch/m88k/m88k/m88k_machdep.c +++ b/sys/arch/m88k/m88k/m88k_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m88k_machdep.c,v 1.41 2007/12/26 22:21:39 miod Exp $ */ +/* $OpenBSD: m88k_machdep.c,v 1.42 2008/11/27 20:46:48 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -178,9 +178,20 @@ setregs(p, pack, stack, retval) #ifdef M88100 if (CPU_IS88100) { /* - * m88100_syscall() will resume at sfip / sfip + 4. + * m88100_syscall() will resume at sfip / sfip + 4... */ tf->tf_sfip = ((pack->ep_entry + 8) & FIP_ADDR) | FIP_V; + + /* + * ... unless we are starting init, in which case we + * won't be returning through the regular path, and + * need to explicitely set up nip and fip (note that + * 88110 do not need such a test). + */ + if (p->p_pid == 1) { + tf->tf_snip = tf->tf_sfip; + tf->tf_sfip += 4; + } } #endif tf->tf_r[2] = retval[0] = stack; diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index b8f35945129..b2137b3132e 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.63 2008/05/02 21:44:46 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.64 2008/11/27 20:46:48 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -1454,7 +1454,7 @@ child_return(arg) /* skip br instruction as in syscall() */ #ifdef M88100 if (CPU_IS88100) { - tf->tf_snip = tf->tf_sfip & XIP_ADDR; + tf->tf_snip = (tf->tf_sfip & XIP_ADDR) | XIP_V; tf->tf_sfip = tf->tf_snip + 4; } #endif |