ia64/xen-unstable

view tools/libxc/xc.h @ 2422:2274a0386cc9

bitkeeper revision 1.1159.69.5 (4138e882jA1YaR_OfTfNHe_uT4PDIg)

trivial
author iap10@labyrinth.cl.cam.ac.uk
date Fri Sep 03 21:56:18 2004 +0000 (2004-09-03)
parents 9afec5bc14ae
children 875c25208085
line source
1 /******************************************************************************
2 * xc.h
3 *
4 * A library for low-level access to the Xen control interfaces.
5 *
6 * Copyright (c) 2003, K A Fraser.
7 */
9 #ifndef __XC_H__
10 #define __XC_H__
12 typedef unsigned char u8;
13 typedef unsigned short u16;
14 typedef unsigned long u32;
15 typedef unsigned long long u64;
16 typedef signed char s8;
17 typedef signed short s16;
18 typedef signed long s32;
19 typedef signed long long s64;
21 /* Obtain or relinquish a handle on the 'xc' library. */
22 int xc_interface_open(void);
23 int xc_interface_close(int xc_handle);
25 typedef struct {
26 u32 domid;
27 unsigned int cpu;
28 unsigned int dying:1, crashed:1, shutdown:1,
29 paused:1, blocked:1, running:1;
30 unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
31 unsigned long nr_pages;
32 unsigned long shared_info_frame;
33 u64 cpu_time;
34 #define XC_DOMINFO_MAXNAME 16
35 char name[XC_DOMINFO_MAXNAME];
36 unsigned long max_memkb;
37 } xc_dominfo_t;
39 typedef struct xc_shadow_control_stats_st
40 {
41 unsigned long fault_count;
42 unsigned long dirty_count;
43 unsigned long dirty_net_count;
44 unsigned long dirty_block_count;
45 } xc_shadow_control_stats_t;
47 int xc_domain_create(int xc_handle,
48 unsigned int mem_kb,
49 const char *name,
50 int cpu,
51 float cpu_weight,
52 u32 *pdomid);
53 int xc_domain_pause(int xc_handle,
54 u32 domid);
55 int xc_domain_unpause(int xc_handle,
56 u32 domid);
57 int xc_domain_destroy(int xc_handle,
58 u32 domid);
59 int xc_domain_pincpu(int xc_handle,
60 u32 domid,
61 int cpu);
62 int xc_domain_getinfo(int xc_handle,
63 u32 first_domid,
64 unsigned int max_doms,
65 xc_dominfo_t *info);
66 int xc_domain_setcpuweight(int xc_handle,
67 u32 domid,
68 float weight);
70 int xc_shadow_control(int xc_handle,
71 u32 domid,
72 unsigned int sop,
73 unsigned long *dirty_bitmap,
74 unsigned long pages,
75 xc_shadow_control_stats_t *stats);
78 #define XCFLAGS_VERBOSE 1
79 #define XCFLAGS_LIVE 2
80 #define XCFLAGS_DEBUG 4
82 struct XcIOContext;
83 int xc_linux_save(int xc_handle, struct XcIOContext *ioctxt);
84 int xc_linux_restore(int xc_handle, struct XcIOContext *ioctxt);
86 int xc_linux_build(int xc_handle,
87 u32 domid,
88 const char *image_name,
89 const char *ramdisk_name,
90 const char *cmdline,
91 unsigned int control_evtchn,
92 unsigned long flags);
94 int xc_netbsd_build(int xc_handle,
95 u32 domid,
96 const char *image_name,
97 const char *cmdline,
98 unsigned int control_evtchn);
100 int xc_bvtsched_global_set(int xc_handle,
101 unsigned long ctx_allow);
103 int xc_bvtsched_domain_set(int xc_handle,
104 u32 domid,
105 u32 mcuadv,
106 int warpback,
107 s32 warpvalue,
108 long long warpl,
109 long long warpu);
111 int xc_bvtsched_global_get(int xc_handle,
112 unsigned long *ctx_allow);
114 int xc_bvtsched_domain_get(int xc_handle,
115 u32 domid,
116 u32 *mcuadv,
117 int *warpback,
118 s32 *warpvalue,
119 long long *warpl,
120 long long *warpu);
122 int xc_fbvtsched_global_set(int xc_handle,
123 unsigned long ctx_allow);
125 int xc_fbvtsched_domain_set(int xc_handle,
126 u32 domid,
127 unsigned long mcuadv,
128 unsigned long warp,
129 unsigned long warpl,
130 unsigned long warpu);
132 int xc_fbvtsched_global_get(int xc_handle,
133 unsigned long *ctx_allow);
135 int xc_fbvtsched_domain_get(int xc_handle,
136 u32 domid,
137 unsigned long *mcuadv,
138 unsigned long *warp,
139 unsigned long *warpl,
140 unsigned long *warpu);
142 int xc_atropos_domain_set(int xc_handle,
143 u32 domid,
144 u64 period, u64 slice, u64 latency,
145 int xtratime);
147 int xc_atropos_domain_get(int xc_handle,
148 u32 domid,
149 u64* period, u64 *slice, u64 *latency,
150 int *xtratime);
152 int xc_rrobin_global_set(int xc_handle, u64 slice);
154 int xc_rrobin_global_get(int xc_handle, u64 *slice);
156 #define DOMID_SELF (0x7FF0U)
157 #define DOMID_IO (0x7FF1U)
158 #define DOMID_XEN (0x7FF2U)
160 typedef struct {
161 #define EVTCHNSTAT_closed 0 /* Chennel is not in use. */
162 #define EVTCHNSTAT_unbound 1 /* Channel is not bound to a source. */
163 #define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
164 #define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
165 #define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
166 int status;
167 union {
168 struct {
169 u32 dom;
170 int port;
171 } interdomain;
172 int pirq;
173 int virq;
174 } u;
175 } xc_evtchn_status_t;
177 int xc_evtchn_bind_interdomain(int xc_handle,
178 u32 dom1, /* may be DOMID_SELF */
179 u32 dom2, /* may be DOMID_SELF */
180 int *port1,
181 int *port2);
182 int xc_evtchn_bind_virq(int xc_handle,
183 int virq,
184 int *port);
185 int xc_evtchn_close(int xc_handle,
186 u32 dom, /* may be DOMID_SELF */
187 int port);
188 int xc_evtchn_send(int xc_handle,
189 int local_port);
190 int xc_evtchn_status(int xc_handle,
191 u32 dom, /* may be DOMID_SELF */
192 int port,
193 xc_evtchn_status_t *status);
195 int xc_physdev_pci_access_modify(int xc_handle,
196 u32 domid,
197 int bus,
198 int dev,
199 int func,
200 int enable);
202 int xc_readconsolering(int xc_handle,
203 char *str,
204 unsigned int max_chars,
205 int clear);
207 typedef struct {
208 int ht_per_core;
209 int cores;
210 unsigned long total_pages;
211 unsigned long free_pages;
212 unsigned long cpu_khz;
213 } xc_physinfo_t;
215 int xc_physinfo(int xc_handle,
216 xc_physinfo_t *info);
218 int xc_sched_id(int xc_handle,
219 int *sched_id);
221 int xc_domain_setname(int xc_handle,
222 u32 domid,
223 char *name);
225 int xc_domain_setinitialmem(int xc_handle,
226 u32 domid,
227 unsigned int initial_memkb);
229 int xc_domain_setmaxmem(int xc_handle,
230 u32 domid,
231 unsigned int max_memkb);
234 void *xc_map_foreign_range(int xc_handle, u32 dom,
235 int size, int prot,
236 unsigned long mfn );
238 void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
239 unsigned long *arr, int num );
241 #endif /* __XC_H__ */