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)
50 #define user_mode(regs) (((regs)->msr & MSR_PR) != 0)
52 #define force_successful_syscall_return() \
54 current_thread_info()->local_flags |= _TIFL_FORCE_NOERROR; \
58 * We use the least-significant bit of the trap field to indicate
59 * whether we have saved the full set of registers, or only a
60 * partial set. A 1 there means the partial set.
61 * On 4xx we use the next bit to indicate whether the exception
62 * is a critical exception (1 means it is).
64 #define FULL_REGS(regs) (((regs)->trap & 1) == 0)
65 #define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) == 0)
66 #define TRAP(regs) ((regs)->trap & ~0xF)
68 #define CHECK_FULL_REGS(regs) \
70 if ((regs)->trap & 1) \
71 printk(KERN_CRIT "%s: partial register set\n", __FUNCTION__); \
73 #endif /* __ASSEMBLY__ */
75 #endif /* __KERNEL__ */
78 * Offsets used by 'ptrace' system call interface.
79 * These can't be changed without breaking binary compatibility
118 #define PT_ORIG_R3 34
126 #define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
127 #define PT_FPR31 (PT_FPR0 + 2*31)
128 #define PT_FPSCR (PT_FPR0 + 2*32 + 1)
130 /* Get/set all the altivec registers vr0..vr31, vscr, vrsave, in one go */
131 #define PTRACE_GETVRREGS 18
132 #define PTRACE_SETVRREGS 19