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
19extern char _start[], _end[];
20
21/*** Misc helpers which are library code, but really want to be inline. ***/
22
26static 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 {
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 */
x86 Local APIC register definitions and utility functions.
x86 API for tests.
char _end[]
Definition: xtf.h:19
char _start[]
static void update_desc(user_desc *ptr, const user_desc new)
Helper to update a live LDT/GDT entry.
Definition: xtf.h:26
#define barrier()
Definition: compiler.h:30
An encapsulation of an x86 exception with error code.
x86 HPET register definitions and utility functions.
static long hypercall_update_descriptor(uint64_t maddr, user_desc desc)
Definition: hypercall.h:90
x86 IDT vector infrastructure.
x86 IO-APIC register definitions and utility functions.
void panic(const char *fmt,...)
Definition: lib.c:15
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
Definition: macro_magic.h:67
uint64_t virt_to_maddr(const void *va)
Model Specific Register mnemonics and bit definitions.
Macros for creating constants using mnemonics.
x86 TSX intrinsics, compatible with the GCC API.
x86 Debug Register Infrastructure