aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/ptrace.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-20 02:46:00 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-20 03:33:45 -0400
commit93dae5b70e7c1c8e927d22e1c20a941ca376906a (patch)
treef255087706b9d176455b17e4384f4632f59f4cde /include/asm-sparc64/ptrace.h
parent88278ca27a43ae503572b52ea2c171fbf45db5a2 (diff)
sparc64: Add global register dumping facility.
When a cpu really is stuck in the kernel, it can be often impossible to figure out which cpu is stuck where. The worst case is when the stuck cpu has interrupts disabled. Therefore, implement a global cpu state capture that uses SMP message interrupts which are not disabled by the normal IRQ enable/disable APIs of the kernel. As long as we can get a sysrq 'y' to the kernel, we can get a dump. Even if the console interrupt cpu is wedged, we can trigger it from userspace using /proc/sysrq-trigger The output is made compact so that this facility is more useful on high cpu count systems, which is where this facility will likely find itself the most useful :) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64/ptrace.h')
-rw-r--r--include/asm-sparc64/ptrace.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
index 90972a5ada59..d8a56cddf7f2 100644
--- a/include/asm-sparc64/ptrace.h
+++ b/include/asm-sparc64/ptrace.h
@@ -126,6 +126,17 @@ struct sparc_trapf {
126#define TRACEREG32_SZ sizeof(struct pt_regs32) 126#define TRACEREG32_SZ sizeof(struct pt_regs32)
127#define STACKFRAME32_SZ sizeof(struct sparc_stackf32) 127#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
128 128
129struct global_reg_snapshot {
130 unsigned long tstate;
131 unsigned long tpc;
132 unsigned long tnpc;
133 unsigned long o7;
134 unsigned long i7;
135 struct thread_info *thread;
136 unsigned long pad1;
137 unsigned long pad2;
138};
139
129#ifdef __KERNEL__ 140#ifdef __KERNEL__
130 141
131#define __ARCH_WANT_COMPAT_SYS_PTRACE 142#define __ARCH_WANT_COMPAT_SYS_PTRACE
@@ -295,6 +306,16 @@ extern void __show_regs(struct pt_regs *);
295#define SF_XARG5 0x58 306#define SF_XARG5 0x58
296#define SF_XXARG 0x5c 307#define SF_XXARG 0x5c
297 308
309/* global_reg_snapshot offsets */
310#define GR_SNAP_TSTATE 0x00
311#define GR_SNAP_TPC 0x08
312#define GR_SNAP_TNPC 0x10
313#define GR_SNAP_O7 0x18
314#define GR_SNAP_I7 0x20
315#define GR_SNAP_THREAD 0x28
316#define GR_SNAP_PAD1 0x30
317#define GR_SNAP_PAD2 0x38
318
298/* Stuff for the ptrace system call */ 319/* Stuff for the ptrace system call */
299#define PTRACE_SPARC_DETACH 11 320#define PTRACE_SPARC_DETACH 11
300#define PTRACE_GETREGS 12 321#define PTRACE_GETREGS 12