ia64/xen-unstable

view tools/libxc/xc.h @ 1820:3d4f8eb89670

bitkeeper revision 1.1106.1.2 (40faa780dekT3E5arFwcbQDu1MbX6g)

Cleaned up Xen's instruction emulator.
author kaf24@scramble.cl.cam.ac.uk
date Sun Jul 18 16:38:24 2004 +0000 (2004-07-18)
parents 083178f6cdfa
children 1ac7603a60bd
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 unsigned long mcuadv,
102 unsigned long warp,
103 unsigned long warpl,
104 unsigned long warpu);
106 int xc_bvtsched_global_get(int xc_handle,
107 unsigned long *ctx_allow);
109 int xc_bvtsched_domain_get(int xc_handle,
110 u32 domid,
111 unsigned long *mcuadv,
112 unsigned long *warp,
113 unsigned long *warpl,
114 unsigned long *warpu);
116 int xc_fbvtsched_global_set(int xc_handle,
117 unsigned long ctx_allow);
119 int xc_fbvtsched_domain_set(int xc_handle,
120 u32 domid,
121 unsigned long mcuadv,
122 unsigned long warp,
123 unsigned long warpl,
124 unsigned long warpu);
126 int xc_fbvtsched_global_get(int xc_handle,
127 unsigned long *ctx_allow);
129 int xc_fbvtsched_domain_get(int xc_handle,
130 u32 domid,
131 unsigned long *mcuadv,
132 unsigned long *warp,
133 unsigned long *warpl,
134 unsigned long *warpu);
136 int xc_atropos_domain_set(int xc_handle,
137 u32 domid,
138 u64 period, u64 slice, u64 latency,
139 int xtratime);
141 int xc_atropos_domain_get(int xc_handle,
142 u32 domid,
143 u64* period, u64 *slice, u64 *latency,
144 int *xtratime);
146 int xc_rrobin_global_set(int xc_handle, u64 slice);
148 int xc_rrobin_global_get(int xc_handle, u64 *slice);
150 #define DOMID_SELF (0x7FFFFFFEU)
152 typedef struct {
153 #define EVTCHNSTAT_closed 0 /* Chennel is not in use. */
154 #define EVTCHNSTAT_unbound 1 /* Channel is not bound to a source. */
155 #define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
156 #define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
157 #define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
158 int status;
159 union {
160 struct {
161 u32 dom;
162 int port;
163 } interdomain;
164 int pirq;
165 int virq;
166 } u;
167 } xc_evtchn_status_t;
169 int xc_evtchn_bind_interdomain(int xc_handle,
170 u32 dom1, /* may be DOMID_SELF */
171 u32 dom2, /* may be DOMID_SELF */
172 int *port1,
173 int *port2);
174 int xc_evtchn_bind_virq(int xc_handle,
175 int virq,
176 int *port);
177 int xc_evtchn_close(int xc_handle,
178 u32 dom, /* may be DOMID_SELF */
179 int port);
180 int xc_evtchn_send(int xc_handle,
181 int local_port);
182 int xc_evtchn_status(int xc_handle,
183 u32 dom, /* may be DOMID_SELF */
184 int port,
185 xc_evtchn_status_t *status);
187 int xc_physdev_pci_access_modify(int xc_handle,
188 u32 domid,
189 int bus,
190 int dev,
191 int func,
192 int enable);
194 int xc_readconsolering(int xc_handle,
195 char *str,
196 unsigned int max_chars,
197 int clear);
199 typedef struct {
200 int ht_per_core;
201 int cores;
202 unsigned long total_pages;
203 unsigned long free_pages;
204 unsigned long cpu_khz;
205 } xc_physinfo_t;
207 int xc_physinfo(int xc_handle,
208 xc_physinfo_t *info);
210 int xc_domain_setname(int xc_handle,
211 u32 domid,
212 char *name);
214 int xc_domain_setinitialmem(int xc_handle,
215 u32 domid,
216 unsigned int initial_memkb);
218 int xc_domain_setmaxmem(int xc_handle,
219 u32 domid,
220 unsigned int max_memkb);
223 #endif /* __XC_H__ */