ia64/xen-unstable

view xen/include/asm-ia64/debugger.h @ 12668:49ab12a04d16

[IA64] Make do_ssc() not fall into an infinite loop

Instead, call panic_domain().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Thu Nov 30 15:58:21 2006 -0700 (2006-11-30)
parents 0c332cf81e64
children 4d159746d0e6
line source
1 /******************************************************************************
2 * asm/debugger.h
3 *
4 * Generic hooks into arch-dependent Xen.
5 *
6 * Each debugger should define two functions here:
7 *
8 * 1. debugger_trap_entry():
9 * Called at start of any synchronous fault or trap, before any other work
10 * is done. The idea is that if your debugger deliberately caused the trap
11 * (e.g. to implement breakpoints or data watchpoints) then you can take
12 * appropriate action and return a non-zero value to cause early exit from
13 * the trap function.
14 *
15 * 2. debugger_trap_fatal():
16 * Called when Xen is about to give up and crash. Typically you will use this
17 * hook to drop into a debug session. It can also be used to hook off
18 * deliberately caused traps (which you then handle and return non-zero)
19 * but really these should be hooked off 'debugger_trap_entry'.
20 */
22 #ifndef __ASM_DEBUGGER_H__
23 #define __ASM_DEBUGGER_H__
25 // this number is an arbitary number which is not used for any other purpose
26 // __builtin_trap() 0x0
27 // ski 0x80001, 0x80002
28 // kdb 0x80100, 0x80101
29 // kprobe 0x80200, jprobe 0x80300
30 // kgdb 0x6665
31 // gdb 0x99998 (#define IA64_BREAKPOINT 0x00003333300LL)
32 // ltrace 0x80001 (NOTE: this conflicts ski)
34 // cdb should handle 0 and CDB_BREAK_NUM.
35 #define CDB_BREAK_NUM 0x80800
38 #ifndef __ASSEMBLY__
40 #include <xen/sched.h>
41 #include <xen/softirq.h>
42 #include <xen/gdbstub.h>
44 void show_registers(struct cpu_user_regs *regs);
45 void dump_stack(void);
47 static inline void
48 show_execution_state(struct cpu_user_regs *regs)
49 {
50 show_registers(regs);
51 dump_stack();
52 }
54 // NOTE: on xen struct pt_regs = struct cpu_user_regs
55 // see include/asm-ia64/linux-xen/asm/ptrace.h
56 #ifdef CRASH_DEBUG
57 // crash_debug=y
59 /* The main trap handlers use these helper macros which include early bail. */
60 static inline int debugger_trap_entry(
61 unsigned int vector, struct cpu_user_regs *regs)
62 {
63 return 0;
64 }
66 extern int __trap_to_cdb(struct cpu_user_regs *r);
67 static inline int debugger_trap_fatal(
68 unsigned int vector, struct cpu_user_regs *regs)
69 {
70 (void)__trap_to_gdb(regs, vector);
71 return 0;
72 }
74 #define ____debugger_trap_immediate(b) __asm__ __volatile__ ("break.m "#b"\n")
75 #define __debugger_trap_immediate(b) ____debugger_trap_immediate(b)
76 #define debugger_trap_immediate() __debugger_trap_immediate(CDB_BREAK_NUM)
78 //XXX temporal work around
79 #ifndef CONFIG_SMP
80 #define smp_send_stop() /* nothing */
81 #endif
83 #elif defined DOMU_DEBUG
84 // domu_debug=y
85 #warning "domu_debug is not implemented yet."
86 /* The main trap handlers use these helper macros which include early bail. */
87 static inline int debugger_trap_entry(
88 unsigned int vector, struct cpu_user_regs *regs)
89 {
90 return 0;
91 }
93 static inline int debugger_trap_fatal(
94 unsigned int vector, struct cpu_user_regs *regs)
95 {
96 return 0;
97 }
99 #define debugger_trap_immediate() ((void)0)
100 #else
101 /* The main trap handlers use these helper macros which include early bail. */
102 static inline int debugger_trap_entry(
103 unsigned int vector, struct cpu_user_regs *regs)
104 {
105 return 0;
106 }
108 static inline int debugger_trap_fatal(
109 unsigned int vector, struct cpu_user_regs *regs)
110 {
111 return 0;
112 }
114 #define debugger_trap_immediate() ((void)0)
115 #endif
116 #endif // __ASSEMBLLY__
118 #endif /* __ASM_DEBUGGER_H__ */