@@ -16,6 +16,7 @@
* GNU General Public License for more details.
*/
+#include <xen/debugger.h>
#include <xen/domain_page.h>
#include <xen/errno.h>
#include <xen/hypercall.h>
@@ -41,7 +42,6 @@
#include <asm/acpi.h>
#include <asm/cpuerrata.h>
#include <asm/cpufeature.h>
-#include <asm/debugger.h>
#include <asm/event.h>
#include <asm/hsr.h>
#include <asm/mmio.h>
@@ -14,12 +14,12 @@
* License along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
+#include <xen/debugger.h>
#include <xen/sched.h>
#include <xen/compile.h>
#include <xen/mm.h>
#include <xen/domain_page.h>
#include <xen/guest_access.h>
-#include <asm/debugger.h>
#include <asm/p2m.h>
typedef unsigned long dbgva_t;
@@ -15,6 +15,7 @@
#include <xen/lib.h>
#include <xen/errno.h>
#include <xen/sched.h>
+#include <xen/debugger.h>
#include <xen/domain.h>
#include <xen/smp.h>
#include <xen/delay.h>
@@ -2539,9 +2540,9 @@ static int __init init_vcpu_kick_softirq(void)
}
__initcall(init_vcpu_kick_softirq);
+#ifdef CONFIG_CRASH_DEBUG
void domain_pause_for_debugger(void)
{
-#ifdef CONFIG_CRASH_DEBUG
struct vcpu *curr = current;
struct domain *d = curr->domain;
@@ -2550,8 +2551,8 @@ void domain_pause_for_debugger(void)
/* if gdbsx active, we just need to pause the domain */
if ( curr->arch.gdbsx_vcpu_event == 0 )
send_global_virq(VIRQ_DEBUGGER);
-#endif
}
+#endif
/*
* Local variables:
@@ -12,6 +12,7 @@
#include <xen/pci.h>
#include <public/domctl.h>
#include <xen/sched.h>
+#include <xen/debugger.h>
#include <xen/domain.h>
#include <xen/event.h>
#include <xen/domain_page.h>
@@ -33,7 +34,6 @@
#include <public/vm_event.h>
#include <asm/mem_sharing.h>
#include <asm/xstate.h>
-#include <asm/debugger.h>
#include <asm/psr.h>
#include <asm/cpuid.h>
@@ -18,7 +18,9 @@
* You should have received a copy of the GNU General Public License
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
-#include <asm/debugger.h>
+#include <xen/debugger.h>
+#include <xen/gdbstub.h>
+#include <asm/uaccess.h>
u16
gdb_arch_signal_num(struct cpu_user_regs *regs, unsigned long cookie)
@@ -24,6 +24,7 @@
#include <xen/irq.h>
#include <xen/softirq.h>
#include <xen/hypercall.h>
+#include <xen/debugger.h>
#include <xen/domain_page.h>
#include <xen/xenoprof.h>
#include <asm/current.h>
@@ -58,7 +59,6 @@
#include <asm/hvm/trace.h>
#include <asm/hap.h>
#include <asm/apic.h>
-#include <asm/debugger.h>
#include <asm/hvm/monitor.h>
#include <asm/monitor.h>
#include <asm/xstate.h>
@@ -9,12 +9,12 @@
* Keir Fraser <keir@xen.org>
*/
+#include <xen/debugger.h>
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/sched.h>
#include <xen/paging.h>
#include <xen/softirq.h>
-#include <asm/debugger.h>
#include <asm/event.h>
#include <asm/hvm/emulate.h>
#include <asm/hvm/hvm.h>
@@ -23,6 +23,7 @@
#include <xen/sched.h>
#include <xen/irq.h>
#include <xen/softirq.h>
+#include <xen/debugger.h>
#include <xen/domain_page.h>
#include <xen/hypercall.h>
#include <xen/perfc.h>
@@ -51,7 +52,6 @@
#include <asm/hvm/trace.h>
#include <asm/hvm/monitor.h>
#include <asm/xenoprof.h>
-#include <asm/debugger.h>
#include <asm/apic.h>
#include <asm/hvm/nestedhvm.h>
#include <asm/altp2m.h>
@@ -18,6 +18,7 @@
#include <xen/mm.h>
#include <xen/param.h>
#include <xen/irq.h>
+#include <xen/debugger.h>
#include <xen/delay.h>
#include <xen/time.h>
#include <xen/sched.h>
@@ -30,7 +31,6 @@
#include <asm/msr.h>
#include <asm/mpspec.h>
#include <asm/nmi.h>
-#include <asm/debugger.h>
#include <asm/div64.h>
#include <asm/apic.h>
@@ -27,6 +27,7 @@
#include <xen/init.h>
#include <xen/sched.h>
#include <xen/lib.h>
+#include <xen/debugger.h>
#include <xen/err.h>
#include <xen/errno.h>
#include <xen/mm.h>
@@ -62,7 +63,6 @@
#include <asm/uaccess.h>
#include <asm/i387.h>
#include <asm/xstate.h>
-#include <asm/debugger.h>
#include <asm/msr.h>
#include <asm/nmi.h>
#include <asm/xenoprof.h>
@@ -17,7 +17,8 @@
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
-#include <asm/debugger.h>
+#include <xen/debugger.h>
+#include <xen/gdbstub.h>
#define GDB_REG64(r) gdb_write_to_packet_hex(r, sizeof(u64), ctx)
#define GDB_REG32(r) gdb_write_to_packet_hex(r, sizeof(u32), ctx)
@@ -11,6 +11,7 @@
#include <xen/err.h>
#include <xen/param.h>
#include <xen/sched.h>
+#include <xen/debugger.h>
#include <xen/domain.h>
#include <xen/mm.h>
#include <xen/event.h>
@@ -33,7 +34,6 @@
#include <xen/xenoprof.h>
#include <xen/irq.h>
#include <xen/argo.h>
-#include <asm/debugger.h>
#include <asm/p2m.h>
#include <asm/processor.h>
#include <public/sched.h>
@@ -38,12 +38,13 @@
#include <xen/serial.h>
#include <xen/irq.h>
#include <xen/watchdog.h>
-#include <asm/debugger.h>
#include <xen/init.h>
#include <xen/param.h>
#include <xen/smp.h>
#include <xen/console.h>
#include <xen/errno.h>
+#include <xen/gdbstub.h>
+#include <xen/debugger.h>
#include <xen/delay.h>
#include <asm/byteorder.h>
@@ -3,6 +3,7 @@
*/
#include <asm/regs.h>
+#include <xen/debugger.h>
#include <xen/delay.h>
#include <xen/keyhandler.h>
#include <xen/param.h>
@@ -20,7 +21,6 @@
#include <xen/mm.h>
#include <xen/watchdog.h>
#include <xen/init.h>
-#include <asm/debugger.h>
#include <asm/div64.h>
static unsigned char keypress_key;
@@ -1,3 +1,4 @@
+#include <xen/debugger.h>
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/param.h>
@@ -8,7 +9,6 @@
#include <xen/shutdown.h>
#include <xen/console.h>
#include <xen/kexec.h>
-#include <asm/debugger.h>
#include <public/sched.h>
/* opt_noreboot: If true, machine will need manual reset on error. */
@@ -15,6 +15,7 @@
#include <xen/init.h>
#include <xen/event.h>
#include <xen/console.h>
+#include <xen/debugger.h>
#include <xen/param.h>
#include <xen/serial.h>
#include <xen/softirq.h>
@@ -26,7 +27,6 @@
#include <xen/kexec.h>
#include <xen/ctype.h>
#include <xen/warning.h>
-#include <asm/debugger.h>
#include <asm/div64.h>
#include <xen/hypercall.h> /* for do_console_io */
#include <xen/early_printk.h>
deleted file mode 100644
@@ -1,15 +0,0 @@
-#ifndef __ARM_DEBUGGER_H__
-#define __ARM_DEBUGGER_H__
-
-#define debugger_trap_fatal(v, r) (0)
-#define debugger_trap_immediate() ((void) 0)
-
-#endif /* __ARM_DEBUGGER_H__ */
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
@@ -1,44 +1,26 @@
/******************************************************************************
- * asm/debugger.h
- *
- * Generic hooks into arch-dependent Xen.
- *
- * Each debugger should define two functions here:
- *
- * 1. debugger_trap_entry():
- * Called at start of any synchronous fault or trap, before any other work
- * is done. The idea is that if your debugger deliberately caused the trap
- * (e.g. to implement breakpoints or data watchpoints) then you can take
- * appropriate action and return a non-zero value to cause early exit from
- * the trap function.
- *
- * 2. debugger_trap_fatal():
- * Called when Xen is about to give up and crash. Typically you will use this
- * hook to drop into a debug session. It can also be used to hook off
- * deliberately caused traps (which you then handle and return non-zero).
+ * x86 Debugger Hooks
*
- * 3. debugger_trap_immediate():
- * Called if we want to drop into a debugger now. This is essentially the
- * same as debugger_trap_fatal, except that we use the current register state
- * rather than the state which was in effect when we took the trap.
- * For example: if we're dying because of an unhandled exception, we call
- * debugger_trap_fatal; if we're dying because of a panic() we call
- * debugger_trap_immediate().
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
-
#ifndef __X86_DEBUGGER_H__
#define __X86_DEBUGGER_H__
+#include <xen/domain.h>
+#include <xen/event.h>
+#include <xen/gdbstub.h>
#include <xen/sched.h>
#include <asm/regs.h>
#include <asm/processor.h>
void domain_pause_for_debugger(void);
-#ifdef CONFIG_CRASH_DEBUG
-
-#include <xen/gdbstub.h>
-
static inline bool debugger_trap_fatal(
unsigned int vector, struct cpu_user_regs *regs)
{
@@ -74,28 +56,10 @@ static inline bool debugger_trap_entry(
return false;
}
-#else
-
-static inline bool debugger_trap_fatal(
- unsigned int vector, struct cpu_user_regs *regs)
-{
- return false;
-}
-
-#define debugger_trap_immediate() ((void)0)
-
-static inline bool debugger_trap_entry(
- unsigned int vector, struct cpu_user_regs *regs)
-{
- return false;
-}
-
-#endif
-
#ifdef CONFIG_GDBSX
unsigned int dbg_rw_mem(unsigned long gva, XEN_GUEST_HANDLE_PARAM(void) buf,
unsigned int len, domid_t domid, bool toaddr,
uint64_t pgd3);
-#endif
+#endif /* CONFIG_GDBSX */
#endif /* __X86_DEBUGGER_H__ */
new file mode 100644
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * Generic hooks into arch-dependent Xen.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Each debugger should define three functions here:
+ *
+ * 1. debugger_trap_entry():
+ * Called at start of any synchronous fault or trap, before any other work
+ * is done. The idea is that if your debugger deliberately caused the trap
+ * (e.g. to implement breakpoints or data watchpoints) then you can take
+ * appropriate action and return a non-zero value to cause early exit from
+ * the trap function.
+ *
+ * 2. debugger_trap_fatal():
+ * Called when Xen is about to give up and crash. Typically you will use this
+ * hook to drop into a debug session. It can also be used to hook off
+ * deliberately caused traps (which you then handle and return non-zero).
+ *
+ * 3. debugger_trap_immediate():
+ * Called if we want to drop into a debugger now. This is essentially the
+ * same as debugger_trap_fatal, except that we use the current register state
+ * rather than the state which was in effect when we took the trap.
+ * For example: if we're dying because of an unhandled exception, we call
+ * debugger_trap_fatal; if we're dying because of a panic() we call
+ * debugger_trap_immediate().
+ */
+
+#ifndef __XEN_DEBUGGER_H__
+#define __XEN_DEBUGGER_H__
+
+#ifdef CONFIG_CRASH_DEBUG
+
+#include <asm/debugger.h>
+
+#else
+
+#include <asm/regs.h>
+#include <asm/processor.h>
+
+static inline void domain_pause_for_debugger(void)
+{
+}
+
+static inline bool debugger_trap_fatal(
+ unsigned int vector, const struct cpu_user_regs *regs)
+{
+ return false;
+}
+
+static inline void debugger_trap_immediate(void)
+{
+}
+
+static inline bool debugger_trap_entry(
+ unsigned int vector, const struct cpu_user_regs *regs)
+{
+ return false;
+}
+
+#endif /* CONFIG_CRASH_DEBUG */
+
+#endif /* __XEN_DEBUGGER_H__ */