1 #ifndef_ASMAXP_PTRACE_H 2 #define_ASMAXP_PTRACE_H 3
4
5 /* 6 * This struct defines the way the registers are stored on the 7 * kernel stack during a system call or other kernel entry 8 * 9 * NOTE! I want to minimize the overhead of system calls, so this 10 * struct has as little information as possible. I does not have 11 * 12 * - floating point regs: the kernel doesn't change those 13 * - r9-15: saved by the C compiler 14 * 15 * This makes "fork()" and "exec()" a bit more complex, but should 16 * give us low system call latency. 17 */ 18
19 structpt_regs{ 20 unsignedlongr0;
21 unsignedlongr1;
22 unsignedlongr2;
23 unsignedlongr3;
24 unsignedlongr4;
25 unsignedlongr5;
26 unsignedlongr6;
27 unsignedlongr7;
28 unsignedlongr8;
29 unsignedlongr19;
30 unsignedlongr20;
31 unsignedlongr21;
32 unsignedlongr22;
33 unsignedlongr23;
34 unsignedlongr24;
35 unsignedlongr25;
36 unsignedlongr26;
37 unsignedlongr27;
38 unsignedlongr28;
39 unsignedlonghae;
40 /* These are saved by PAL-code: */ 41 unsignedlongps;
42 unsignedlongpc;
43 unsignedlonggp;
44 unsignedlongr16;
45 unsignedlongr17;
46 unsignedlongr18;
47 };
48
49 /* 50 * This is the extended stack used by signal handlers and the context 51 * switcher: it's pushed after the normal "struct pt_regs". 52 */ 53 structswitch_stack{ 54 unsignedlongr9;
55 unsignedlongr10;
56 unsignedlongr11;
57 unsignedlongr12;
58 unsignedlongr13;
59 unsignedlongr14;
60 unsignedlongr15;
61 unsignedlongr26;
62 unsignedlongfp[32];
63 };
64
65 #ifdef__KERNEL__ 66 #defineuser_mode(regs) ((regs)->ps & 8)
67 #defineinstruction_pointer(regs) ((regs)->pc)
68 externvoidshow_regs(structpt_regs *);
69 #endif 70
71 #endif