aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/swtch.S5
-rw-r--r--sys/powerpc/aim/vm_machdep.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/sys/powerpc/aim/swtch.S b/sys/powerpc/aim/swtch.S
index 6e3bfdd636d30..12bb488a326d6 100644
--- a/sys/powerpc/aim/swtch.S
+++ b/sys/powerpc/aim/swtch.S
@@ -147,5 +147,8 @@ ENTRY(fork_trampoline)
lwz %r4,CF_ARG0(%r1)
lwz %r5,CF_ARG1(%r1)
bl fork_exit
- addi %r1,%r1,4
+ addi %r1,%r1,CF_SIZE-FSP /* Allow 8 bytes in front of
+ trapframe to simulate FRAME_SETUP
+ does when allocating space for
+ a frame pointer/saved LR */
b trapexit
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c
index 4e8c80354416f..3b1921364fb79 100644
--- a/sys/powerpc/aim/vm_machdep.c
+++ b/sys/powerpc/aim/vm_machdep.c
@@ -146,6 +146,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
td2->td_frame = tf;
cf = (struct callframe *)tf - 1;
+ memset(cf, 0, sizeof(struct callframe));
cf->cf_func = (register_t)fork_return;
cf->cf_arg0 = (register_t)td2;
cf->cf_arg1 = (register_t)tf;
@@ -321,6 +322,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
/* Set registers for trampoline to user mode. */
cf = (struct callframe *)tf - 1;
+ memset(cf, 0, sizeof(struct callframe));
cf->cf_func = (register_t)fork_return;
cf->cf_arg0 = (register_t)td;
cf->cf_arg1 = (register_t)tf;