# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID be9fe905334a4b9bcc6238d0490630449077e2c5
# Parent 4f8c0d9515591fe945ec288d4322792d58d24f86
[ppc] Add an IRQ Keyhandler to trap to the HW probe.
When using a HW probe, such as RiscWatch, randomly attaching to the
running system can land you in any number of address spaces, such as
user, kernel, Hypervisor. The debugger can then do nasty things to
what ever mode happens to be running.
This patch registers the '^' character for the purpose of contacting
the HW probe while in the Hypervisor. Once the machine has stopped
and you attach with your debugger you will be in hw_probe_attn() and
you can either add 4 to your PC or in GDB use the "return" command to
immediately exit this function.
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
xen/arch/ppc/setup.c | 14 ++++++++++++++
1 files changed, 14 insertions(+)
diff -r 4f8c0d951559 -r be9fe905334a xen/arch/ppc/setup.c
--- a/xen/arch/ppc/setup.c Wed Jul 05 09:13:42 2006 -0400
+++ b/xen/arch/ppc/setup.c Thu Jul 06 06:39:09 2006 -0400
@@ -32,6 +32,7 @@
#include <xen/domain.h>
#include <xen/gdbstub.h>
#include <xen/symbols.h>
+#include <xen/keyhandler.h>
#include <public/version.h>
#include <asm/processor.h>
#include <asm/desc.h>
@@ -107,6 +108,14 @@ static void __init do_initcalls(void)
}
}
+static void hw_probe_attn(unsigned char key, struct cpu_user_regs *regs)
+{
+ /* To continue the probe will step over the ATTN instruction. The
+ * NOP is there to make sure there is something sane to "step
+ * over" to. */
+ asm volatile(".long 0x00000200; nop");
+}
+
static void __init start_of_day(void)
{
struct domain *idle_domain;
@@ -125,6 +134,11 @@ static void __init start_of_day(void)
cpu_set(0, cpu_sibling_map[0]);
initialize_keytable();
+ /* Register another key that will allow for the the Harware Probe
+ * to be contacted, this works with RiscWatch probes and should
+ * work with Chronos and FSPs */
+ register_irq_keyhandler('^', hw_probe_attn, "Trap to Hardware Probe");
+
timer_init();
serial_init_postirq();
do_initcalls();
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|