clean
[linux-2.4.21-pre4.git] / include / asm-ppc / ptrace.h
1 /*
2  * BK Id: SCCS/s.ptrace.h 1.14 09/02/02 12:29:58 paulus
3  */
4 #ifndef _PPC_PTRACE_H
5 #define _PPC_PTRACE_H
6
7 /*
8  * This struct defines the way the registers are stored on the
9  * kernel stack during a system call or other kernel entry.
10  *
11  * this should only contain volatile regs
12  * since we can keep non-volatile in the thread_struct
13  * should set this up when only volatiles are saved
14  * by intr code.
15  *
16  * Since this is going on the stack, *CARE MUST BE TAKEN* to insure
17  * that the overall structure is a multiple of 16 bytes in length.
18  *
19  * Note that the offsets of the fields in this struct correspond with
20  * the PT_* values below.  This simplifies arch/ppc/kernel/ptrace.c.
21  */
22
23 #ifndef __ASSEMBLY__
24 struct pt_regs {
25         unsigned long gpr[32];
26         unsigned long nip;
27         unsigned long msr;
28         unsigned long orig_gpr3;        /* Used for restarting system calls */
29         unsigned long ctr;
30         unsigned long link;
31         unsigned long xer;
32         unsigned long ccr;
33         unsigned long mq;               /* 601 only (not used at present) */
34                                         /* Used on APUS to hold IPL value. */
35         unsigned long trap;             /* Reason for being here */
36         unsigned long dar;              /* Fault registers */
37         unsigned long dsisr;
38         unsigned long result;           /* Result of a system call */
39 };
40 #endif
41
42 /* iSeries uses mq field for soft enable flag */
43 #define softEnable mq
44
45 #ifdef __KERNEL__
46 #define STACK_FRAME_OVERHEAD    16      /* size of minimum stack frame */
47
48 /* Size of stack frame allocated when calling signal handler. */
49 #define __SIGNAL_FRAMESIZE      64
50
51 #define instruction_pointer(regs) ((regs)->nip)
52 #define user_mode(regs) (((regs)->msr & MSR_PR) != 0)
53
54 #endif /* __KERNEL__ */
55
56 /*
57  * Offsets used by 'ptrace' system call interface.
58  * These can't be changed without breaking binary compatibility
59  * with MkLinux, etc.
60  */
61 #define PT_R0   0
62 #define PT_R1   1
63 #define PT_R2   2
64 #define PT_R3   3
65 #define PT_R4   4
66 #define PT_R5   5
67 #define PT_R6   6
68 #define PT_R7   7
69 #define PT_R8   8
70 #define PT_R9   9
71 #define PT_R10  10
72 #define PT_R11  11
73 #define PT_R12  12
74 #define PT_R13  13
75 #define PT_R14  14
76 #define PT_R15  15
77 #define PT_R16  16
78 #define PT_R17  17
79 #define PT_R18  18
80 #define PT_R19  19
81 #define PT_R20  20
82 #define PT_R21  21
83 #define PT_R22  22
84 #define PT_R23  23
85 #define PT_R24  24
86 #define PT_R25  25
87 #define PT_R26  26
88 #define PT_R27  27
89 #define PT_R28  28
90 #define PT_R29  29
91 #define PT_R30  30
92 #define PT_R31  31
93
94 #define PT_NIP  32
95 #define PT_MSR  33
96 #ifdef __KERNEL__
97 #define PT_ORIG_R3 34
98 #endif
99 #define PT_CTR  35
100 #define PT_LNK  36
101 #define PT_XER  37
102 #define PT_CCR  38
103 #define PT_MQ   39
104
105 #define PT_FPR0 48      /* each FP reg occupies 2 slots in this space */
106 #define PT_FPR31 (PT_FPR0 + 2*31)
107 #define PT_FPSCR (PT_FPR0 + 2*32 + 1)
108
109 /* Get/set all the altivec registers vr0..vr31, vscr, vrsave, in one go */
110 #define PTRACE_GETVRREGS        18
111 #define PTRACE_SETVRREGS        19
112
113 #endif