direct-io.hg

annotate 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
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
mjw@1623 12 typedef unsigned char u8;
mjw@1623 13 typedef unsigned short u16;
mjw@1623 14 typedef unsigned long u32;
mjw@1623 15 typedef unsigned long long u64;
mjw@1623 16 typedef signed char s8;
mjw@1623 17 typedef signed short s16;
mjw@1623 18 typedef signed long s32;
mjw@1623 19 typedef signed long long s64;
mjw@1623 20
kaf24@2821 21 #include <xen/xen.h>
kaf24@2821 22 #include <xen/dom0_ops.h>
kaf24@2821 23 #include <xen/event_channel.h>
kaf24@2821 24 #include <xen/sched_ctl.h>
kaf24@2821 25 #include <xen/io/domain_controller.h>
kaf24@2787 26
mjw@1623 27 /* Obtain or relinquish a handle on the 'xc' library. */
mjw@1623 28 int xc_interface_open(void);
mjw@1623 29 int xc_interface_close(int xc_handle);
mjw@1623 30
mjw@1623 31 typedef struct {
mjw@1623 32 u32 domid;
mjw@1623 33 unsigned int cpu;
mjw@1623 34 unsigned int dying:1, crashed:1, shutdown:1,
mjw@1623 35 paused:1, blocked:1, running:1;
mjw@1623 36 unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
mjw@1623 37 unsigned long nr_pages;
mjw@1623 38 unsigned long shared_info_frame;
mjw@1623 39 u64 cpu_time;
mjw@1623 40 unsigned long max_memkb;
mjw@1623 41 } xc_dominfo_t;
mjw@1623 42
kaf24@2787 43 typedef dom0_getdomaininfo_t xc_domaininfo_t;
mjw@1623 44 int xc_domain_create(int xc_handle,
mjw@1623 45 unsigned int mem_kb,
mjw@1623 46 int cpu,
gm281@2236 47 float cpu_weight,
mjw@1623 48 u32 *pdomid);
mjw@1623 49 int xc_domain_pause(int xc_handle,
mjw@1623 50 u32 domid);
mjw@1623 51 int xc_domain_unpause(int xc_handle,
mjw@1623 52 u32 domid);
mjw@1623 53 int xc_domain_destroy(int xc_handle,
mjw@1623 54 u32 domid);
mjw@1623 55 int xc_domain_pincpu(int xc_handle,
mjw@1623 56 u32 domid,
mjw@1623 57 int cpu);
mjw@1623 58 int xc_domain_getinfo(int xc_handle,
mjw@1623 59 u32 first_domid,
mjw@1623 60 unsigned int max_doms,
mjw@1623 61 xc_dominfo_t *info);
kaf24@2787 62 int xc_domain_getfullinfo(int xc_handle,
kaf24@2787 63 u32 domid,
kaf24@2787 64 xc_domaininfo_t *info,
kaf24@2787 65 full_execution_context_t *ctxt);
gm281@2236 66 int xc_domain_setcpuweight(int xc_handle,
gm281@2236 67 u32 domid,
gm281@2236 68 float weight);
kaf24@2787 69 long long xc_domain_get_cpu_usage(int xc_handle,
kaf24@2787 70 domid_t domid);
mjw@1623 71
kaf24@2787 72
kaf24@2787 73 typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
mjw@1623 74 int xc_shadow_control(int xc_handle,
mjw@1623 75 u32 domid,
mjw@1623 76 unsigned int sop,
mjw@1623 77 unsigned long *dirty_bitmap,
mjw@1623 78 unsigned long pages,
mjw@1623 79 xc_shadow_control_stats_t *stats);
mjw@1623 80
mjw@1623 81
mjw@2574 82 #define XCFLAGS_VERBOSE 1
mjw@2574 83 #define XCFLAGS_LIVE 2
mjw@2574 84 #define XCFLAGS_DEBUG 4
mjw@2574 85 #define XCFLAGS_CONFIGURE 8
mjw@1623 86
mjw@1623 87 struct XcIOContext;
mjw@1623 88 int xc_linux_save(int xc_handle, struct XcIOContext *ioctxt);
mjw@1623 89 int xc_linux_restore(int xc_handle, struct XcIOContext *ioctxt);
mjw@1623 90
mjw@1623 91 int xc_linux_build(int xc_handle,
mjw@1623 92 u32 domid,
mjw@1623 93 const char *image_name,
mjw@1623 94 const char *ramdisk_name,
mjw@1623 95 const char *cmdline,
mjw@1623 96 unsigned int control_evtchn,
mjw@1623 97 unsigned long flags);
mjw@1623 98
mjw@1623 99 int xc_bvtsched_global_set(int xc_handle,
mjw@1623 100 unsigned long ctx_allow);
mjw@1623 101
mjw@1623 102 int xc_bvtsched_domain_set(int xc_handle,
mjw@1623 103 u32 domid,
gm281@2058 104 u32 mcuadv,
gm281@2058 105 int warpback,
gm281@2058 106 s32 warpvalue,
gm281@2058 107 long long warpl,
gm281@2058 108 long long warpu);
mjw@1623 109
mjw@1623 110 int xc_bvtsched_global_get(int xc_handle,
mjw@1623 111 unsigned long *ctx_allow);
mjw@1623 112
mjw@1623 113 int xc_bvtsched_domain_get(int xc_handle,
mjw@1623 114 u32 domid,
gm281@2058 115 u32 *mcuadv,
gm281@2058 116 int *warpback,
gm281@2058 117 s32 *warpvalue,
gm281@2058 118 long long *warpl,
gm281@2058 119 long long *warpu);
mjw@1623 120
mjw@1623 121 int xc_atropos_domain_set(int xc_handle,
mjw@1623 122 u32 domid,
mjw@1623 123 u64 period, u64 slice, u64 latency,
mjw@1623 124 int xtratime);
mjw@1623 125
mjw@1623 126 int xc_atropos_domain_get(int xc_handle,
mjw@1623 127 u32 domid,
mjw@1623 128 u64* period, u64 *slice, u64 *latency,
mjw@1623 129 int *xtratime);
mjw@1623 130
mjw@1623 131 int xc_rrobin_global_set(int xc_handle, u64 slice);
mjw@1623 132
mjw@1623 133 int xc_rrobin_global_get(int xc_handle, u64 *slice);
mjw@1623 134
kaf24@2787 135 typedef evtchn_status_t xc_evtchn_status_t;
kaf24@2713 136 int xc_evtchn_alloc_unbound(int xc_handle,
kaf24@2713 137 u32 dom,
kaf24@2713 138 int *port);
mjw@1623 139 int xc_evtchn_bind_interdomain(int xc_handle,
mjw@1623 140 u32 dom1, /* may be DOMID_SELF */
mjw@1623 141 u32 dom2, /* may be DOMID_SELF */
mjw@1623 142 int *port1,
mjw@1623 143 int *port2);
mjw@1623 144 int xc_evtchn_bind_virq(int xc_handle,
mjw@1623 145 int virq,
mjw@1623 146 int *port);
mjw@1623 147 int xc_evtchn_close(int xc_handle,
mjw@1623 148 u32 dom, /* may be DOMID_SELF */
mjw@1623 149 int port);
mjw@1623 150 int xc_evtchn_send(int xc_handle,
mjw@1623 151 int local_port);
mjw@1623 152 int xc_evtchn_status(int xc_handle,
mjw@1623 153 u32 dom, /* may be DOMID_SELF */
mjw@1623 154 int port,
mjw@1623 155 xc_evtchn_status_t *status);
mjw@1623 156
mjw@1623 157 int xc_physdev_pci_access_modify(int xc_handle,
mjw@1623 158 u32 domid,
mjw@1623 159 int bus,
mjw@1623 160 int dev,
mjw@1623 161 int func,
mjw@1623 162 int enable);
mjw@1623 163
mjw@1623 164 int xc_readconsolering(int xc_handle,
mjw@1623 165 char *str,
mjw@1623 166 unsigned int max_chars,
mjw@1623 167 int clear);
mjw@1623 168
kaf24@2787 169 typedef dom0_physinfo_t xc_physinfo_t;
mjw@1623 170 int xc_physinfo(int xc_handle,
mjw@1623 171 xc_physinfo_t *info);
mjw@1623 172
gm281@2236 173 int xc_sched_id(int xc_handle,
gm281@2236 174 int *sched_id);
gm281@2236 175
mjw@1623 176 int xc_domain_setinitialmem(int xc_handle,
mjw@1623 177 u32 domid,
mjw@1623 178 unsigned int initial_memkb);
mjw@1623 179
mjw@1623 180 int xc_domain_setmaxmem(int xc_handle,
mjw@1623 181 u32 domid,
mjw@1623 182 unsigned int max_memkb);
mjw@1623 183
cl349@2449 184 int xc_domain_setvmassist(int xc_handle,
cl349@2449 185 u32 domid,
cl349@2449 186 unsigned int cmd,
cl349@2449 187 unsigned int type);
cl349@2449 188
mjw@1623 189
iap10@2325 190 void *xc_map_foreign_range(int xc_handle, u32 dom,
iap10@2325 191 int size, int prot,
iap10@2325 192 unsigned long mfn );
iap10@2325 193
iap10@2325 194 void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
iap10@2325 195 unsigned long *arr, int num );
iap10@2325 196
mjw@1623 197 #endif /* __XC_H__ */