direct-io.hg

view tools/libxc/xc.h @ 2821:724449a888fe

bitkeeper revision 1.1159.1.332 (41874e954CLIDA2J3phVFD2RnzVTpA)

Clean up public XenLinux header files. Now accessible from userspace as
#include <xen/linux...>
Got rid of the linux-xen-sparse symlink as it's no longer needed.
author kaf24@freefall.cl.cam.ac.uk
date Tue Nov 02 09:08:37 2004 +0000 (2004-11-02)
parents 3f929065a1d1
children 9035b6656818 f2e12f9f7cc8 fd0d4d8e6193 52e7357311c2
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 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 #include <xen/xen.h>
22 #include <xen/dom0_ops.h>
23 #include <xen/event_channel.h>
24 #include <xen/sched_ctl.h>
25 #include <xen/io/domain_controller.h>
27 /* Obtain or relinquish a handle on the 'xc' library. */
28 int xc_interface_open(void);
29 int xc_interface_close(int xc_handle);
31 typedef struct {
32 u32 domid;
33 unsigned int cpu;
34 unsigned int dying:1, crashed:1, shutdown:1,
35 paused:1, blocked:1, running:1;
36 unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
37 unsigned long nr_pages;
38 unsigned long shared_info_frame;
39 u64 cpu_time;
40 unsigned long max_memkb;
41 } xc_dominfo_t;
43 typedef dom0_getdomaininfo_t xc_domaininfo_t;
44 int xc_domain_create(int xc_handle,
45 unsigned int mem_kb,
46 int cpu,
47 float cpu_weight,
48 u32 *pdomid);
49 int xc_domain_pause(int xc_handle,
50 u32 domid);
51 int xc_domain_unpause(int xc_handle,
52 u32 domid);
53 int xc_domain_destroy(int xc_handle,
54 u32 domid);
55 int xc_domain_pincpu(int xc_handle,
56 u32 domid,
57 int cpu);
58 int xc_domain_getinfo(int xc_handle,
59 u32 first_domid,
60 unsigned int max_doms,
61 xc_dominfo_t *info);
62 int xc_domain_getfullinfo(int xc_handle,
63 u32 domid,
64 xc_domaininfo_t *info,
65 full_execution_context_t *ctxt);
66 int xc_domain_setcpuweight(int xc_handle,
67 u32 domid,
68 float weight);
69 long long xc_domain_get_cpu_usage(int xc_handle,
70 domid_t domid);
73 typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
74 int xc_shadow_control(int xc_handle,
75 u32 domid,
76 unsigned int sop,
77 unsigned long *dirty_bitmap,
78 unsigned long pages,
79 xc_shadow_control_stats_t *stats);
82 #define XCFLAGS_VERBOSE 1
83 #define XCFLAGS_LIVE 2
84 #define XCFLAGS_DEBUG 4
85 #define XCFLAGS_CONFIGURE 8
87 struct XcIOContext;
88 int xc_linux_save(int xc_handle, struct XcIOContext *ioctxt);
89 int xc_linux_restore(int xc_handle, struct XcIOContext *ioctxt);
91 int xc_linux_build(int xc_handle,
92 u32 domid,
93 const char *image_name,
94 const char *ramdisk_name,
95 const char *cmdline,
96 unsigned int control_evtchn,
97 unsigned long flags);
99 int xc_bvtsched_global_set(int xc_handle,
100 unsigned long ctx_allow);
102 int xc_bvtsched_domain_set(int xc_handle,
103 u32 domid,
104 u32 mcuadv,
105 int warpback,
106 s32 warpvalue,
107 long long warpl,
108 long long warpu);
110 int xc_bvtsched_global_get(int xc_handle,
111 unsigned long *ctx_allow);
113 int xc_bvtsched_domain_get(int xc_handle,
114 u32 domid,
115 u32 *mcuadv,
116 int *warpback,
117 s32 *warpvalue,
118 long long *warpl,
119 long long *warpu);
121 int xc_atropos_domain_set(int xc_handle,
122 u32 domid,
123 u64 period, u64 slice, u64 latency,
124 int xtratime);
126 int xc_atropos_domain_get(int xc_handle,
127 u32 domid,
128 u64* period, u64 *slice, u64 *latency,
129 int *xtratime);
131 int xc_rrobin_global_set(int xc_handle, u64 slice);
133 int xc_rrobin_global_get(int xc_handle, u64 *slice);
135 typedef evtchn_status_t xc_evtchn_status_t;
136 int xc_evtchn_alloc_unbound(int xc_handle,
137 u32 dom,
138 int *port);
139 int xc_evtchn_bind_interdomain(int xc_handle,
140 u32 dom1, /* may be DOMID_SELF */
141 u32 dom2, /* may be DOMID_SELF */
142 int *port1,
143 int *port2);
144 int xc_evtchn_bind_virq(int xc_handle,
145 int virq,
146 int *port);
147 int xc_evtchn_close(int xc_handle,
148 u32 dom, /* may be DOMID_SELF */
149 int port);
150 int xc_evtchn_send(int xc_handle,
151 int local_port);
152 int xc_evtchn_status(int xc_handle,
153 u32 dom, /* may be DOMID_SELF */
154 int port,
155 xc_evtchn_status_t *status);
157 int xc_physdev_pci_access_modify(int xc_handle,
158 u32 domid,
159 int bus,
160 int dev,
161 int func,
162 int enable);
164 int xc_readconsolering(int xc_handle,
165 char *str,
166 unsigned int max_chars,
167 int clear);
169 typedef dom0_physinfo_t xc_physinfo_t;
170 int xc_physinfo(int xc_handle,
171 xc_physinfo_t *info);
173 int xc_sched_id(int xc_handle,
174 int *sched_id);
176 int xc_domain_setinitialmem(int xc_handle,
177 u32 domid,
178 unsigned int initial_memkb);
180 int xc_domain_setmaxmem(int xc_handle,
181 u32 domid,
182 unsigned int max_memkb);
184 int xc_domain_setvmassist(int xc_handle,
185 u32 domid,
186 unsigned int cmd,
187 unsigned int type);
190 void *xc_map_foreign_range(int xc_handle, u32 dom,
191 int size, int prot,
192 unsigned long mfn );
194 void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
195 unsigned long *arr, int num );
197 #endif /* __XC_H__ */