1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Common low level (register) ptrace helpers
5 * Copyright 2004-2011 Analog Devices Inc.
8 #ifndef __ASM_GENERIC_PTRACE_H__
9 #define __ASM_GENERIC_PTRACE_H__
13 /* Helpers for working with the instruction pointer */
15 #define GET_IP(regs) ((regs)->pc)
18 #define SET_IP(regs, val) (GET_IP(regs) = (val))
21 static inline unsigned long instruction_pointer(struct pt_regs *regs)
25 static inline void instruction_pointer_set(struct pt_regs *regs,
32 #define profile_pc(regs) instruction_pointer(regs)
35 /* Helpers for working with the user stack pointer */
37 #define GET_USP(regs) ((regs)->usp)
40 #define SET_USP(regs, val) (GET_USP(regs) = (val))
43 static inline unsigned long user_stack_pointer(struct pt_regs *regs)
47 static inline void user_stack_pointer_set(struct pt_regs *regs,
53 /* Helpers for working with the frame pointer */
55 #define GET_FP(regs) ((regs)->fp)
58 #define SET_FP(regs, val) (GET_FP(regs) = (val))
61 static inline unsigned long frame_pointer(struct pt_regs *regs)
65 static inline void frame_pointer_set(struct pt_regs *regs,
71 #endif /* __ASSEMBLY__ */