11 #include <linux/sched.h>
12 #include <asm/processor.h>
13 #include <asm/uaccess.h>
14 #include <asm/compat.h>
16 #define STACK_SP(STACK) *(STACK)
18 #define STACK_LR64(STACK) *((unsigned long *)(STACK) + 2)
19 #define STACK_LR32(STACK) *((unsigned int *)(STACK) + 1)
22 #define STACK_LR(STACK) STACK_LR64(STACK)
24 #define STACK_LR(STACK) STACK_LR32(STACK)
27 static unsigned int user_getsp32(
unsigned int sp,
int is_first)
30 void __user *
p = compat_ptr(sp);
54 static unsigned long user_getsp64(
unsigned long sp,
int is_first)
72 static unsigned long kernel_getsp(
unsigned long sp,
int is_first)
74 unsigned long *stack_frame = (
unsigned long *)sp;
93 unsigned long sp = regs->
gpr[1];
101 sp = kernel_getsp(sp, first_frame);
110 sp = user_getsp64(sp, first_frame);
121 sp = user_getsp32(sp, first_frame);