5 * This struct defines the way the registers are stored on the
6 * kernel stack during a system call or other kernel entry.
8 * this should only contain volatile regs
9 * since we can keep non-volatile in the thread_struct
10 * should set this up when only volatiles are saved
13 * Since this is going on the stack, *CARE MUST BE TAKEN* to insure
14 * that the overall structure is a multiple of 16 bytes in length.
16 * Note that the offsets of the fields in this struct correspond with
17 * the PT_* values below. This simplifies arch/ppc/kernel/ptrace.c.
22 unsigned long gpr[32];
25 unsigned long orig_gpr3; /* Used for restarting system calls */
30 unsigned long mq; /* 601 only (not used at present) */
31 /* Used on APUS to hold IPL value. */
32 unsigned long trap; /* Reason for being here */
33 /* N.B. for critical exceptions on 4xx, the dar and dsisr
34 fields are overloaded to hold srr0 and srr1. */
35 unsigned long dar; /* Fault registers */
36 unsigned long dsisr; /* on 4xx/Book-E used for ESR */
37 unsigned long result; /* Result of a system call */
40 #endif /* __ASSEMBLY__ */
43 #define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */
45 /* Size of stack frame allocated when calling signal handler. */
46 #define __SIGNAL_FRAMESIZE 64
49 #define instruction_pointer(regs) ((regs)->nip)
51 extern unsigned long profile_pc(struct pt_regs *regs);
53 #define profile_pc(regs) instruction_pointer(regs)
56 #define user_mode(regs) (((regs)->msr & MSR_PR) != 0)
58 #define force_successful_syscall_return() \
60 current_thread_info()->local_flags |= _TIFL_FORCE_NOERROR; \
64 * We use the least-significant bit of the trap field to indicate
65 * whether we have saved the full set of registers, or only a
66 * partial set. A 1 there means the partial set.
67 * On 4xx we use the next bit to indicate whether the exception
68 * is a critical exception (1 means it is).
70 #define FULL_REGS(regs) (((regs)->trap & 1) == 0)
71 #define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) == 0)
72 #define TRAP(regs) ((regs)->trap & ~0xF)
74 #define CHECK_FULL_REGS(regs) \
76 if ((regs)->trap & 1) \
77 printk(KERN_CRIT "%s: partial register set\n", __FUNCTION__); \
79 #endif /* __ASSEMBLY__ */
81 #endif /* __KERNEL__ */
84 * Offsets used by 'ptrace' system call interface.
85 * These can't be changed without breaking binary compatibility
124 #define PT_ORIG_R3 34
132 #define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
133 #define PT_FPR31 (PT_FPR0 + 2*31)
134 #define PT_FPSCR (PT_FPR0 + 2*32 + 1)
136 /* Get/set all the altivec registers vr0..vr31, vscr, vrsave, in one go */
137 #define PTRACE_GETVRREGS 18
138 #define PTRACE_SETVRREGS 19
140 /* Get/set all the upper 32-bits of the SPE registers, accumulator, and
141 * spefscr, in one go */
142 #define PTRACE_GETEVRREGS 20
143 #define PTRACE_SETEVRREGS 21