direct-io.hg

view tools/libxc/xc.h @ 3326:f36de623daa0

bitkeeper revision 1.1159.187.81 (41cc934bUot13IO0-1LsmhYl0sW9Zw)

Add plan9 builder support.
author iap10@labyrinth.cl.cam.ac.uk
date Fri Dec 24 22:08:11 2004 +0000 (2004-12-24)
parents 5195a9576f40
children 6b1aa25ff284 708bd9c8362b
line source
1 /******************************************************************************
2 * xc.h
3 *
4 * A library for low-level access to the Xen control interfaces.
5 *
6 * Copyright (c) 2003-2004, K A Fraser.
7 */
9 #ifndef __XC_H__
10 #define __XC_H__
12 #include <stdint.h>
13 typedef uint8_t u8;
14 typedef uint16_t u16;
15 typedef uint32_t u32;
16 typedef uint64_t u64;
17 typedef int8_t s8;
18 typedef int16_t s16;
19 typedef int32_t s32;
20 typedef int64_t s64;
22 #include <xen/xen.h>
23 #include <xen/dom0_ops.h>
24 #include <xen/event_channel.h>
25 #include <xen/sched_ctl.h>
26 #include <xen/io/domain_controller.h>
28 /* Obtain or relinquish a handle on the 'xc' library. */
29 int xc_interface_open(void);
30 int xc_interface_close(int xc_handle);
32 typedef struct {
33 u32 domid;
34 unsigned int cpu;
35 unsigned int dying:1, crashed:1, shutdown:1,
36 paused:1, blocked:1, running:1;
37 unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
38 unsigned long nr_pages;
39 unsigned long shared_info_frame;
40 u64 cpu_time;
41 unsigned long max_memkb;
42 } xc_dominfo_t;
44 typedef dom0_getdomaininfo_t xc_domaininfo_t;
45 int xc_domain_create(int xc_handle,
46 unsigned int mem_kb,
47 int cpu,
48 float cpu_weight,
49 u32 *pdomid);
50 int xc_domain_pause(int xc_handle,
51 u32 domid);
52 int xc_domain_unpause(int xc_handle,
53 u32 domid);
54 int xc_domain_destroy(int xc_handle,
55 u32 domid);
56 int xc_domain_pincpu(int xc_handle,
57 u32 domid,
58 int cpu);
59 int xc_domain_getinfo(int xc_handle,
60 u32 first_domid,
61 unsigned int max_doms,
62 xc_dominfo_t *info);
63 int xc_domain_getfullinfo(int xc_handle,
64 u32 domid,
65 xc_domaininfo_t *info,
66 full_execution_context_t *ctxt);
67 int xc_domain_setcpuweight(int xc_handle,
68 u32 domid,
69 float weight);
70 long long xc_domain_get_cpu_usage(int xc_handle,
71 domid_t domid);
74 typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
75 int xc_shadow_control(int xc_handle,
76 u32 domid,
77 unsigned int sop,
78 unsigned long *dirty_bitmap,
79 unsigned long pages,
80 xc_shadow_control_stats_t *stats);
83 #define XCFLAGS_VERBOSE 1
84 #define XCFLAGS_LIVE 2
85 #define XCFLAGS_DEBUG 4
86 #define XCFLAGS_CONFIGURE 8
88 struct XcIOContext;
89 int xc_linux_save(int xc_handle, struct XcIOContext *ioctxt);
90 int xc_linux_restore(int xc_handle, struct XcIOContext *ioctxt);
92 int xc_linux_build(int xc_handle,
93 u32 domid,
94 const char *image_name,
95 const char *ramdisk_name,
96 const char *cmdline,
97 unsigned int control_evtchn,
98 unsigned long flags);
100 int
101 xc_plan9_build (int xc_handle,
102 u32 domid,
103 const char *image_name,
104 const char *cmdline,
105 unsigned int control_evtchn,
106 unsigned long flags);
108 int xc_bvtsched_global_set(int xc_handle,
109 unsigned long ctx_allow);
111 int xc_bvtsched_domain_set(int xc_handle,
112 u32 domid,
113 u32 mcuadv,
114 int warpback,
115 s32 warpvalue,
116 long long warpl,
117 long long warpu);
119 int xc_bvtsched_global_get(int xc_handle,
120 unsigned long *ctx_allow);
122 int xc_bvtsched_domain_get(int xc_handle,
123 u32 domid,
124 u32 *mcuadv,
125 int *warpback,
126 s32 *warpvalue,
127 long long *warpl,
128 long long *warpu);
130 int xc_atropos_domain_set(int xc_handle,
131 u32 domid,
132 u64 period, u64 slice, u64 latency,
133 int xtratime);
135 int xc_atropos_domain_get(int xc_handle,
136 u32 domid,
137 u64* period, u64 *slice, u64 *latency,
138 int *xtratime);
140 int xc_rrobin_global_set(int xc_handle, u64 slice);
142 int xc_rrobin_global_get(int xc_handle, u64 *slice);
144 typedef evtchn_status_t xc_evtchn_status_t;
145 int xc_evtchn_alloc_unbound(int xc_handle,
146 u32 dom,
147 int *port);
148 int xc_evtchn_bind_interdomain(int xc_handle,
149 u32 dom1, /* may be DOMID_SELF */
150 u32 dom2, /* may be DOMID_SELF */
151 int *port1,
152 int *port2);
153 int xc_evtchn_bind_virq(int xc_handle,
154 int virq,
155 int *port);
156 int xc_evtchn_close(int xc_handle,
157 u32 dom, /* may be DOMID_SELF */
158 int port);
159 int xc_evtchn_send(int xc_handle,
160 int local_port);
161 int xc_evtchn_status(int xc_handle,
162 u32 dom, /* may be DOMID_SELF */
163 int port,
164 xc_evtchn_status_t *status);
166 int xc_physdev_pci_access_modify(int xc_handle,
167 u32 domid,
168 int bus,
169 int dev,
170 int func,
171 int enable);
173 int xc_readconsolering(int xc_handle,
174 char *str,
175 unsigned int max_chars,
176 int clear);
178 typedef dom0_physinfo_t xc_physinfo_t;
179 int xc_physinfo(int xc_handle,
180 xc_physinfo_t *info);
182 int xc_sched_id(int xc_handle,
183 int *sched_id);
185 int xc_domain_setinitialmem(int xc_handle,
186 u32 domid,
187 unsigned int initial_memkb);
189 int xc_domain_setmaxmem(int xc_handle,
190 u32 domid,
191 unsigned int max_memkb);
193 int xc_domain_setvmassist(int xc_handle,
194 u32 domid,
195 unsigned int cmd,
196 unsigned int type);
198 typedef dom0_perfc_desc_t xc_perfc_desc_t;
199 /* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
200 int xc_perfc_control(int xc_handle,
201 u32 op,
202 xc_perfc_desc_t *desc);
204 void *xc_map_foreign_range(int xc_handle, u32 dom,
205 int size, int prot,
206 unsigned long mfn );
208 void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
209 unsigned long *arr, int num );
211 #endif /* __XC_H__ */