1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _CRIS_ARCH_PTRACE_H
3 #define _CRIS_ARCH_PTRACE_H
7 #define CRIS_FRAME_NORMAL 0 /* normal frame without SBFS stacking */
8 #define CRIS_FRAME_BUSFAULT 1 /* frame stacked using SBFS, need RBF return
11 /* Register numbers in the ptrace system call interface */
13 #define PT_FRAMETYPE 0
32 #define PT_IRP 19 /* This is actually the debugged process' PC */
33 #define PT_CSRINSTR 20 /* CPU Status record remnants -
34 valid if frametype == busfault */
37 #define PT_USP 23 /* special case - USP is not in the pt_regs */
40 /* Condition code bit numbers. The same numbers apply to CCR of course,
41 but we use DCCR everywhere else, so let's try and be consistent. */
42 #define C_DCCR_BITNR 0
43 #define V_DCCR_BITNR 1
44 #define Z_DCCR_BITNR 2
45 #define N_DCCR_BITNR 3
46 #define X_DCCR_BITNR 4
47 #define I_DCCR_BITNR 5
48 #define B_DCCR_BITNR 6
49 #define M_DCCR_BITNR 7
50 #define U_DCCR_BITNR 8
51 #define P_DCCR_BITNR 9
52 #define F_DCCR_BITNR 10
54 /* pt_regs not only specifices the format in the user-struct during
55 * ptrace but is also the frame format used in the kernel prologue/epilogues
60 unsigned long frametype; /* type of stackframe */
61 unsigned long orig_r10;
62 /* pushed by movem r13, [sp] in SAVE_ALL, movem pushes backwards */
80 unsigned long irp; /* This is actually the debugged process' PC */
81 unsigned long csrinstr;
82 unsigned long csraddr;
83 unsigned long csrdata;
86 /* switch_stack is the extra stuff pushed onto the stack in _resume (entry.S)
87 * when doing a context-switch. it is used (apart from in resume) when a new
88 * thread is made and we need to make _resume (which is starting it for the
89 * first time) realise what is going on.
91 * Actually, the use is very close to the thread struct (TSS) in that both the
92 * switch_stack and the TSS are used to keep thread stuff when switching in
107 unsigned long return_ip; /* ip that _resume will return to */
112 /* bit 8 is user-mode flag */
113 #define user_mode(regs) (((regs)->dccr & 0x100) != 0)
114 #define instruction_pointer(regs) ((regs)->irp)
115 #define profile_pc(regs) instruction_pointer(regs)
117 #endif /* __KERNEL__ */