diff options
author | David S. Miller <davem@davemloft.net> | 2008-04-24 01:52:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-24 02:32:20 -0400 |
commit | 8243e40acb087fcd9e7609333f0b0551391f49fc (patch) | |
tree | 1995a0617f0b5e861fa9716f0fe67ade561376d6 /include/asm-sparc64 | |
parent | db9a7fb12c8d05104e8a541003593d62a42ade8f (diff) |
[SPARC64]: Store magic cookie and trap type in pt_regs.
This sets us up for several simplifications and facilities:
1) The magic cookie lets us identify trap frames more
accurately in stack backtraces.
2) The trap type lets us simplify all of the "are we in
a syscall" state management and checks.
3) We can now see if a task off the cpu is sleeping in
a system call or not. In fact, we can see what
trap it is sleeping in whatever the type. The utrace
guys will use this.
Based upon some discussions with Roland McGrath.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/ptrace.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h index 6da197803efc..b4b951d570bb 100644 --- a/include/asm-sparc64/ptrace.h +++ b/include/asm-sparc64/ptrace.h | |||
@@ -8,6 +8,8 @@ | |||
8 | * stack during a system call and basically all traps. | 8 | * stack during a system call and basically all traps. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define PT_REGS_MAGIC 0x57ac6c00 | ||
12 | |||
11 | #ifndef __ASSEMBLY__ | 13 | #ifndef __ASSEMBLY__ |
12 | 14 | ||
13 | struct pt_regs { | 15 | struct pt_regs { |
@@ -16,7 +18,19 @@ struct pt_regs { | |||
16 | unsigned long tpc; | 18 | unsigned long tpc; |
17 | unsigned long tnpc; | 19 | unsigned long tnpc; |
18 | unsigned int y; | 20 | unsigned int y; |
19 | unsigned int fprs; | 21 | |
22 | /* We encode a magic number, PT_REGS_MAGIC, along | ||
23 | * with the %tt (trap type) register value at trap | ||
24 | * entry time. The magic number allows us to identify | ||
25 | * accurately a trap stack frame in the stack | ||
26 | * unwinder, and the %tt value allows us to test | ||
27 | * things like "in a system call" etc. for an arbitray | ||
28 | * process. | ||
29 | * | ||
30 | * The PT_REGS_MAGIC is choosen such that it can be | ||
31 | * loaded completely using just a sethi instruction. | ||
32 | */ | ||
33 | unsigned int magic; | ||
20 | }; | 34 | }; |
21 | 35 | ||
22 | struct pt_regs32 { | 36 | struct pt_regs32 { |
@@ -147,7 +161,7 @@ extern void __show_regs(struct pt_regs *); | |||
147 | #define PT_V9_TPC 0x88 | 161 | #define PT_V9_TPC 0x88 |
148 | #define PT_V9_TNPC 0x90 | 162 | #define PT_V9_TNPC 0x90 |
149 | #define PT_V9_Y 0x98 | 163 | #define PT_V9_Y 0x98 |
150 | #define PT_V9_FPRS 0x9c | 164 | #define PT_V9_MAGIC 0x9c |
151 | #define PT_TSTATE PT_V9_TSTATE | 165 | #define PT_TSTATE PT_V9_TSTATE |
152 | #define PT_TPC PT_V9_TPC | 166 | #define PT_TPC PT_V9_TPC |
153 | #define PT_TNPC PT_V9_TNPC | 167 | #define PT_TNPC PT_V9_TNPC |