Xen Test Framework
include
xtf
extable.h
Go to the documentation of this file.
1
10
#ifndef XTF_EXTABLE_H
11
#define XTF_EXTABLE_H
12
13
#include <
xtf/types.h
>
14
#include <
xtf/asm_macros.h
>
15
#include <
xtf/macro_magic.h
>
16
17
#ifdef __ASSEMBLY__
18
25
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler) \
26
.pushsection .ex_table, "a"
; \
27
_WORD fault, fixup, handler; \
28
.popsection
29
30
#else
31
38
#define _ASM_EXTABLE_HANDLER(fault, fixup, handler) \
39
".pushsection .ex_table, \"a\";\n"
\
40
_WORD STR(fault) ", " STR(fixup) ", " STR(handler) ";\n" \
41
".popsection;\n"
42
43
#endif
44
50
#define _ASM_EXTABLE(fault, fixup) _ASM_EXTABLE_HANDLER(fault, fixup, 0)
51
57
#define _ASM_TRAP_OK(loc) _ASM_EXTABLE(loc, loc)
58
59
#ifndef __ASSEMBLY__
60
61
struct
cpu_regs;
62
64
struct
extable_entry
65
{
66
unsigned
long
fault
;
67
unsigned
long
fixup
;
79
bool
(*
handler
)(
struct
cpu_regs *regs,
80
const
struct
extable_entry
*ex);
81
};
82
87
void
sort_extable
(
void
);
88
95
const
struct
extable_entry
*
search_extable
(
unsigned
long
addr);
96
97
#include <
arch/extable.h
>
98
99
#endif
/* __ASSEMBLY__ */
100
101
#endif
/* XTF_EXTABLE_H */
102
103
/*
104
* Local variables:
105
* mode: C
106
* c-file-style: "BSD"
107
* c-basic-offset: 4
108
* tab-width: 4
109
* indent-tabs-mode: nil
110
* End:
111
*/
extable.h
Common x86 exception table helper functions.
asm_macros.h
Macros for use in assembly files.
search_extable
const struct extable_entry * search_extable(unsigned long addr)
Search the exception table to find the entry associated with a specific faulting address.
Definition:
extable.c:11
sort_extable
void sort_extable(void)
Sort the exception table.
Definition:
extable.c:52
macro_magic.h
Varadic macro helpers - Here be many dragons.
bool
_Bool bool
Definition:
stdbool.h:9
extable_entry
Exception table entry.
Definition:
extable.h:65
extable_entry::handler
bool(* handler)(struct cpu_regs *regs, const struct extable_entry *ex)
Optional custom handler.
Definition:
extable.h:79
extable_entry::fixup
unsigned long fixup
Fixup address.
Definition:
extable.h:67
extable_entry::fault
unsigned long fault
Faulting address.
Definition:
extable.h:66
types.h
Common declarations for all tests.
Generated by
1.9.4