From d46ce4d62a2ee27d0d6b531cadb3134538ba48c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 27 Jun 2010 20:16:59 +0000 Subject: [PATCH] kernel_ppc: Save caller's stack pointer in arch_debug_save_registers Suggested by Ingo in ticket #6139. Code is adapted from x86. Note that on ppc64 GPR1 needs to be 64-bit, thus the choice of addr_t. Resolves part of ticket #6160. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37281 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/ppc/arch_debug.h | 1 + src/system/kernel/arch/ppc/arch_debug.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/headers/private/kernel/arch/ppc/arch_debug.h b/headers/private/kernel/arch/ppc/arch_debug.h index 745874dce1..f4ff5ee856 100644 --- a/headers/private/kernel/arch/ppc/arch_debug.h +++ b/headers/private/kernel/arch/ppc/arch_debug.h @@ -10,6 +10,7 @@ struct arch_debug_registers { + addr_t r1; }; diff --git a/src/system/kernel/arch/ppc/arch_debug.cpp b/src/system/kernel/arch/ppc/arch_debug.cpp index dc7179ab46..0080111f97 100644 --- a/src/system/kernel/arch/ppc/arch_debug.cpp +++ b/src/system/kernel/arch/ppc/arch_debug.cpp @@ -258,6 +258,9 @@ return 0; void arch_debug_save_registers(struct arch_debug_registers* registers) { + // get the caller's frame pointer + stack_frame* frame = (stack_frame*)get_current_stack_frame(); + registers->r1 = (addr_t)frame->previous; }