PERFORCE change 106368 for review
Suleiman Souhlal
ssouhlal at FreeBSD.org
Tue Sep 19 16:29:58 PDT 2006
http://perforce.freebsd.org/chv.cgi?CH=106368
Change 106368 by ssouhlal at ssouhlal-maho on 2006/09/19 23:29:38
- Implement exec_setregs().
- Make fork_trampoline() return to userland.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/mips/machdep.c#21 edit
.. //depot/projects/mips2/src/sys/mips/mips/swtch.S#4 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/mips/machdep.c#21 (text+ko) ====
@@ -279,7 +279,11 @@
void
exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
{
+ struct trapframe *tf = td->td_frame;
+ tf->tf_regs[TF_EPC] = (register_t)entry;
+ tf->tf_regs[TF_SP] = (register_t)stack;
+ /* XXX tf->tf_regs[TF_SR] |= MIPS_SR_KSU_USER; ? */
}
intptr_t
==== //depot/projects/mips2/src/sys/mips/mips/swtch.S#4 (text+ko) ====
@@ -72,7 +72,6 @@
li v0, 1
jr ra
nop
-
END(cpu_throw)
/*
@@ -109,7 +108,21 @@
move a0, s0
move a1, s1
move a2, s2
- j fork_exit
+ jal fork_exit
+ nop
+
+ /* XXX AST */
+
+ .set at
+ lw t2, pcpup
+ .set noat
+ lw t3, PC_CURTHREAD(t2)
+ lw t0, TD_FRAME(t3)
+
+ move k1, t0
+ jal exception_restore_registers
nop
+ addu sp, sp, TF_SIZE
+ eret
END(fork_trampoline)
More information about the p4-projects
mailing list