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; }