direct-io.hg

view tools/libxc/xc.h @ 3435:0fd048d86eed

bitkeeper revision 1.1159.220.3 (41e670c37jmaTxUns3KlvsbVRCg-UA)

The getdomaininfo hypercall now listens to the exec_domain parameter
that was already passed to it, and performs some basic sanity checking.

Added exec_domain (aka vcpu) parameters to xc_domain_getfullinfo()
and xc_domain_get_cpu_usage().
author mafetter@fleming.research
date Thu Jan 13 12:59:47 2005 +0000 (2005-01-13)
parents 9a92e168d231
children 6096356005ba
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>
14 typedef uint8_t u8;
15 typedef uint16_t u16;
16 typedef uint32_t u32;
17 typedef uint64_t u64;
18 typedef int8_t s8;
19 typedef int16_t s16;
20 typedef int32_t s32;
21 typedef int64_t s64;
23 #include <xen/xen.h>
24 #include <xen/dom0_ops.h>
25 #include <xen/event_channel.h>
26 #include <xen/sched_ctl.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 u32 vcpu,
66 xc_domaininfo_t *info,
67 full_execution_context_t *ctxt);
68 int xc_domain_setcpuweight(int xc_handle,
69 u32 domid,
70 float weight);
71 long long xc_domain_get_cpu_usage(int xc_handle,
72 domid_t domid,
73 int vcpu);
76 typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
77 int xc_shadow_control(int xc_handle,
78 u32 domid,
79 unsigned int sop,
80 unsigned long *dirty_bitmap,
81 unsigned long pages,
82 xc_shadow_control_stats_t *stats);
85 #define XCFLAGS_VERBOSE 1
86 #define XCFLAGS_LIVE 2
87 #define XCFLAGS_DEBUG 4
88 #define XCFLAGS_CONFIGURE 8
90 struct XcIOContext;
91 int xc_linux_save(int xc_handle, struct XcIOContext *ioctxt);
92 int xc_linux_restore(int xc_handle, struct XcIOContext *ioctxt);
94 int xc_linux_build(int xc_handle,
95 u32 domid,
96 const char *image_name,
97 const char *ramdisk_name,
98 const char *cmdline,
99 unsigned int control_evtchn,
100 unsigned long flags);
102 int
103 xc_plan9_build (int xc_handle,
104 u32 domid,
105 const char *image_name,
106 const char *cmdline,
107 unsigned int control_evtchn,
108 unsigned long flags);
110 struct mem_map;
111 int xc_vmx_build(int xc_handle,
112 u32 domid,
113 const char *image_name,
114 struct mem_map *memmap,
115 const char *ramdisk_name,
116 const char *cmdline,
117 unsigned int control_evtchn,
118 unsigned long flags);
120 int xc_bvtsched_global_set(int xc_handle,
121 unsigned long ctx_allow);
123 int xc_bvtsched_domain_set(int xc_handle,
124 u32 domid,
125 u32 mcuadv,
126 int warpback,
127 s32 warpvalue,
128 long long warpl,
129 long long warpu);
131 int xc_bvtsched_global_get(int xc_handle,
132 unsigned long *ctx_allow);
134 int xc_bvtsched_domain_get(int xc_handle,
135 u32 domid,
136 u32 *mcuadv,
137 int *warpback,
138 s32 *warpvalue,
139 long long *warpl,
140 long 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 typedef evtchn_status_t xc_evtchn_status_t;
157 int xc_evtchn_alloc_unbound(int xc_handle,
158 u32 dom,
159 int *port);
160 int xc_evtchn_bind_interdomain(int xc_handle,
161 u32 dom1, /* may be DOMID_SELF */
162 u32 dom2, /* may be DOMID_SELF */
163 int *port1,
164 int *port2);
165 int xc_evtchn_bind_virq(int xc_handle,
166 int virq,
167 int *port);
168 int xc_evtchn_close(int xc_handle,
169 u32 dom, /* may be DOMID_SELF */
170 int port);
171 int xc_evtchn_send(int xc_handle,
172 int local_port);
173 int xc_evtchn_status(int xc_handle,
174 u32 dom, /* may be DOMID_SELF */
175 int port,
176 xc_evtchn_status_t *status);
178 int xc_physdev_pci_access_modify(int xc_handle,
179 u32 domid,
180 int bus,
181 int dev,
182 int func,
183 int enable);
185 int xc_readconsolering(int xc_handle,
186 char *str,
187 unsigned int max_chars,
188 int clear);
190 typedef dom0_physinfo_t xc_physinfo_t;
191 int xc_physinfo(int xc_handle,
192 xc_physinfo_t *info);
194 int xc_sched_id(int xc_handle,
195 int *sched_id);
197 int xc_domain_setinitialmem(int xc_handle,
198 u32 domid,
199 unsigned int initial_memkb);
201 int xc_domain_setmaxmem(int xc_handle,
202 u32 domid,
203 unsigned int max_memkb);
205 int xc_domain_setvmassist(int xc_handle,
206 u32 domid,
207 unsigned int cmd,
208 unsigned int type);
210 typedef dom0_perfc_desc_t xc_perfc_desc_t;
211 /* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
212 int xc_perfc_control(int xc_handle,
213 u32 op,
214 xc_perfc_desc_t *desc);
216 void *xc_map_foreign_range(int xc_handle, u32 dom,
217 int size, int prot,
218 unsigned long mfn );
220 void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
221 unsigned long *arr, int num );
223 int xc_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf,
224 unsigned long max_pfns);
226 #endif /* __XC_H__ */