]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Reorganise the extable helpers to export their declarations
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 11 Apr 2017 10:37:32 +0000 (11:37 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 11 Apr 2017 17:41:22 +0000 (18:41 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/extable.c
arch/x86/include/arch/extable.h [new file with mode: 0644]
include/xtf/extable.h

index 02e073476f753863ab711c812e0ef8a2ccf79a59..e77da40e58249de8b390890e87832ea0a6cd5449 100644 (file)
@@ -3,22 +3,8 @@
  *
  * Common x86 exception table helper functions.
  */
-#include <xtf/lib.h>
 #include <xtf/extable.h>
 
-#include <arch/exinfo.h>
-#include <arch/regs.h>
-
-/**
- * Record the current fault in @%eax
- *
- * Sample usage:
- * <pre>
- *   asm volatile ("1: $INSN; 2:"
- *                 _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_eax)
- *                 : "=a" (fault) : "0" (0));
- * </pre>
- */
 bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex)
 {
     regs->ax = EXINFO(regs->entry_vector, regs->error_code);
@@ -27,16 +13,6 @@ bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex)
     return true;
 }
 
-/**
- * Record the current fault in @%edi
- *
- * Sample usage:
- * <pre>
- *   asm volatile ("1: $INSN; 2:"
- *                 _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_edi)
- *                 : "=D" (fault) : "0" (0));
- * </pre>
- */
 bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex)
 {
     regs->di = EXINFO(regs->entry_vector, regs->error_code);
@@ -45,11 +21,6 @@ bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex)
     return true;
 }
 
-/**
- * Fixup from a rdmsr fault
- *
- * Clobber the MSR index to signify error, and zero output.
- */
 bool ex_rdmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex)
 {
     regs->ax = regs->dx = 0;
@@ -59,11 +30,6 @@ bool ex_rdmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex)
     return true;
 }
 
-/**
- * Fixup from a wrmsr fault
- *
- * Clobber the MSR index to signify error.
- */
 bool ex_wrmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex)
 {
     regs->cx = -1u;
diff --git a/arch/x86/include/arch/extable.h b/arch/x86/include/arch/extable.h
new file mode 100644 (file)
index 0000000..3039d16
--- /dev/null
@@ -0,0 +1,60 @@
+/**
+ * @file arch/x86/include/arch/extable.h
+ *
+ * Common x86 exception table helper functions.
+ */
+#ifndef XTF_X86_EXTABLE_H
+#define XTF_X86_EXTABLE_H
+
+#include <arch/exinfo.h>
+#include <arch/regs.h>
+
+/**
+ * Record the current fault in @%eax
+ *
+ * Sample usage:
+ * <pre>
+ *   asm volatile ("1: $INSN; 2:"
+ *                 _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_eax)
+ *                 : "=a" (fault) : "0" (0));
+ * </pre>
+ */
+bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex);
+
+/**
+ * Record the current fault in @%edi
+ *
+ * Sample usage:
+ * <pre>
+ *   asm volatile ("1: $INSN; 2:"
+ *                 _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_edi)
+ *                 : "=D" (fault) : "0" (0));
+ * </pre>
+ */
+bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex);
+
+/**
+ * Fixup from a rdmsr fault
+ *
+ * Clobber the MSR index to signify error, and zero output.
+ */
+bool ex_rdmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex);
+
+/**
+ * Fixup from a wrmsr fault
+ *
+ * Clobber the MSR index to signify error.
+ */
+bool ex_wrmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex);
+
+#endif /* XTF_X86_EXTABLE_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
index aaa205361e27e66c74b6e1900ca4f0d0525dbc2f..b646be83b9ffd76c8597b93a2a37690982039067 100644 (file)
@@ -96,6 +96,8 @@ void sort_extable(void);
  */
 const struct extable_entry *search_extable(unsigned long addr);
 
+#include <arch/extable.h>
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* XTF_EXTABLE_H */