]> xenbits.xensource.com Git - people/aperard/xtf.git/commitdiff
common: Make a weak default for arch_crash_hard()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 May 2021 17:03:09 +0000 (18:03 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Aug 2021 20:06:28 +0000 (21:06 +0100)
arch_crash_hard() is used from common code, and in the most basic case can
just be an infinite loop.  Both x86 PV and HVM keep their more specific
implementations.

Move the declaration from arch/traps.h to framework.h

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/include/arch/traps.h
common/lib.c
common/weak-defaults.c
include/xtf/framework.h

index 60fc3a4c9772685a994c479b1c0115dfc5943bb5..3e1d52dcb8b2904cfdb13099ff66d0567ac73b41 100644 (file)
  */
 void arch_init_traps(void);
 
-/*
- * Arch-specific function to quiesce the domain, in the event that a
- * shutdown(crash) hypercall has not succeeded.
- */
-void __noreturn arch_crash_hard(void);
-
 /*
  * Return the correct %ss/%esp from an exception.  In 32bit if no stack switch
  * occurs, an exception frame doesn't contain this information.
index acf4da17d2894fbd97635cf341d9052950cbbbf0..58f49656d00f178bac582330a6c3179e0751ef26 100644 (file)
@@ -1,3 +1,4 @@
+#include <xtf/framework.h>
 #include <xtf/lib.h>
 #include <xtf/traps.h>
 #include <xtf/hypercall.h>
index 74cefebf419fa98f0c302a8508baa4fa033d3874..5aa54689f3589372cfff2929194fbc5a91408967 100644 (file)
@@ -16,6 +16,14 @@ void __weak test_setup(void)
 {
 }
 
+void __weak __noreturn arch_crash_hard(void)
+{
+    /* panic() has failed.  Sit in a tight loop. */
+    for ( ;; )
+        ;
+    unreachable();
+}
+
 /*
  * Local variables:
  * mode: C
index 4c6527e6ef96b0bea498fb039e8875077d13e798..1146a6a5f2f655d830f44178ad61f96ca2c3e340 100644 (file)
@@ -16,6 +16,12 @@ void arch_setup(void);
 /* Set up test-specific configuration. */
 void test_setup(void);
 
+/*
+ * In the case that normal shutdown actions have failed, contain execution as
+ * best as possible.
+ */
+void __noreturn arch_crash_hard(void);
+
 /* Single line summary of execution environment. */
 extern const char environment_description[];