direct-io.hg

view tools/libxc/xc.h @ 3449:52e7357311c2

bitkeeper revision 1.1159.221.1 (41ebbfeezjfpGp20MD6f6Xl2r6Wd3Q)

Added new simple EDF scheduler
author sd386@font.cl.cam.ac.uk
date Mon Jan 17 13:38:54 2005 +0000 (2005-01-17)
parents 724449a888fe
children f8e1f285e41f
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 int xc_sedf_domain_set(int xc_handle,
136 u32 domid,
137 u64 period, u64 slice);
139 int xc_sedf_domain_get(int xc_handle,
140 u32 domid,
141 u64* period, u64 *slice);
143 typedef evtchn_status_t xc_evtchn_status_t;
144 int xc_evtchn_alloc_unbound(int xc_handle,
145 u32 dom,
146 int *port);
147 int xc_evtchn_bind_interdomain(int xc_handle,
148 u32 dom1, /* may be DOMID_SELF */
149 u32 dom2, /* may be DOMID_SELF */
150 int *port1,
151 int *port2);
152 int xc_evtchn_bind_virq(int xc_handle,
153 int virq,
154 int *port);
155 int xc_evtchn_close(int xc_handle,
156 u32 dom, /* may be DOMID_SELF */
157 int port);
158 int xc_evtchn_send(int xc_handle,
159 int local_port);
160 int xc_evtchn_status(int xc_handle,
161 u32 dom, /* may be DOMID_SELF */
162 int port,
163 xc_evtchn_status_t *status);
165 int xc_physdev_pci_access_modify(int xc_handle,
166 u32 domid,
167 int bus,
168 int dev,
169 int func,
170 int enable);
172 int xc_readconsolering(int xc_handle,
173 char *str,
174 unsigned int max_chars,
175 int clear);
177 typedef dom0_physinfo_t xc_physinfo_t;
178 int xc_physinfo(int xc_handle,
179 xc_physinfo_t *info);
181 int xc_sched_id(int xc_handle,
182 int *sched_id);
184 int xc_domain_setinitialmem(int xc_handle,
185 u32 domid,
186 unsigned int initial_memkb);
188 int xc_domain_setmaxmem(int xc_handle,
189 u32 domid,
190 unsigned int max_memkb);
192 int xc_domain_setvmassist(int xc_handle,
193 u32 domid,
194 unsigned int cmd,
195 unsigned int type);
198 void *xc_map_foreign_range(int xc_handle, u32 dom,
199 int size, int prot,
200 unsigned long mfn );
202 void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
203 unsigned long *arr, int num );
205 #endif /* __XC_H__ */