summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim/vm_machdep.c
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2004-07-22 01:28:51 +0000
committergrehan <grehan@FreeBSD.org>2004-07-22 01:28:51 +0000
commit1248963e47812a7f285dfb3ada018e469fa03db7 (patch)
treebccb0e20c741ec49a9846bd18235002beb0acfe4 /sys/powerpc/aim/vm_machdep.c
parente77cc66588643df786ee7ef6cb0d0ef8a54ccc7f (diff)
downloadFreeBSD-src-1248963e47812a7f285dfb3ada018e469fa03db7.zip
FreeBSD-src-1248963e47812a7f285dfb3ada018e469fa03db7.tar.gz
Update the callframe structure to leave space for the frame pointer
and saved link register as per the ABI call sequence. Update code that uses this (fork_trampoline etc) to use the correct genassym'd offsets. This fixes the 'invalid LR' message when backtracing kernel threads in DDB.
Diffstat (limited to 'sys/powerpc/aim/vm_machdep.c')
-rw-r--r--sys/powerpc/aim/vm_machdep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c
index 4e8c803..3b19213 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;
OpenPOWER on IntegriCloud