2 * Common low level (register) ptrace helpers
4 * Copyright 2004-2011 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
9 #ifndef __ASM_GENERIC_PTRACE_H__
10 #define __ASM_GENERIC_PTRACE_H__
14 /* Helpers for working with the instruction pointer */
16 #define GET_IP(regs) ((regs)->pc)
19 #define SET_IP(regs, val) (GET_IP(regs) = (val))
22 static inline unsigned long instruction_pointer(struct pt_regs
*regs
)
26 static inline void instruction_pointer_set(struct pt_regs
*regs
,
33 #define profile_pc(regs) instruction_pointer(regs)
36 /* Helpers for working with the user stack pointer */
38 #define GET_USP(regs) ((regs)->usp)
41 #define SET_USP(regs, val) (GET_USP(regs) = (val))
44 static inline unsigned long user_stack_pointer(struct pt_regs
*regs
)
48 static inline void user_stack_pointer_set(struct pt_regs
*regs
,
54 /* Helpers for working with the frame pointer */
56 #define GET_FP(regs) ((regs)->fp)
59 #define SET_FP(regs, val) (GET_FP(regs) = (val))
62 static inline unsigned long frame_pointer(struct pt_regs
*regs
)
66 static inline void frame_pointer_set(struct pt_regs
*regs
,
72 #endif /* __ASSEMBLY__ */