direct-io.hg

annotate tools/libxc/xenctrl.h @ 7379:d48bc069122c

In addition to setting opaque handle during domain
creation, allow it to be changed after creation via
DOM0_SETDOMAINHANDLE operation (and libxc
xc_domain_sethandle, and via Pyhton wrapper fn).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Oct 14 16:01:11 2005 +0100 (2005-10-14)
parents bd3268de4145
children fa0faada967b
rev   line source
mjw@1623 1 /******************************************************************************
cl349@6388 2 * xenctrl.h
mjw@1623 3 *
mjw@1623 4 * A library for low-level access to the Xen control interfaces.
mjw@1623 5 *
kaf24@2787 6 * Copyright (c) 2003-2004, K A Fraser.
mjw@1623 7 */
mjw@1623 8
cl349@6389 9 #ifndef XENCTRL_H
cl349@6389 10 #define XENCTRL_H
mjw@1623 11
kaf24@3266 12 #include <stdint.h>
kaf24@4719 13 #include <sys/ptrace.h>
kaf24@2821 14 #include <xen/xen.h>
kaf24@2821 15 #include <xen/dom0_ops.h>
vh249@6549 16 #include <xen/version.h>
kaf24@2821 17 #include <xen/event_channel.h>
kaf24@7196 18 #include <xen/sched.h>
kaf24@2821 19 #include <xen/sched_ctl.h>
kaf24@5541 20 #include <xen/acm.h>
kaf24@2787 21
kaf24@5914 22 #ifdef __ia64__
kaf24@5914 23 #define XC_PAGE_SHIFT 14
kaf24@5914 24 #else
kaf24@5914 25 #define XC_PAGE_SHIFT 12
kaf24@5914 26 #endif
kaf24@5914 27 #define XC_PAGE_SIZE (1UL << XC_PAGE_SHIFT)
kaf24@5914 28 #define XC_PAGE_MASK (~(XC_PAGE_SIZE-1))
kaf24@5914 29
kaf24@3961 30 /*
kaf24@3961 31 * DEFINITIONS FOR CPU BARRIERS
kaf24@3961 32 */
kaf24@3961 33
kaf24@3961 34 #if defined(__i386__)
kaf24@3966 35 #define mb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
kaf24@3966 36 #define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
kaf24@3966 37 #define wmb() __asm__ __volatile__ ( "" : : : "memory")
kaf24@3961 38 #elif defined(__x86_64__)
kaf24@3966 39 #define mb() __asm__ __volatile__ ( "mfence" : : : "memory")
kaf24@3966 40 #define rmb() __asm__ __volatile__ ( "lfence" : : : "memory")
kaf24@3966 41 #define wmb() __asm__ __volatile__ ( "" : : : "memory")
kaf24@5914 42 #elif defined(__ia64__)
kaf24@5914 43 /* FIXME */
kaf24@5914 44 #define mb()
kaf24@5914 45 #define rmb()
kaf24@5914 46 #define wmb()
kaf24@3961 47 #else
kaf24@3961 48 #error "Define barriers"
kaf24@3961 49 #endif
kaf24@3961 50
kaf24@3961 51 /*
iap10@3443 52 * INITIALIZATION FUNCTIONS
kaf24@3961 53 */
iap10@3443 54
iap10@3443 55 /**
iap10@3443 56 * This function opens a handle to the hypervisor interface. This function can
iap10@3443 57 * be called multiple times within a single process. Multiple processes can
iap10@3443 58 * have an open hypervisor interface at the same time.
iap10@3443 59 *
iap10@3443 60 * Each call to this function should have a corresponding call to
iap10@3443 61 * xc_interface_close().
iap10@3443 62 *
iap10@3443 63 * This function can fail if the caller does not have superuser permission or
iap10@3443 64 * if a Xen-enabled kernel is not currently running.
iap10@3443 65 *
iap10@3443 66 * @return a handle to the hypervisor interface or -1 on failure
iap10@3443 67 */
mjw@1623 68 int xc_interface_open(void);
iap10@3443 69
iap10@3443 70 /**
iap10@3443 71 * This function closes an open hypervisor interface.
iap10@3443 72 *
iap10@3443 73 * This function can fail if the handle does not represent an open interface or
iap10@3443 74 * if there were problems closing the interface.
iap10@3443 75 *
iap10@3443 76 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 77 * @return 0 on success, -1 otherwise.
iap10@3443 78 */
mjw@1623 79 int xc_interface_close(int xc_handle);
mjw@1623 80
kaf24@3961 81 /*
kaf24@4719 82 * DOMAIN DEBUGGING FUNCTIONS
kaf24@4719 83 */
kaf24@4719 84
kaf24@4719 85 typedef struct xc_core_header {
kaf24@4719 86 unsigned int xch_magic;
kaf24@4719 87 unsigned int xch_nr_vcpus;
kaf24@4719 88 unsigned int xch_nr_pages;
kaf24@4719 89 unsigned int xch_ctxt_offset;
kaf24@4719 90 unsigned int xch_index_offset;
kaf24@4719 91 unsigned int xch_pages_offset;
kaf24@4719 92 } xc_core_header_t;
kaf24@4719 93
kaf24@4719 94
kaf24@6941 95 long xc_ptrace(
kaf24@6941 96 int xc_handle,
kaf24@6941 97 enum __ptrace_request request,
kaf24@7339 98 uint32_t domid,
kaf24@6941 99 long addr,
kaf24@6941 100 long data);
kaf24@4719 101
kaf24@6941 102 long xc_ptrace_core(
kaf24@6941 103 int xc_handle,
kaf24@6941 104 enum __ptrace_request request,
kaf24@7339 105 uint32_t domid,
kaf24@6941 106 long addr,
kaf24@6941 107 long data);
kaf24@4719 108
kaf24@6941 109 int xc_waitdomain(
kaf24@6941 110 int xc_handle,
kaf24@6941 111 int domain,
kaf24@6941 112 int *status,
kaf24@6941 113 int options);
kaf24@4719 114
kaf24@6941 115 int xc_waitdomain_core(
kaf24@6941 116 int xc_handle,
kaf24@6941 117 int domain,
kaf24@6941 118 int *status,
kaf24@6941 119 int options);
kaf24@4719 120
kaf24@4719 121 /*
iap10@3443 122 * DOMAIN MANAGEMENT FUNCTIONS
kaf24@3961 123 */
iap10@3443 124
mjw@1623 125 typedef struct {
kaf24@7378 126 uint32_t domid;
kaf24@7378 127 uint32_t ssidref;
mjw@1623 128 unsigned int dying:1, crashed:1, shutdown:1,
mjw@1623 129 paused:1, blocked:1, running:1;
mjw@1623 130 unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
mjw@1623 131 unsigned long nr_pages;
mjw@1623 132 unsigned long shared_info_frame;
kaf24@7378 133 uint64_t cpu_time;
mjw@1623 134 unsigned long max_memkb;
cl349@4853 135 unsigned int vcpus;
kaf24@7378 136 xen_domain_handle_t handle;
mjw@1623 137 } xc_dominfo_t;
mjw@1623 138
kaf24@2787 139 typedef dom0_getdomaininfo_t xc_domaininfo_t;
mjw@1623 140 int xc_domain_create(int xc_handle,
kaf24@7339 141 uint32_t ssidref,
kaf24@7378 142 xen_domain_handle_t handle,
kaf24@7339 143 uint32_t *pdomid);
iap10@3443 144
kaf24@4719 145
kaf24@4719 146 int xc_domain_dumpcore(int xc_handle,
kaf24@7339 147 uint32_t domid,
cl349@4853 148 const char *corename);
kaf24@4719 149
kaf24@7354 150 /*
kaf24@7354 151 * This function sets the maximum number vcpus that a domian may create.
kaf24@7354 152 *
kaf24@7354 153 * @parm xc_handle a handle to an open hypervisor interface.
kaf24@7354 154 * @parm domid the domain id in which vcpus are to be created.
kaf24@7354 155 * @parm max the maximum number of vcpus that the domain may create.
kaf24@7354 156 * @return 0 on success, -1 on failure.
kaf24@7354 157 */
kaf24@7354 158 int xc_domain_max_vcpus(int xc_handle,
kaf24@7354 159 uint32_t domid,
kaf24@7354 160 unsigned int max);
kaf24@4719 161
iap10@3443 162 /**
iap10@3443 163 * This function pauses a domain. A paused domain still exists in memory
iap10@3443 164 * however it does not receive any timeslices from the hypervisor.
iap10@3443 165 *
iap10@3443 166 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 167 * @parm domid the domain id to pause
iap10@3443 168 * @return 0 on success, -1 on failure.
iap10@3443 169 */
mjw@1623 170 int xc_domain_pause(int xc_handle,
kaf24@7339 171 uint32_t domid);
iap10@3443 172 /**
iap10@3443 173 * This function unpauses a domain. The domain should have been previously
iap10@3443 174 * paused.
iap10@3443 175 *
iap10@3443 176 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 177 * @parm domid the domain id to unpause
iap10@3443 178 * return 0 on success, -1 on failure
iap10@3443 179 */
mjw@1623 180 int xc_domain_unpause(int xc_handle,
kaf24@7339 181 uint32_t domid);
iap10@3443 182
iap10@3443 183 /**
iap10@3443 184 * This function will destroy a domain. Destroying a domain removes the domain
iap10@3443 185 * completely from memory. This function should be called after sending the
iap10@3443 186 * domain a SHUTDOWN control message to free up the domain resources.
iap10@3443 187 *
iap10@3443 188 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 189 * @parm domid the domain id to destroy
iap10@3443 190 * @return 0 on success, -1 on failure
iap10@3443 191 */
mjw@1623 192 int xc_domain_destroy(int xc_handle,
kaf24@7339 193 uint32_t domid);
mjw@1623 194 int xc_domain_pincpu(int xc_handle,
kaf24@7339 195 uint32_t domid,
cl349@4845 196 int vcpu,
kaf24@7378 197 cpumap_t cpumap);
kaf24@7378 198
iap10@3443 199 /**
dsteklof@5498 200 * This function will return information about one or more domains. It is
dsteklof@5498 201 * designed to iterate over the list of domains. If a single domain is
dsteklof@5498 202 * requested, this function will return the next domain in the list - if
dsteklof@5498 203 * one exists. It is, therefore, important in this case to make sure the
dsteklof@5498 204 * domain requested was the one returned.
iap10@3443 205 *
iap10@3443 206 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 207 * @parm first_domid the first domain to enumerate information from. Domains
iap10@3443 208 * are currently enumerate in order of creation.
iap10@3443 209 * @parm max_doms the number of elements in info
iap10@3443 210 * @parm info an array of max_doms size that will contain the information for
iap10@3443 211 * the enumerated domains.
iap10@3443 212 * @return the number of domains enumerated or -1 on error
iap10@3443 213 */
mjw@1623 214 int xc_domain_getinfo(int xc_handle,
kaf24@7339 215 uint32_t first_domid,
mjw@1623 216 unsigned int max_doms,
mjw@1623 217 xc_dominfo_t *info);
iap10@3443 218
iap10@3443 219 /**
kaf24@5699 220 * This function will return information about one or more domains, using a
kaf24@5699 221 * single hypercall. The domain information will be stored into the supplied
kaf24@5699 222 * array of xc_domaininfo_t structures.
kaf24@5699 223 *
kaf24@5699 224 * @parm xc_handle a handle to an open hypervisor interface
kaf24@5699 225 * @parm first_domain the first domain to enumerate information from.
kaf24@5699 226 * Domains are currently enumerate in order of creation.
kaf24@5699 227 * @parm max_domains the number of elements in info
kaf24@5699 228 * @parm info an array of max_doms size that will contain the information for
kaf24@5699 229 * the enumerated domains.
kaf24@5699 230 * @return the number of domains enumerated or -1 on error
kaf24@5699 231 */
kaf24@5699 232 int xc_domain_getinfolist(int xc_handle,
kaf24@7339 233 uint32_t first_domain,
kaf24@5699 234 unsigned int max_domains,
kaf24@5699 235 xc_domaininfo_t *info);
kaf24@5699 236
kaf24@5699 237 /**
iap10@3443 238 * This function returns information about one domain. This information is
iap10@3443 239 * more detailed than the information from xc_domain_getinfo().
iap10@3443 240 *
iap10@3443 241 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 242 * @parm domid the domain to get information from
iap10@3443 243 * @parm info a pointer to an xc_domaininfo_t to store the domain information
iap10@3443 244 * @parm ctxt a pointer to a structure to store the execution context of the
iap10@3443 245 * domain
iap10@3443 246 * @return 0 on success, -1 on failure
iap10@3443 247 */
cl349@4849 248 int xc_domain_get_vcpu_context(int xc_handle,
kaf24@7339 249 uint32_t domid,
kaf24@7339 250 uint32_t vcpu,
cl349@4853 251 vcpu_guest_context_t *ctxt);
cl349@4849 252
gm281@2236 253 int xc_domain_setcpuweight(int xc_handle,
kaf24@7339 254 uint32_t domid,
gm281@2236 255 float weight);
kaf24@2787 256 long long xc_domain_get_cpu_usage(int xc_handle,
mafetter@3435 257 domid_t domid,
mafetter@3435 258 int vcpu);
mjw@1623 259
kaf24@7379 260 int xc_domain_sethandle(int xc_handle, uint32_t domid,
kaf24@7379 261 xen_domain_handle_t handle);
kaf24@2787 262
kaf24@2787 263 typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
mjw@1623 264 int xc_shadow_control(int xc_handle,
kaf24@7339 265 uint32_t domid,
mjw@1623 266 unsigned int sop,
mjw@1623 267 unsigned long *dirty_bitmap,
mjw@1623 268 unsigned long pages,
mjw@1623 269 xc_shadow_control_stats_t *stats);
mjw@1623 270
mjw@1623 271 int xc_bvtsched_global_set(int xc_handle,
mjw@1623 272 unsigned long ctx_allow);
mjw@1623 273
mjw@1623 274 int xc_bvtsched_domain_set(int xc_handle,
kaf24@7339 275 uint32_t domid,
kaf24@7339 276 uint32_t mcuadv,
gm281@2058 277 int warpback,
kaf24@7339 278 int32_t warpvalue,
gm281@2058 279 long long warpl,
gm281@2058 280 long long warpu);
mjw@1623 281
mjw@1623 282 int xc_bvtsched_global_get(int xc_handle,
mjw@1623 283 unsigned long *ctx_allow);
mjw@1623 284
mjw@1623 285 int xc_bvtsched_domain_get(int xc_handle,
kaf24@7339 286 uint32_t domid,
kaf24@7339 287 uint32_t *mcuadv,
gm281@2058 288 int *warpback,
kaf24@7339 289 int32_t *warpvalue,
gm281@2058 290 long long *warpl,
gm281@2058 291 long long *warpu);
mjw@1623 292
sd386@3449 293 int xc_sedf_domain_set(int xc_handle,
kaf24@7339 294 uint32_t domid,
kaf24@7339 295 uint64_t period, uint64_t slice,
kaf24@7339 296 uint64_t latency, uint16_t extratime,
kaf24@7339 297 uint16_t weight);
sd386@3449 298
sd386@3449 299 int xc_sedf_domain_get(int xc_handle,
kaf24@7339 300 uint32_t domid,
kaf24@7339 301 uint64_t* period, uint64_t *slice,
kaf24@7339 302 uint64_t *latency, uint16_t *extratime,
kaf24@7339 303 uint16_t *weight);
sd386@3449 304
kaf24@2787 305 typedef evtchn_status_t xc_evtchn_status_t;
iap10@3443 306
kaf24@3961 307 /*
iap10@3443 308 * EVENT CHANNEL FUNCTIONS
kaf24@3961 309 */
iap10@3443 310
iap10@3443 311 /**
iap10@3443 312 * This function allocates an unbound port. Ports are named endpoints used for
iap10@3443 313 * interdomain communication. This function is most useful in opening a
iap10@3443 314 * well-known port within a domain to receive events on.
iap10@3443 315 *
iap10@3443 316 * @parm xc_handle a handle to an open hypervisor interface
kaf24@7223 317 * @parm dom the ID of the local domain (the 'allocatee')
kaf24@7237 318 * @parm remote_dom the ID of the domain who will later bind
kaf24@7237 319 * @return allocated port (in @dom) on success, -1 on failure
iap10@3443 320 */
kaf24@2713 321 int xc_evtchn_alloc_unbound(int xc_handle,
kaf24@7339 322 uint32_t dom,
kaf24@7339 323 uint32_t remote_dom);
iap10@3443 324
mjw@1623 325 int xc_evtchn_status(int xc_handle,
kaf24@7339 326 uint32_t dom, /* may be DOMID_SELF */
mjw@1623 327 int port,
mjw@1623 328 xc_evtchn_status_t *status);
mjw@1623 329
mjw@1623 330 int xc_physdev_pci_access_modify(int xc_handle,
kaf24@7339 331 uint32_t domid,
mjw@1623 332 int bus,
mjw@1623 333 int dev,
mjw@1623 334 int func,
mjw@1623 335 int enable);
mjw@1623 336
mjw@1623 337 int xc_readconsolering(int xc_handle,
kaf24@5327 338 char **pbuffer,
kaf24@5327 339 unsigned int *pnr_chars,
mjw@1623 340 int clear);
mjw@1623 341
kaf24@2787 342 typedef dom0_physinfo_t xc_physinfo_t;
mjw@1623 343 int xc_physinfo(int xc_handle,
mjw@1623 344 xc_physinfo_t *info);
mjw@1623 345
gm281@2236 346 int xc_sched_id(int xc_handle,
gm281@2236 347 int *sched_id);
gm281@2236 348
mjw@1623 349 int xc_domain_setmaxmem(int xc_handle,
kaf24@7339 350 uint32_t domid,
kaf24@3231 351 unsigned int max_memkb);
mjw@1623 352
cl349@5045 353 int xc_domain_memory_increase_reservation(int xc_handle,
kaf24@7339 354 uint32_t domid,
iap10@6688 355 unsigned long nr_extents,
iap10@6682 356 unsigned int extent_order,
iap10@6688 357 unsigned int address_bits,
iap10@6688 358 unsigned long *extent_start);
iap10@6688 359
iap10@6688 360 int xc_domain_memory_decrease_reservation(int xc_handle,
kaf24@7339 361 uint32_t domid,
iap10@6688 362 unsigned long nr_extents,
iap10@6688 363 unsigned int extent_order,
iap10@6688 364 unsigned long *extent_start);
iap10@6688 365
kaf24@7339 366 unsigned long xc_make_page_below_4G(int xc_handle, uint32_t domid,
iap10@6688 367 unsigned long mfn);
cl349@5045 368
kaf24@3231 369 typedef dom0_perfc_desc_t xc_perfc_desc_t;
kaf24@3231 370 /* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
kaf24@3231 371 int xc_perfc_control(int xc_handle,
kaf24@7339 372 uint32_t op,
kaf24@3231 373 xc_perfc_desc_t *desc);
mjw@1623 374
rneugeba@3963 375 /* read/write msr */
rneugeba@3963 376 long long xc_msr_read(int xc_handle, int cpu_mask, int msr);
rneugeba@3963 377 int xc_msr_write(int xc_handle, int cpu_mask, int msr, unsigned int low,
rneugeba@3963 378 unsigned int high);
rneugeba@3963 379
iap10@3443 380 /**
iap10@3443 381 * Memory maps a range within one domain to a local address range. Mappings
iap10@3443 382 * should be unmapped with munmap and should follow the same rules as mmap
rusty@4866 383 * regarding page alignment. Returns NULL on failure.
iap10@3443 384 *
iap10@3443 385 * In Linux, the ring queue for the control channel is accessible by mapping
iap10@3443 386 * the shared_info_frame (from xc_domain_getinfo()) + 2048. The structure
iap10@3443 387 * stored there is of type control_if_t.
iap10@3443 388 *
iap10@3443 389 * @parm xc_handle a handle on an open hypervisor interface
iap10@3443 390 * @parm dom the domain to map memory from
iap10@3443 391 * @parm size the amount of memory to map (in multiples of page size)
iap10@3443 392 * @parm prot same flag as in mmap().
iap10@3443 393 * @parm mfn the frame address to map.
iap10@3443 394 */
kaf24@7339 395 void *xc_map_foreign_range(int xc_handle, uint32_t dom,
iap10@2325 396 int size, int prot,
iap10@2325 397 unsigned long mfn );
iap10@2325 398
kaf24@7339 399 void *xc_map_foreign_batch(int xc_handle, uint32_t dom, int prot,
iap10@2325 400 unsigned long *arr, int num );
iap10@2325 401
kaf24@7339 402 int xc_get_pfn_list(int xc_handle, uint32_t domid, unsigned long *pfn_buf,
cl349@4853 403 unsigned long max_pfns);
iap10@3390 404
kaf24@7339 405 int xc_ia64_get_pfn_list(int xc_handle, uint32_t domid,
kaf24@7339 406 unsigned long *pfn_buf,
kaf24@7339 407 unsigned int start_page, unsigned int nr_pages);
kaf24@5914 408
kaf24@7339 409 long xc_get_max_pages(int xc_handle, uint32_t domid);
djm@6856 410
cl349@6389 411 int xc_mmuext_op(int xc_handle, struct mmuext_op *op, unsigned int nr_ops,
cl349@6389 412 domid_t dom);
cl349@6389 413
kaf24@6468 414 int xc_memory_op(int xc_handle, int cmd, void *arg);
cl349@6389 415
kaf24@7339 416 int xc_get_pfn_type_batch(int xc_handle, uint32_t dom,
kaf24@7339 417 int num, unsigned long *arr);
cl349@6389 418
cl349@6389 419
cwc22@3985 420 /*\
cwc22@3985 421 * GRANT TABLE FUNCTIONS
cwc22@3985 422 \*/
cwc22@3985 423
cwc22@3985 424 /**
cwc22@3985 425 * This function opens a handle to the more restricted grant table hypervisor
cwc22@3985 426 * interface. This may be used where the standard interface is not
cwc22@3985 427 * available because the domain is not privileged.
cwc22@3985 428 * This function can be called multiple times within a single process.
cwc22@3985 429 * Multiple processes can have an open hypervisor interface at the same time.
cwc22@3985 430 *
cwc22@3985 431 * Each call to this function should have a corresponding call to
cwc22@3985 432 * xc_grant_interface_close().
cwc22@3985 433 *
cwc22@3985 434 * This function can fail if a Xen-enabled kernel is not currently running.
cwc22@3985 435 *
cwc22@3985 436 * @return a handle to the hypervisor grant table interface or -1 on failure
cwc22@3985 437 */
cwc22@3985 438 int xc_grant_interface_open(void);
cwc22@3985 439
cwc22@3985 440 /**
cwc22@3985 441 * This function closes an open grant table hypervisor interface.
cwc22@3985 442 *
cwc22@3985 443 * This function can fail if the handle does not represent an open interface or
cwc22@3985 444 * if there were problems closing the interface.
cwc22@3985 445 *
cwc22@3985 446 * @parm xc_handle a handle to an open grant table hypervisor interface
cwc22@3985 447 * @return 0 on success, -1 otherwise.
cwc22@3985 448 */
cwc22@3985 449 int xc_grant_interface_close(int xc_handle);
cwc22@3985 450
kaf24@7339 451 int xc_gnttab_map_grant_ref(int xc_handle,
kaf24@7339 452 uint64_t host_virt_addr,
kaf24@7339 453 uint32_t dom,
kaf24@7339 454 uint16_t ref,
kaf24@7339 455 uint16_t flags,
kaf24@7339 456 int16_t *handle,
kaf24@7339 457 uint64_t *dev_bus_addr);
cwc22@3985 458
kaf24@6281 459 int xc_gnttab_unmap_grant_ref(int xc_handle,
kaf24@7339 460 uint64_t host_virt_addr,
kaf24@7339 461 uint64_t dev_bus_addr,
kaf24@7339 462 uint16_t handle,
kaf24@7339 463 int16_t *status);
cwc22@3985 464
cwc22@3985 465 int xc_gnttab_setup_table(int xc_handle,
kaf24@7339 466 uint32_t dom,
kaf24@7339 467 uint16_t nr_frames,
kaf24@7339 468 int16_t *status,
kaf24@6281 469 unsigned long **frame_list);
cwc22@3985 470
cwc22@3985 471 /* Grant debug builds only: */
cwc22@3985 472 int xc_gnttab_dump_table(int xc_handle,
kaf24@7339 473 uint32_t dom,
kaf24@7339 474 int16_t *status);
cwc22@3985 475
kaf24@5318 476 /* Get current total pages allocated to a domain. */
kaf24@7339 477 long xc_get_tot_pages(int xc_handle, uint32_t domid);
kaf24@5318 478
kaf24@5318 479 /* Execute a privileged dom0 operation. */
kaf24@5318 480 int xc_dom0_op(int xc_handle, dom0_op_t *op);
cwc22@3985 481
vh249@6549 482 int xc_version(int xc_handle, int cmd, void *arg);
vh249@6549 483
cl349@5748 484 /* Initializes the store (for dom0)
cl349@5748 485 remote_port should be the remote end of a bound interdomain channel between
cl349@5748 486 the store and dom0.
cl349@5748 487
cl349@5748 488 This function returns a shared frame that should be passed to
cl349@5748 489 xs_introduce_domain
cl349@5748 490 */
cl349@5748 491 long xc_init_store(int xc_handle, int remote_port);
cl349@5748 492
cl349@6389 493 /*
cl349@6389 494 * MMU updates.
cl349@6389 495 */
cl349@6389 496 #define MAX_MMU_UPDATES 1024
cl349@6389 497 struct xc_mmu {
cl349@6389 498 mmu_update_t updates[MAX_MMU_UPDATES];
cl349@6389 499 int idx;
cl349@6389 500 domid_t subject;
cl349@6389 501 };
cl349@6389 502 typedef struct xc_mmu xc_mmu_t;
cl349@6389 503 xc_mmu_t *xc_init_mmu_updates(int xc_handle, domid_t dom);
cl349@6389 504 int xc_add_mmu_update(int xc_handle, xc_mmu_t *mmu,
iap10@6680 505 unsigned long long ptr, unsigned long long val);
cl349@6389 506 int xc_finish_mmu_updates(int xc_handle, xc_mmu_t *mmu);
cl349@6389 507
cl349@6389 508 #endif