direct-io.hg

view tools/libxc/xc.h @ 2187:0c7d6ab95324

bitkeeper revision 1.1159.1.37 (4119f39et8u5bHvw8V3o56W8JdTE9A)

Merge xenbk@gandalf:/var/bk/xeno-unstable.bk
into wray-m-3.hpl.hp.com:/home/mjw/repos-bk/xeno-unstable.bk
author mjw@wray-m-3.hpl.hp.com
date Wed Aug 11 10:19:26 2004 +0000 (2004-08-11)
parents bd1640d9d7d4 eeb76f67d3d3
children a628543fb437 49739c6ac967
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 u32 *pdomid);
52 int xc_domain_pause(int xc_handle,
53 u32 domid);
54 int xc_domain_unpause(int xc_handle,
55 u32 domid);
56 int xc_domain_destroy(int xc_handle,
57 u32 domid);
58 int xc_domain_pincpu(int xc_handle,
59 u32 domid,
60 int cpu);
61 int xc_domain_getinfo(int xc_handle,
62 u32 first_domid,
63 unsigned int max_doms,
64 xc_dominfo_t *info);
66 int xc_shadow_control(int xc_handle,
67 u32 domid,
68 unsigned int sop,
69 unsigned long *dirty_bitmap,
70 unsigned long pages,
71 xc_shadow_control_stats_t *stats);
74 #define XCFLAGS_VERBOSE 1
75 #define XCFLAGS_LIVE 2
76 #define XCFLAGS_DEBUG 4
78 struct XcIOContext;
79 int xc_linux_save(int xc_handle, struct XcIOContext *ioctxt);
80 int xc_linux_restore(int xc_handle, struct XcIOContext *ioctxt);
82 int xc_linux_build(int xc_handle,
83 u32 domid,
84 const char *image_name,
85 const char *ramdisk_name,
86 const char *cmdline,
87 unsigned int control_evtchn,
88 unsigned long flags);
90 int xc_netbsd_build(int xc_handle,
91 u32 domid,
92 const char *image_name,
93 const char *cmdline,
94 unsigned int control_evtchn);
96 int xc_bvtsched_global_set(int xc_handle,
97 unsigned long ctx_allow);
99 int xc_bvtsched_domain_set(int xc_handle,
100 u32 domid,
101 u32 mcuadv,
102 int warpback,
103 s32 warpvalue,
104 long long warpl,
105 long long warpu);
107 int xc_bvtsched_global_get(int xc_handle,
108 unsigned long *ctx_allow);
110 int xc_bvtsched_domain_get(int xc_handle,
111 u32 domid,
112 u32 *mcuadv,
113 int *warpback,
114 s32 *warpvalue,
115 long long *warpl,
116 long long *warpu);
118 int xc_fbvtsched_global_set(int xc_handle,
119 unsigned long ctx_allow);
121 int xc_fbvtsched_domain_set(int xc_handle,
122 u32 domid,
123 unsigned long mcuadv,
124 unsigned long warp,
125 unsigned long warpl,
126 unsigned long warpu);
128 int xc_fbvtsched_global_get(int xc_handle,
129 unsigned long *ctx_allow);
131 int xc_fbvtsched_domain_get(int xc_handle,
132 u32 domid,
133 unsigned long *mcuadv,
134 unsigned long *warp,
135 unsigned long *warpl,
136 unsigned long *warpu);
138 int xc_atropos_domain_set(int xc_handle,
139 u32 domid,
140 u64 period, u64 slice, u64 latency,
141 int xtratime);
143 int xc_atropos_domain_get(int xc_handle,
144 u32 domid,
145 u64* period, u64 *slice, u64 *latency,
146 int *xtratime);
148 int xc_rrobin_global_set(int xc_handle, u64 slice);
150 int xc_rrobin_global_get(int xc_handle, u64 *slice);
152 #define DOMID_SELF (0x7FFEU)
154 typedef struct {
155 #define EVTCHNSTAT_closed 0 /* Chennel is not in use. */
156 #define EVTCHNSTAT_unbound 1 /* Channel is not bound to a source. */
157 #define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
158 #define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
159 #define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
160 int status;
161 union {
162 struct {
163 u32 dom;
164 int port;
165 } interdomain;
166 int pirq;
167 int virq;
168 } u;
169 } xc_evtchn_status_t;
171 int xc_evtchn_bind_interdomain(int xc_handle,
172 u32 dom1, /* may be DOMID_SELF */
173 u32 dom2, /* may be DOMID_SELF */
174 int *port1,
175 int *port2);
176 int xc_evtchn_bind_virq(int xc_handle,
177 int virq,
178 int *port);
179 int xc_evtchn_close(int xc_handle,
180 u32 dom, /* may be DOMID_SELF */
181 int port);
182 int xc_evtchn_send(int xc_handle,
183 int local_port);
184 int xc_evtchn_status(int xc_handle,
185 u32 dom, /* may be DOMID_SELF */
186 int port,
187 xc_evtchn_status_t *status);
189 int xc_physdev_pci_access_modify(int xc_handle,
190 u32 domid,
191 int bus,
192 int dev,
193 int func,
194 int enable);
196 int xc_readconsolering(int xc_handle,
197 char *str,
198 unsigned int max_chars,
199 int clear);
201 typedef struct {
202 int ht_per_core;
203 int cores;
204 unsigned long total_pages;
205 unsigned long free_pages;
206 unsigned long cpu_khz;
207 } xc_physinfo_t;
209 int xc_physinfo(int xc_handle,
210 xc_physinfo_t *info);
212 int xc_domain_setname(int xc_handle,
213 u32 domid,
214 char *name);
216 int xc_domain_setinitialmem(int xc_handle,
217 u32 domid,
218 unsigned int initial_memkb);
220 int xc_domain_setmaxmem(int xc_handle,
221 u32 domid,
222 unsigned int max_memkb);
225 #endif /* __XC_H__ */