aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/debugger.h
diff options
context:
space:
mode:
authorach61@arcadians.cl.cam.ac.uk <ach61@arcadians.cl.cam.ac.uk>2005-06-03 21:17:48 +0000
committerach61@arcadians.cl.cam.ac.uk <ach61@arcadians.cl.cam.ac.uk>2005-06-03 21:17:48 +0000
commit3e93d04b1cee1da560a4e11ccc75003db70a8753 (patch)
tree2b7bcc655c5abb09e4d501828ac98c4b20cbe3f2 /xen/include/asm-x86/debugger.h
parente3b4b1baf9dc7e66a93155129737dc9d235badc0 (diff)
downloadxen-3e93d04b1cee1da560a4e11ccc75003db70a8753.tar.gz
xen-3e93d04b1cee1da560a4e11ccc75003db70a8753.tar.bz2
xen-3e93d04b1cee1da560a4e11ccc75003db70a8753.zip
bitkeeper revision 1.1665.2.1 (42a0c8fc5ayKCKfMu8Oo5dUccP4STA)
PDB 0.3
Diffstat (limited to 'xen/include/asm-x86/debugger.h')
-rw-r--r--xen/include/asm-x86/debugger.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h
index 34ff5bdddc..bb5fea1720 100644
--- a/xen/include/asm-x86/debugger.h
+++ b/xen/include/asm-x86/debugger.h
@@ -80,6 +80,50 @@ static inline int debugger_trap_entry(
#define debugger_trap_fatal(_v, _r) (0)
#define debugger_trap_immediate()
+#elif defined(PDB_DEBUG)
+
+#include <xen/event.h>
+#include <xen/softirq.h>
+#include <xen/sched.h>
+#include <asm/regs.h>
+
+static inline int debugger_trap_entry(unsigned int vector,
+ struct cpu_user_regs *regs)
+{
+ struct vcpu *vcpu = current;
+
+ if ( !KERNEL_MODE(vcpu, regs) || (vcpu->domain->domain_id == 0) )
+ return 0;
+
+ switch ( vector )
+ {
+ case TRAP_debug:
+ case TRAP_int3:
+ {
+ struct vcpu *ptr;
+
+ /* suspend the guest domain */
+ for_each_vcpu ( vcpu->domain, ptr )
+ {
+ test_and_set_bit(_VCPUF_ctrl_pause, &ptr->vcpu_flags);
+ }
+ sync_lazy_execstate_mask(vcpu->domain->cpumask); /* TLB flush */
+ raise_softirq(SCHEDULE_SOFTIRQ);
+
+ /* notify the debugger */
+ send_guest_virq(dom0->vcpu[0], VIRQ_PDB);
+
+ return 1;
+ }
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+#define debugger_trap_fatal(_v, _r) (0)
+#define debugger_trap_immediate()
#elif 0