Xen Test Framework
extable.c
Go to the documentation of this file.
1 
6 #include <xtf/extable.h>
7 
8 bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex)
9 {
10  regs->ax = EXINFO(regs->entry_vector, regs->error_code);
11  regs->ip = ex->fixup;
12 
13  return true;
14 }
15 
16 bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex)
17 {
18  regs->di = EXINFO(regs->entry_vector, regs->error_code);
19  regs->ip = ex->fixup;
20 
21  return true;
22 }
23 
24 bool ex_rdmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex)
25 {
26  regs->ax = regs->dx = 0;
27  regs->cx = -1u;
28  regs->ip = ex->fixup;
29 
30  return true;
31 }
32 
33 bool ex_wrmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex)
34 {
35  regs->cx = -1u;
36  regs->ip = ex->fixup;
37 
38  return true;
39 }
40 
41 /*
42  * Local variables:
43  * mode: C
44  * c-file-style: "BSD"
45  * c-basic-offset: 4
46  * tab-width: 4
47  * indent-tabs-mode: nil
48  * End:
49  */
unsigned long fixup
Fixup address.
Definition: extable.h:67
bool ex_wrmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex)
Fixup from a wrmsr fault.
Definition: extable.c:33
bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %eax.
Definition: extable.c:8
#define EXINFO(vec, ec)
Definition: exinfo.h:26
Exception table support.
bool ex_record_fault_edi(struct cpu_regs *regs, const struct extable_entry *ex)
Record the current fault in %edi.
Definition: extable.c:16
bool ex_rdmsr_safe(struct cpu_regs *regs, const struct extable_entry *ex)
Fixup from a rdmsr fault.
Definition: extable.c:24
Exception table entry.
Definition: extable.h:64