diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-04-15 17:36:48 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-04-15 17:36:48 +0000 |
commit | 816adc0ec5a891b0dbdb8a14e55041b2b76fcfda (patch) | |
tree | 5a1aca20602476e7c367e62309b7e0f67e90fb12 | |
parent | 546424a6a97dd2b106d4138d08fda2de02ea5f7e (diff) |
Sync proc_trampoline() and setregs() logic with sparc.
-rw-r--r-- | sys/arch/solbourne/solbourne/locore.s | 10 | ||||
-rw-r--r-- | sys/arch/solbourne/solbourne/machdep.c | 7 |
2 files changed, 11 insertions, 6 deletions
diff --git a/sys/arch/solbourne/solbourne/locore.s b/sys/arch/solbourne/solbourne/locore.s index d3452ac4caa..8ff5842d209 100644 --- a/sys/arch/solbourne/solbourne/locore.s +++ b/sys/arch/solbourne/solbourne/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.7 2006/03/23 02:29:35 ray Exp $ */ +/* $OpenBSD: locore.s,v 1.8 2006/04/15 17:36:47 miod Exp $ */ /* OpenBSD: locore.s,v 1.64 2005/04/17 18:47:50 miod Exp */ /* @@ -1804,8 +1804,8 @@ sparc_interruptkap: nmi: INTR_SETUP(-CCFSZ-80) INCR(_C_LABEL(uvmexp)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) - /* XXX MIOD We should check for NMI set in the iGLU BSR, and clear - * it if set. + /* XXX + * We should check for NMI set in the iGLU BSR, and clear it if set. */ /* @@ -3719,9 +3719,9 @@ ENTRY(proc_trampoline) */ mov PSR_S, %l0 ! user psr (no need to load it) !?wr %g0, 2, %wim ! %wim = 2 - ld [%sp + CCFSZ + 8], %l1 ! pc = tf->tf_npc from execve/fork + ld [%sp + CCFSZ + 4], %l1 ! pc b return_from_syscall - add %l1, 4, %l2 ! npc = pc+4 + ld [%sp + CCFSZ + 8], %l2 ! npc /* probeget is meant to be used during autoconfiguration */ diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c index bccd8518f98..4d07197f46d 100644 --- a/sys/arch/solbourne/solbourne/machdep.c +++ b/sys/arch/solbourne/solbourne/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.1 2005/04/19 21:30:18 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.2 2006/04/15 17:36:47 miod Exp $ */ /* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */ /* @@ -402,6 +402,11 @@ setregs(p, pack, stack, retval) tf->tf_npc = pack->ep_entry & ~3; tf->tf_global[1] = (int)PS_STRINGS; tf->tf_global[2] = tf->tf_global[7] = tf->tf_npc; + /* XXX exec of init(8) returns via proc_trampoline() */ + if (p->p_pid == 1) { + tf->tf_pc = tf->tf_npc; + tf->tf_npc += 4; + } stack -= sizeof(struct rwindow); tf->tf_out[6] = stack; retval[1] = 0; |