direct-io.hg

annotate tools/libxc/xc.h @ 4849:a68686aaebc3

bitkeeper revision 1.1389.15.13 (42821f23dLMLc5Ql8Y-rUwoatYBI6g)

Split out context fetching into separate DOM0 op
make GETDOMAININFO a little more sensible with respect to MP
make coredump dump all cpu contexts
Signed-off-by: Kip Macy <kmacy@netapp.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk[cl349]
date Wed May 11 15:05:07 2005 +0000 (2005-05-11)
parents e70ba984a87f
children b78b16c06b85
rev   line source
mjw@1623 1 /******************************************************************************
mjw@1623 2 * xc.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
mjw@1623 9 #ifndef __XC_H__
mjw@1623 10 #define __XC_H__
mjw@1623 11
kaf24@3266 12 #include <stdint.h>
iap10@3390 13
kaf24@3266 14 typedef uint8_t u8;
kaf24@3266 15 typedef uint16_t u16;
kaf24@3266 16 typedef uint32_t u32;
kaf24@3266 17 typedef uint64_t u64;
kaf24@3266 18 typedef int8_t s8;
kaf24@3266 19 typedef int16_t s16;
kaf24@3266 20 typedef int32_t s32;
kaf24@3266 21 typedef int64_t s64;
mjw@1623 22
kaf24@4719 23 #include <sys/ptrace.h>
kaf24@2821 24 #include <xen/xen.h>
kaf24@2821 25 #include <xen/dom0_ops.h>
kaf24@2821 26 #include <xen/event_channel.h>
kaf24@2821 27 #include <xen/sched_ctl.h>
kaf24@2787 28
kaf24@3961 29 /*
kaf24@3961 30 * DEFINITIONS FOR CPU BARRIERS
kaf24@3961 31 */
kaf24@3961 32
kaf24@3961 33 #if defined(__i386__)
kaf24@3966 34 #define mb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
kaf24@3966 35 #define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
kaf24@3966 36 #define wmb() __asm__ __volatile__ ( "" : : : "memory")
kaf24@3961 37 #elif defined(__x86_64__)
kaf24@3966 38 #define mb() __asm__ __volatile__ ( "mfence" : : : "memory")
kaf24@3966 39 #define rmb() __asm__ __volatile__ ( "lfence" : : : "memory")
kaf24@3966 40 #define wmb() __asm__ __volatile__ ( "" : : : "memory")
kaf24@3961 41 #else
kaf24@3961 42 #error "Define barriers"
kaf24@3961 43 #endif
kaf24@3961 44
kaf24@3961 45 /*
iap10@3443 46 * INITIALIZATION FUNCTIONS
kaf24@3961 47 */
iap10@3443 48
iap10@3443 49 /**
iap10@3443 50 * This function opens a handle to the hypervisor interface. This function can
iap10@3443 51 * be called multiple times within a single process. Multiple processes can
iap10@3443 52 * have an open hypervisor interface at the same time.
iap10@3443 53 *
iap10@3443 54 * Each call to this function should have a corresponding call to
iap10@3443 55 * xc_interface_close().
iap10@3443 56 *
iap10@3443 57 * This function can fail if the caller does not have superuser permission or
iap10@3443 58 * if a Xen-enabled kernel is not currently running.
iap10@3443 59 *
iap10@3443 60 * @return a handle to the hypervisor interface or -1 on failure
iap10@3443 61 */
mjw@1623 62 int xc_interface_open(void);
iap10@3443 63
iap10@3443 64 /**
iap10@3443 65 * This function closes an open hypervisor interface.
iap10@3443 66 *
iap10@3443 67 * This function can fail if the handle does not represent an open interface or
iap10@3443 68 * if there were problems closing the interface.
iap10@3443 69 *
iap10@3443 70 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 71 * @return 0 on success, -1 otherwise.
iap10@3443 72 */
mjw@1623 73 int xc_interface_close(int xc_handle);
mjw@1623 74
kaf24@3961 75 /*
kaf24@4719 76 * DOMAIN DEBUGGING FUNCTIONS
kaf24@4719 77 */
kaf24@4719 78
kaf24@4719 79 typedef struct xc_core_header {
kaf24@4719 80 unsigned int xch_magic;
kaf24@4719 81 unsigned int xch_nr_vcpus;
kaf24@4719 82 unsigned int xch_nr_pages;
kaf24@4719 83 unsigned int xch_ctxt_offset;
kaf24@4719 84 unsigned int xch_index_offset;
kaf24@4719 85 unsigned int xch_pages_offset;
kaf24@4719 86 } xc_core_header_t;
kaf24@4719 87
kaf24@4719 88
kaf24@4719 89 long xc_ptrace(enum __ptrace_request request,
kaf24@4726 90 u32 domid,
kaf24@4719 91 long addr,
kaf24@4719 92 long data);
kaf24@4719 93
kaf24@4719 94 long xc_ptrace_core(enum __ptrace_request request,
kaf24@4726 95 u32 domid,
kaf24@4719 96 long addr,
kaf24@4719 97 long data);
kaf24@4719 98
kaf24@4719 99 int xc_waitdomain(int domain,
kaf24@4719 100 int *status,
kaf24@4719 101 int options);
kaf24@4719 102
kaf24@4719 103 int xc_waitdomain_core(int domain,
kaf24@4719 104 int *status,
kaf24@4719 105 int options);
kaf24@4719 106
kaf24@4719 107 /*
iap10@3443 108 * DOMAIN MANAGEMENT FUNCTIONS
kaf24@3961 109 */
iap10@3443 110
mjw@1623 111 typedef struct {
mjw@1623 112 u32 domid;
cl349@4849 113 unsigned int flags;
cl349@4849 114 unsigned int processors;
cl349@4845 115 unsigned int vcpus;
cl349@4849 116 u16 n_vcpus;
mjw@1623 117 unsigned int dying:1, crashed:1, shutdown:1,
mjw@1623 118 paused:1, blocked:1, running:1;
mjw@1623 119 unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
mjw@1623 120 unsigned long nr_pages;
mjw@1623 121 unsigned long shared_info_frame;
mjw@1623 122 u64 cpu_time;
mjw@1623 123 unsigned long max_memkb;
cl349@4847 124 s32 vcpu_to_cpu[MAX_VIRT_CPUS];
cl349@4845 125 cpumap_t cpumap[MAX_VIRT_CPUS];
mjw@1623 126 } xc_dominfo_t;
mjw@1623 127
kaf24@2787 128 typedef dom0_getdomaininfo_t xc_domaininfo_t;
mjw@1623 129 int xc_domain_create(int xc_handle,
mjw@1623 130 unsigned int mem_kb,
mjw@1623 131 int cpu,
gm281@2236 132 float cpu_weight,
mjw@1623 133 u32 *pdomid);
iap10@3443 134
kaf24@4719 135
kaf24@4719 136 int xc_domain_dumpcore(int xc_handle,
kaf24@4719 137 u32 domid,
kaf24@4719 138 const char *corename);
kaf24@4719 139
kaf24@4719 140
iap10@3443 141 /**
iap10@3443 142 * This function pauses a domain. A paused domain still exists in memory
iap10@3443 143 * however it does not receive any timeslices from the hypervisor.
iap10@3443 144 *
iap10@3443 145 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 146 * @parm domid the domain id to pause
iap10@3443 147 * @return 0 on success, -1 on failure.
iap10@3443 148 */
mjw@1623 149 int xc_domain_pause(int xc_handle,
mjw@1623 150 u32 domid);
iap10@3443 151 /**
iap10@3443 152 * This function unpauses a domain. The domain should have been previously
iap10@3443 153 * paused.
iap10@3443 154 *
iap10@3443 155 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 156 * @parm domid the domain id to unpause
iap10@3443 157 * return 0 on success, -1 on failure
iap10@3443 158 */
mjw@1623 159 int xc_domain_unpause(int xc_handle,
mjw@1623 160 u32 domid);
iap10@3443 161
iap10@3443 162 /**
iap10@3443 163 * This function will destroy a domain. Destroying a domain removes the domain
iap10@3443 164 * completely from memory. This function should be called after sending the
iap10@3443 165 * domain a SHUTDOWN control message to free up the domain resources.
iap10@3443 166 *
iap10@3443 167 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 168 * @parm domid the domain id to destroy
iap10@3443 169 * @return 0 on success, -1 on failure
iap10@3443 170 */
mjw@1623 171 int xc_domain_destroy(int xc_handle,
mjw@1623 172 u32 domid);
mjw@1623 173 int xc_domain_pincpu(int xc_handle,
mjw@1623 174 u32 domid,
cl349@4845 175 int vcpu,
cl349@4845 176 cpumap_t *cpumap);
iap10@3443 177 /**
iap10@3443 178 * This function will return information about one or more domains.
iap10@3443 179 *
iap10@3443 180 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 181 * @parm first_domid the first domain to enumerate information from. Domains
iap10@3443 182 * are currently enumerate in order of creation.
iap10@3443 183 * @parm max_doms the number of elements in info
iap10@3443 184 * @parm info an array of max_doms size that will contain the information for
iap10@3443 185 * the enumerated domains.
iap10@3443 186 * @return the number of domains enumerated or -1 on error
iap10@3443 187 */
mjw@1623 188 int xc_domain_getinfo(int xc_handle,
mjw@1623 189 u32 first_domid,
mjw@1623 190 unsigned int max_doms,
mjw@1623 191 xc_dominfo_t *info);
iap10@3443 192
iap10@3443 193 /**
iap10@3443 194 * This function returns information about one domain. This information is
iap10@3443 195 * more detailed than the information from xc_domain_getinfo().
iap10@3443 196 *
iap10@3443 197 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 198 * @parm domid the domain to get information from
iap10@3443 199 * @parm info a pointer to an xc_domaininfo_t to store the domain information
iap10@3443 200 * @parm ctxt a pointer to a structure to store the execution context of the
iap10@3443 201 * domain
iap10@3443 202 * @return 0 on success, -1 on failure
iap10@3443 203 */
cl349@4849 204 int xc_domain_get_vcpu_context(int xc_handle,
cl349@4849 205 u32 domid,
cl349@4849 206 u32 vcpu,
cl349@4849 207 vcpu_guest_context_t *ctxt);
cl349@4849 208
gm281@2236 209 int xc_domain_setcpuweight(int xc_handle,
gm281@2236 210 u32 domid,
gm281@2236 211 float weight);
kaf24@2787 212 long long xc_domain_get_cpu_usage(int xc_handle,
mafetter@3435 213 domid_t domid,
mafetter@3435 214 int vcpu);
mjw@1623 215
kaf24@2787 216
kaf24@2787 217 typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
mjw@1623 218 int xc_shadow_control(int xc_handle,
mjw@1623 219 u32 domid,
mjw@1623 220 unsigned int sop,
mjw@1623 221 unsigned long *dirty_bitmap,
mjw@1623 222 unsigned long pages,
mjw@1623 223 xc_shadow_control_stats_t *stats);
mjw@1623 224
mjw@1623 225
mjw@2574 226 #define XCFLAGS_VERBOSE 1
mjw@2574 227 #define XCFLAGS_LIVE 2
mjw@2574 228 #define XCFLAGS_DEBUG 4
mjw@2574 229 #define XCFLAGS_CONFIGURE 8
mjw@1623 230
mjw@1623 231 struct XcIOContext;
iap10@3443 232
iap10@3443 233 /**
iap10@3443 234 * This function will save a domain running Linux to an IO context. This
iap10@3443 235 * IO context is currently a private interface making this function difficult
iap10@3443 236 * to call. It's interface will likely change in the future.
iap10@3443 237 *
iap10@3443 238 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 239 * @parm ioctxt the IO context to save a domain to
iap10@3443 240 * @return 0 on success, -1 on failure
iap10@3443 241 */
mjw@1623 242 int xc_linux_save(int xc_handle, struct XcIOContext *ioctxt);
iap10@3443 243
iap10@3443 244 /**
iap10@3443 245 * This function will restore a saved domain running Linux to an IO context.
iap10@3443 246 * Like xc_linux_save(), this function uses a parameter who's structure is
iap10@3443 247 * privately defined. It's interface will also likely change.
iap10@3443 248 *
iap10@3443 249 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 250 * @parm ioctxt the IO context to restore a domain from
iap10@3443 251 * @return 0 on success, -1 on failure
iap10@3443 252 */
mjw@1623 253 int xc_linux_restore(int xc_handle, struct XcIOContext *ioctxt);
mjw@1623 254
mjw@1623 255 int xc_linux_build(int xc_handle,
mjw@1623 256 u32 domid,
mjw@1623 257 const char *image_name,
mjw@1623 258 const char *ramdisk_name,
mjw@1623 259 const char *cmdline,
mjw@1623 260 unsigned int control_evtchn,
cl349@3451 261 unsigned long flags,
cl349@3451 262 unsigned int vcpus);
mjw@1623 263
iap10@3326 264 int
iap10@3326 265 xc_plan9_build (int xc_handle,
iap10@3326 266 u32 domid,
iap10@3326 267 const char *image_name,
iap10@3326 268 const char *cmdline,
iap10@3326 269 unsigned int control_evtchn,
iap10@3326 270 unsigned long flags);
iap10@3326 271
kaf24@3420 272 struct mem_map;
iap10@3390 273 int xc_vmx_build(int xc_handle,
iap10@3390 274 u32 domid,
iap10@3605 275 int memsize,
iap10@3390 276 const char *image_name,
iap10@3390 277 struct mem_map *memmap,
iap10@3390 278 const char *ramdisk_name,
iap10@3390 279 const char *cmdline,
iap10@3390 280 unsigned int control_evtchn,
iap10@3390 281 unsigned long flags);
iap10@3390 282
mjw@1623 283 int xc_bvtsched_global_set(int xc_handle,
mjw@1623 284 unsigned long ctx_allow);
mjw@1623 285
mjw@1623 286 int xc_bvtsched_domain_set(int xc_handle,
mjw@1623 287 u32 domid,
gm281@2058 288 u32 mcuadv,
gm281@2058 289 int warpback,
gm281@2058 290 s32 warpvalue,
gm281@2058 291 long long warpl,
gm281@2058 292 long long warpu);
mjw@1623 293
mjw@1623 294 int xc_bvtsched_global_get(int xc_handle,
mjw@1623 295 unsigned long *ctx_allow);
mjw@1623 296
mjw@1623 297 int xc_bvtsched_domain_get(int xc_handle,
mjw@1623 298 u32 domid,
gm281@2058 299 u32 *mcuadv,
gm281@2058 300 int *warpback,
gm281@2058 301 s32 *warpvalue,
gm281@2058 302 long long *warpl,
gm281@2058 303 long long *warpu);
mjw@1623 304
sd386@3449 305 int xc_sedf_domain_set(int xc_handle,
sd386@3449 306 u32 domid,
sd386@3573 307 u64 period, u64 slice, u64 latency, u16 extratime, u16 weight);
sd386@3449 308
sd386@3449 309 int xc_sedf_domain_get(int xc_handle,
sd386@3449 310 u32 domid,
sd386@3573 311 u64* period, u64 *slice, u64 *latency, u16 *extratime, u16* weight);
sd386@3449 312
kaf24@2787 313 typedef evtchn_status_t xc_evtchn_status_t;
iap10@3443 314
kaf24@3961 315 /*
iap10@3443 316 * EVENT CHANNEL FUNCTIONS
kaf24@3961 317 */
iap10@3443 318
iap10@3443 319 /**
iap10@3443 320 * This function allocates an unbound port. Ports are named endpoints used for
iap10@3443 321 * interdomain communication. This function is most useful in opening a
iap10@3443 322 * well-known port within a domain to receive events on.
iap10@3443 323 *
iap10@3443 324 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 325 * @parm dom the ID of the domain. This maybe DOMID_SELF
iap10@3443 326 * @parm port a pointer to a port. This is an in/out parameter. If *port is
iap10@3443 327 * 0, then a new port will be assigned, if port is > 0 then that
iap10@3443 328 * port is allocated if the port is unallocated.
iap10@3443 329 * @return 0 on success, -1 on failure
iap10@3443 330 */
kaf24@2713 331 int xc_evtchn_alloc_unbound(int xc_handle,
kaf24@2713 332 u32 dom,
kaf24@2713 333 int *port);
iap10@3443 334
iap10@3443 335 /**
iap10@3443 336 * This function creates a pair of ports between two domains. A port can only
iap10@3443 337 * be bound once within a domain.
iap10@3443 338 *
iap10@3443 339 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 340 * @parm dom1 one of the two domains to connect. Can be DOMID_SELF.
iap10@3443 341 * @parm dom2 the other domain to connect. Can be DOMID_SELF.
iap10@3443 342 * @parm port1 an in/out parameter. If > 0, then try to connect *port. If
iap10@3443 343 * 0, then allocate a new port and store the port in *port.
iap10@3443 344 * @parm port2 the port connected on port2. This parameter behaves the same
iap10@3443 345 * way as port1.
iap10@3443 346 * @return 0 on success, -1 on error.
iap10@3443 347 */
mjw@1623 348 int xc_evtchn_bind_interdomain(int xc_handle,
iap10@3443 349 u32 dom1,
iap10@3443 350 u32 dom2,
mjw@1623 351 int *port1,
mjw@1623 352 int *port2);
mjw@1623 353 int xc_evtchn_bind_virq(int xc_handle,
mjw@1623 354 int virq,
mjw@1623 355 int *port);
iap10@3443 356
iap10@3443 357 /**
iap10@3443 358 * This function will close a single port on an event channel.
iap10@3443 359 *
iap10@3443 360 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 361 * @parm dom the domain that the port exists on. May be DOMID_SELF.
iap10@3443 362 * @parm port the port to close
iap10@3443 363 * @return 0 on success, -1 on error
iap10@3443 364 */
mjw@1623 365 int xc_evtchn_close(int xc_handle,
mjw@1623 366 u32 dom, /* may be DOMID_SELF */
mjw@1623 367 int port);
iap10@3443 368
iap10@3443 369 /**
iap10@3443 370 * This function generates a notify event on a bound port.
iap10@3443 371 *
iap10@3443 372 * Notifies can be read within Linux by opening /dev/xen/evtchn and reading
iap10@3443 373 * a 16 bit value. The result will be the port the event occurred on. When
iap10@3443 374 * events occur, the port is masked until the 16 bit port value is written back
iap10@3443 375 * to the file. When /dev/xen/evtchn is opened, it has to be bound via an
iap10@3443 376 * ioctl to each port to listen on. The ioctl for binding is _IO('E', 2). The
iap10@3443 377 * parameter is the port to listen on.
iap10@3443 378 *
iap10@3443 379 * @parm xc_handle a handle to an open hypervisor interface
iap10@3443 380 * @parm local_port the port to generate the notify on
iap10@3443 381 * @return 0 on success, -1 on error
iap10@3443 382 */
mjw@1623 383 int xc_evtchn_send(int xc_handle,
mjw@1623 384 int local_port);
mjw@1623 385 int xc_evtchn_status(int xc_handle,
mjw@1623 386 u32 dom, /* may be DOMID_SELF */
mjw@1623 387 int port,
mjw@1623 388 xc_evtchn_status_t *status);
mjw@1623 389
mjw@1623 390 int xc_physdev_pci_access_modify(int xc_handle,
mjw@1623 391 u32 domid,
mjw@1623 392 int bus,
mjw@1623 393 int dev,
mjw@1623 394 int func,
mjw@1623 395 int enable);
mjw@1623 396
mjw@1623 397 int xc_readconsolering(int xc_handle,
mjw@1623 398 char *str,
mjw@1623 399 unsigned int max_chars,
mjw@1623 400 int clear);
mjw@1623 401
kaf24@2787 402 typedef dom0_physinfo_t xc_physinfo_t;
mjw@1623 403 int xc_physinfo(int xc_handle,
mjw@1623 404 xc_physinfo_t *info);
mjw@1623 405
gm281@2236 406 int xc_sched_id(int xc_handle,
gm281@2236 407 int *sched_id);
gm281@2236 408
mjw@1623 409 int xc_domain_setmaxmem(int xc_handle,
kaf24@3231 410 u32 domid,
kaf24@3231 411 unsigned int max_memkb);
mjw@1623 412
kaf24@3231 413 typedef dom0_perfc_desc_t xc_perfc_desc_t;
kaf24@3231 414 /* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
kaf24@3231 415 int xc_perfc_control(int xc_handle,
kaf24@3231 416 u32 op,
kaf24@3231 417 xc_perfc_desc_t *desc);
mjw@1623 418
rneugeba@3963 419 /* read/write msr */
rneugeba@3963 420 long long xc_msr_read(int xc_handle, int cpu_mask, int msr);
rneugeba@3963 421 int xc_msr_write(int xc_handle, int cpu_mask, int msr, unsigned int low,
rneugeba@3963 422 unsigned int high);
rneugeba@3963 423
iap10@3443 424 /**
iap10@3443 425 * Memory maps a range within one domain to a local address range. Mappings
iap10@3443 426 * should be unmapped with munmap and should follow the same rules as mmap
iap10@3443 427 * regarding page alignment.
iap10@3443 428 *
iap10@3443 429 * In Linux, the ring queue for the control channel is accessible by mapping
iap10@3443 430 * the shared_info_frame (from xc_domain_getinfo()) + 2048. The structure
iap10@3443 431 * stored there is of type control_if_t.
iap10@3443 432 *
iap10@3443 433 * @parm xc_handle a handle on an open hypervisor interface
iap10@3443 434 * @parm dom the domain to map memory from
iap10@3443 435 * @parm size the amount of memory to map (in multiples of page size)
iap10@3443 436 * @parm prot same flag as in mmap().
iap10@3443 437 * @parm mfn the frame address to map.
iap10@3443 438 */
iap10@2325 439 void *xc_map_foreign_range(int xc_handle, u32 dom,
iap10@2325 440 int size, int prot,
iap10@2325 441 unsigned long mfn );
iap10@2325 442
iap10@2325 443 void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
iap10@2325 444 unsigned long *arr, int num );
iap10@2325 445
iap10@3390 446 int xc_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf,
iap10@3390 447 unsigned long max_pfns);
iap10@3390 448
cwc22@3985 449 /*\
cwc22@3985 450 * GRANT TABLE FUNCTIONS
cwc22@3985 451 \*/
cwc22@3985 452
cwc22@3985 453 /**
cwc22@3985 454 * This function opens a handle to the more restricted grant table hypervisor
cwc22@3985 455 * interface. This may be used where the standard interface is not
cwc22@3985 456 * available because the domain is not privileged.
cwc22@3985 457 * This function can be called multiple times within a single process.
cwc22@3985 458 * Multiple processes can have an open hypervisor interface at the same time.
cwc22@3985 459 *
cwc22@3985 460 * Each call to this function should have a corresponding call to
cwc22@3985 461 * xc_grant_interface_close().
cwc22@3985 462 *
cwc22@3985 463 * This function can fail if a Xen-enabled kernel is not currently running.
cwc22@3985 464 *
cwc22@3985 465 * @return a handle to the hypervisor grant table interface or -1 on failure
cwc22@3985 466 */
cwc22@3985 467 int xc_grant_interface_open(void);
cwc22@3985 468
cwc22@3985 469 /**
cwc22@3985 470 * This function closes an open grant table hypervisor interface.
cwc22@3985 471 *
cwc22@3985 472 * This function can fail if the handle does not represent an open interface or
cwc22@3985 473 * if there were problems closing the interface.
cwc22@3985 474 *
cwc22@3985 475 * @parm xc_handle a handle to an open grant table hypervisor interface
cwc22@3985 476 * @return 0 on success, -1 otherwise.
cwc22@3985 477 */
cwc22@3985 478 int xc_grant_interface_close(int xc_handle);
cwc22@3985 479
cwc22@3985 480 int xc_gnttab_map_grant_ref(int xc_handle,
cwc22@3985 481 memory_t host_virt_addr,
cwc22@3985 482 u32 dom,
cwc22@3985 483 u16 ref,
cwc22@3985 484 u16 flags,
cwc22@3985 485 s16 *handle,
cwc22@3985 486 memory_t *dev_bus_addr);
cwc22@3985 487
cwc22@3985 488 int xc_gnttab_unmap_grant_ref(int xc_handle,
cwc22@3985 489 memory_t host_virt_addr,
cwc22@3985 490 memory_t dev_bus_addr,
cwc22@3985 491 u16 handle,
cwc22@3985 492 s16 *status);
cwc22@3985 493
cwc22@3985 494 int xc_gnttab_setup_table(int xc_handle,
cwc22@3985 495 u32 dom,
cwc22@3985 496 u16 nr_frames,
cwc22@3985 497 s16 *status,
cwc22@3985 498 memory_t **frame_list);
cwc22@3985 499
cwc22@3985 500 /* Grant debug builds only: */
cwc22@3985 501 int xc_gnttab_dump_table(int xc_handle,
cwc22@3985 502 u32 dom,
cwc22@3985 503 s16 *status);
cwc22@3985 504
cwc22@3985 505
mjw@1623 506 #endif /* __XC_H__ */