Xen Test Framework
xtf.h
Go to the documentation of this file.
1 #ifndef XTF_X86_XTF_H
2 #define XTF_X86_XTF_H
3 
4 #include <arch/apic.h>
5 #include <arch/cpuid.h>
6 #include <arch/exinfo.h>
7 #include <arch/hpet.h>
8 #include <arch/idt.h>
9 #include <arch/io-apic.h>
10 #include <arch/lib.h>
11 #include <arch/mm.h>
12 #include <arch/msr.h>
13 #include <arch/pagetable.h>
14 #include <arch/symbolic-const.h>
15 #include <arch/test.h>
16 #include <arch/tsx.h>
17 #include <arch/x86-dbg-reg.h>
18 
19 extern char _start[], _end[];
20 
21 /*** Misc helpers which are library code, but really want to be inline. ***/
22 
26 static inline void update_desc(user_desc *ptr, const user_desc new)
27 {
28  if ( IS_DEFINED(CONFIG_HVM) )
29  {
30  *ptr = new;
31 
32  /*
33  * Prevent the compiler reordering later operations which refer to the
34  * descriptor which has been updated.
35  */
36  barrier();
37  }
38  else
39  {
40  int rc = hypercall_update_descriptor(virt_to_maddr(ptr), new);
41  if ( rc )
42  panic("Update descriptor failed: %d\n", rc);
43  }
44 }
45 
46 #endif /* XTF_X86_XTF_H */
47 
48 /*
49  * Local variables:
50  * mode: C
51  * c-file-style: "BSD"
52  * c-basic-offset: 4
53  * tab-width: 4
54  * indent-tabs-mode: nil
55  * End:
56  */
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
Definition: macro_magic.h:67
Macros for creating constants using mnemonics.
x86 API for tests.
x86 TSX intrinsics, compatible with the GCC API.
An encapsulation of an x86 exception with error code.
x86 IDT vector infrastructure.
#define barrier()
Definition: compiler.h:30
void panic(const char *fmt,...)
Definition: lib.c:15
static long hypercall_update_descriptor(uint64_t maddr, user_desc desc)
Definition: hypercall.h:90
char _end[]
uint64_t virt_to_maddr(const void *va)
x86 IO-APIC register definitions and utility functions.
static void update_desc(user_desc *ptr, const user_desc new)
Helper to update a live LDT/GDT entry.
Definition: xtf.h:26
x86 HPET register definitions and utility functions.
x86 Local APIC register definitions and utility functions.
x86 Debug Register Infrastructure
char _start[]
Model Specific Register mnemonics and bit definitions.