direct-io.hg

view tools/libxc/xc.h @ 2237:49739c6ac967

bitkeeper revision 1.1159.1.60 (411de531r3zspsa5WRoqFKGtfCbuAg)

Marge to the xc_linux_restore.c file
author gm281@boulderdash.cl.cam.ac.uk
date Sat Aug 14 10:10:57 2004 +0000 (2004-08-14)
parents 0c7d6ab95324 a628543fb437
children 20d763e472ae 3addc3532bc7
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 (0x7FFEU)
158 typedef struct {
159 #define EVTCHNSTAT_closed 0 /* Chennel is not in use. */
160 #define EVTCHNSTAT_unbound 1 /* Channel is not bound to a source. */
161 #define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
162 #define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
163 #define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
164 int status;
165 union {
166 struct {
167 u32 dom;
168 int port;
169 } interdomain;
170 int pirq;
171 int virq;
172 } u;
173 } xc_evtchn_status_t;
175 int xc_evtchn_bind_interdomain(int xc_handle,
176 u32 dom1, /* may be DOMID_SELF */
177 u32 dom2, /* may be DOMID_SELF */
178 int *port1,
179 int *port2);
180 int xc_evtchn_bind_virq(int xc_handle,
181 int virq,
182 int *port);
183 int xc_evtchn_close(int xc_handle,
184 u32 dom, /* may be DOMID_SELF */
185 int port);
186 int xc_evtchn_send(int xc_handle,
187 int local_port);
188 int xc_evtchn_status(int xc_handle,
189 u32 dom, /* may be DOMID_SELF */
190 int port,
191 xc_evtchn_status_t *status);
193 int xc_physdev_pci_access_modify(int xc_handle,
194 u32 domid,
195 int bus,
196 int dev,
197 int func,
198 int enable);
200 int xc_readconsolering(int xc_handle,
201 char *str,
202 unsigned int max_chars,
203 int clear);
205 typedef struct {
206 int ht_per_core;
207 int cores;
208 unsigned long total_pages;
209 unsigned long free_pages;
210 unsigned long cpu_khz;
211 } xc_physinfo_t;
213 int xc_physinfo(int xc_handle,
214 xc_physinfo_t *info);
216 int xc_sched_id(int xc_handle,
217 int *sched_id);
219 int xc_domain_setname(int xc_handle,
220 u32 domid,
221 char *name);
223 int xc_domain_setinitialmem(int xc_handle,
224 u32 domid,
225 unsigned int initial_memkb);
227 int xc_domain_setmaxmem(int xc_handle,
228 u32 domid,
229 unsigned int max_memkb);
232 #endif /* __XC_H__ */