This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / xen / interface / platform.h
1 /******************************************************************************
2  * platform.h
3  * 
4  * Hardware platform operations. Intended for use by domain-0 kernel.
5  * 
6  * Copyright (c) 2002-2006, K Fraser
7  */
8
9 #ifndef __XEN_PUBLIC_PLATFORM_H__
10 #define __XEN_PUBLIC_PLATFORM_H__
11
12 #include "xen.h"
13
14 #define XENPF_INTERFACE_VERSION 0x03000001
15
16 /*
17  * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
18  * 1 January, 1970 if the current system time was <system_time>.
19  */
20 #define XENPF_settime             17
21 struct xenpf_settime {
22     /* IN variables. */
23     uint32_t secs;
24     uint32_t nsecs;
25     uint64_t system_time;
26 };
27 typedef struct xenpf_settime xenpf_settime_t;
28 DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t);
29
30 /*
31  * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type.
32  * On x86, @type is an architecture-defined MTRR memory type.
33  * On success, returns the MTRR that was used (@reg) and a handle that can
34  * be passed to XENPF_DEL_MEMTYPE to accurately tear down the new setting.
35  * (x86-specific).
36  */
37 #define XENPF_add_memtype         31
38 struct xenpf_add_memtype {
39     /* IN variables. */
40     xen_pfn_t mfn;
41     uint64_t nr_mfns;
42     uint32_t type;
43     /* OUT variables. */
44     uint32_t handle;
45     uint32_t reg;
46 };
47 typedef struct xenpf_add_memtype xenpf_add_memtype_t;
48 DEFINE_XEN_GUEST_HANDLE(xenpf_add_memtype_t);
49
50 /*
51  * Tear down an existing memory-range type. If @handle is remembered then it
52  * should be passed in to accurately tear down the correct setting (in case
53  * of overlapping memory regions with differing types). If it is not known
54  * then @handle should be set to zero. In all cases @reg must be set.
55  * (x86-specific).
56  */
57 #define XENPF_del_memtype         32
58 struct xenpf_del_memtype {
59     /* IN variables. */
60     uint32_t handle;
61     uint32_t reg;
62 };
63 typedef struct xenpf_del_memtype xenpf_del_memtype_t;
64 DEFINE_XEN_GUEST_HANDLE(xenpf_del_memtype_t);
65
66 /* Read current type of an MTRR (x86-specific). */
67 #define XENPF_read_memtype        33
68 struct xenpf_read_memtype {
69     /* IN variables. */
70     uint32_t reg;
71     /* OUT variables. */
72     xen_pfn_t mfn;
73     uint64_t nr_mfns;
74     uint32_t type;
75 };
76 typedef struct xenpf_read_memtype xenpf_read_memtype_t;
77 DEFINE_XEN_GUEST_HANDLE(xenpf_read_memtype_t);
78
79 #define XENPF_microcode_update    35
80 struct xenpf_microcode_update {
81     /* IN variables. */
82     XEN_GUEST_HANDLE(void) data;      /* Pointer to microcode data */
83     uint32_t length;                  /* Length of microcode data. */
84 };
85 typedef struct xenpf_microcode_update xenpf_microcode_update_t;
86 DEFINE_XEN_GUEST_HANDLE(xenpf_microcode_update_t);
87
88 #define XENPF_platform_quirk      39
89 #define QUIRK_NOIRQBALANCING      1 /* Do not restrict IO-APIC RTE targets */
90 #define QUIRK_IOAPIC_BAD_REGSEL   2 /* IO-APIC REGSEL forgets its value    */
91 #define QUIRK_IOAPIC_GOOD_REGSEL  3 /* IO-APIC REGSEL behaves properly     */
92 struct xenpf_platform_quirk {
93     /* IN variables. */
94     uint32_t quirk_id;
95 };
96 typedef struct xenpf_platform_quirk xenpf_platform_quirk_t;
97 DEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t);
98
99 struct xen_platform_op {
100     uint32_t cmd;
101     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
102     union {
103         struct xenpf_settime           settime;
104         struct xenpf_add_memtype       add_memtype;
105         struct xenpf_del_memtype       del_memtype;
106         struct xenpf_read_memtype      read_memtype;
107         struct xenpf_microcode_update  microcode;
108         struct xenpf_platform_quirk    platform_quirk;
109         uint8_t                        pad[128];
110     } u;
111 };
112 typedef struct xen_platform_op xen_platform_op_t;
113 DEFINE_XEN_GUEST_HANDLE(xen_platform_op_t);
114
115 #endif /* __XEN_PUBLIC_PLATFORM_H__ */
116
117 /*
118  * Local variables:
119  * mode: C
120  * c-set-style: "BSD"
121  * c-basic-offset: 4
122  * tab-width: 4
123  * indent-tabs-mode: nil
124  * End:
125  */