xen.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. /******************************************************************************
  2. * xen.h
  3. *
  4. * Guest OS interface to Xen.
  5. *
  6. * Copyright (c) 2004, K A Fraser
  7. */
  8. #ifndef __XEN_PUBLIC_XEN_H__
  9. #define __XEN_PUBLIC_XEN_H__
  10. #include <asm/xen/interface.h>
  11. #include <asm/pvclock-abi.h>
  12. /*
  13. * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS).
  14. */
  15. /*
  16. * x86_32: EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5.
  17. * EAX = return value
  18. * (argument registers may be clobbered on return)
  19. * x86_64: RAX = vector; RDI, RSI, RDX, R10, R8, R9 = args 1, 2, 3, 4, 5, 6.
  20. * RAX = return value
  21. * (argument registers not clobbered on return; RCX, R11 are)
  22. */
  23. #define __HYPERVISOR_set_trap_table 0
  24. #define __HYPERVISOR_mmu_update 1
  25. #define __HYPERVISOR_set_gdt 2
  26. #define __HYPERVISOR_stack_switch 3
  27. #define __HYPERVISOR_set_callbacks 4
  28. #define __HYPERVISOR_fpu_taskswitch 5
  29. #define __HYPERVISOR_sched_op_compat 6
  30. #define __HYPERVISOR_dom0_op 7
  31. #define __HYPERVISOR_set_debugreg 8
  32. #define __HYPERVISOR_get_debugreg 9
  33. #define __HYPERVISOR_update_descriptor 10
  34. #define __HYPERVISOR_memory_op 12
  35. #define __HYPERVISOR_multicall 13
  36. #define __HYPERVISOR_update_va_mapping 14
  37. #define __HYPERVISOR_set_timer_op 15
  38. #define __HYPERVISOR_event_channel_op_compat 16
  39. #define __HYPERVISOR_xen_version 17
  40. #define __HYPERVISOR_console_io 18
  41. #define __HYPERVISOR_physdev_op_compat 19
  42. #define __HYPERVISOR_grant_table_op 20
  43. #define __HYPERVISOR_vm_assist 21
  44. #define __HYPERVISOR_update_va_mapping_otherdomain 22
  45. #define __HYPERVISOR_iret 23 /* x86 only */
  46. #define __HYPERVISOR_vcpu_op 24
  47. #define __HYPERVISOR_set_segment_base 25 /* x86/64 only */
  48. #define __HYPERVISOR_mmuext_op 26
  49. #define __HYPERVISOR_acm_op 27
  50. #define __HYPERVISOR_nmi_op 28
  51. #define __HYPERVISOR_sched_op 29
  52. #define __HYPERVISOR_callback_op 30
  53. #define __HYPERVISOR_xenoprof_op 31
  54. #define __HYPERVISOR_event_channel_op 32
  55. #define __HYPERVISOR_physdev_op 33
  56. #define __HYPERVISOR_hvm_op 34
  57. #define __HYPERVISOR_tmem_op 38
  58. /* Architecture-specific hypercall definitions. */
  59. #define __HYPERVISOR_arch_0 48
  60. #define __HYPERVISOR_arch_1 49
  61. #define __HYPERVISOR_arch_2 50
  62. #define __HYPERVISOR_arch_3 51
  63. #define __HYPERVISOR_arch_4 52
  64. #define __HYPERVISOR_arch_5 53
  65. #define __HYPERVISOR_arch_6 54
  66. #define __HYPERVISOR_arch_7 55
  67. /*
  68. * VIRTUAL INTERRUPTS
  69. *
  70. * Virtual interrupts that a guest OS may receive from Xen.
  71. */
  72. #define VIRQ_TIMER 0 /* Timebase update, and/or requested timeout. */
  73. #define VIRQ_DEBUG 1 /* Request guest to dump debug info. */
  74. #define VIRQ_CONSOLE 2 /* (DOM0) Bytes received on emergency console. */
  75. #define VIRQ_DOM_EXC 3 /* (DOM0) Exceptional event for some domain. */
  76. #define VIRQ_DEBUGGER 6 /* (DOM0) A domain has paused for debugging. */
  77. #define VIRQ_PCPU_STATE 9 /* (DOM0) PCPU state changed */
  78. /* Architecture-specific VIRQ definitions. */
  79. #define VIRQ_ARCH_0 16
  80. #define VIRQ_ARCH_1 17
  81. #define VIRQ_ARCH_2 18
  82. #define VIRQ_ARCH_3 19
  83. #define VIRQ_ARCH_4 20
  84. #define VIRQ_ARCH_5 21
  85. #define VIRQ_ARCH_6 22
  86. #define VIRQ_ARCH_7 23
  87. #define NR_VIRQS 24
  88. /*
  89. * MMU-UPDATE REQUESTS
  90. *
  91. * HYPERVISOR_mmu_update() accepts a list of (ptr, val) pairs.
  92. * A foreigndom (FD) can be specified (or DOMID_SELF for none).
  93. * Where the FD has some effect, it is described below.
  94. * ptr[1:0] specifies the appropriate MMU_* command.
  95. *
  96. * ptr[1:0] == MMU_NORMAL_PT_UPDATE:
  97. * Updates an entry in a page table. If updating an L1 table, and the new
  98. * table entry is valid/present, the mapped frame must belong to the FD, if
  99. * an FD has been specified. If attempting to map an I/O page then the
  100. * caller assumes the privilege of the FD.
  101. * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller.
  102. * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
  103. * ptr[:2] -- Machine address of the page-table entry to modify.
  104. * val -- Value to write.
  105. *
  106. * ptr[1:0] == MMU_MACHPHYS_UPDATE:
  107. * Updates an entry in the machine->pseudo-physical mapping table.
  108. * ptr[:2] -- Machine address within the frame whose mapping to modify.
  109. * The frame must belong to the FD, if one is specified.
  110. * val -- Value to write into the mapping entry.
  111. *
  112. * ptr[1:0] == MMU_PT_UPDATE_PRESERVE_AD:
  113. * As MMU_NORMAL_PT_UPDATE above, but A/D bits currently in the PTE are ORed
  114. * with those in @val.
  115. */
  116. #define MMU_NORMAL_PT_UPDATE 0 /* checked '*ptr = val'. ptr is MA. */
  117. #define MMU_MACHPHYS_UPDATE 1 /* ptr = MA of frame to modify entry for */
  118. #define MMU_PT_UPDATE_PRESERVE_AD 2 /* atomically: *ptr = val | (*ptr&(A|D)) */
  119. /*
  120. * MMU EXTENDED OPERATIONS
  121. *
  122. * HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
  123. * A foreigndom (FD) can be specified (or DOMID_SELF for none).
  124. * Where the FD has some effect, it is described below.
  125. *
  126. * cmd: MMUEXT_(UN)PIN_*_TABLE
  127. * mfn: Machine frame number to be (un)pinned as a p.t. page.
  128. * The frame must belong to the FD, if one is specified.
  129. *
  130. * cmd: MMUEXT_NEW_BASEPTR
  131. * mfn: Machine frame number of new page-table base to install in MMU.
  132. *
  133. * cmd: MMUEXT_NEW_USER_BASEPTR [x86/64 only]
  134. * mfn: Machine frame number of new page-table base to install in MMU
  135. * when in user space.
  136. *
  137. * cmd: MMUEXT_TLB_FLUSH_LOCAL
  138. * No additional arguments. Flushes local TLB.
  139. *
  140. * cmd: MMUEXT_INVLPG_LOCAL
  141. * linear_addr: Linear address to be flushed from the local TLB.
  142. *
  143. * cmd: MMUEXT_TLB_FLUSH_MULTI
  144. * vcpumask: Pointer to bitmap of VCPUs to be flushed.
  145. *
  146. * cmd: MMUEXT_INVLPG_MULTI
  147. * linear_addr: Linear address to be flushed.
  148. * vcpumask: Pointer to bitmap of VCPUs to be flushed.
  149. *
  150. * cmd: MMUEXT_TLB_FLUSH_ALL
  151. * No additional arguments. Flushes all VCPUs' TLBs.
  152. *
  153. * cmd: MMUEXT_INVLPG_ALL
  154. * linear_addr: Linear address to be flushed from all VCPUs' TLBs.
  155. *
  156. * cmd: MMUEXT_FLUSH_CACHE
  157. * No additional arguments. Writes back and flushes cache contents.
  158. *
  159. * cmd: MMUEXT_SET_LDT
  160. * linear_addr: Linear address of LDT base (NB. must be page-aligned).
  161. * nr_ents: Number of entries in LDT.
  162. */
  163. #define MMUEXT_PIN_L1_TABLE 0
  164. #define MMUEXT_PIN_L2_TABLE 1
  165. #define MMUEXT_PIN_L3_TABLE 2
  166. #define MMUEXT_PIN_L4_TABLE 3
  167. #define MMUEXT_UNPIN_TABLE 4
  168. #define MMUEXT_NEW_BASEPTR 5
  169. #define MMUEXT_TLB_FLUSH_LOCAL 6
  170. #define MMUEXT_INVLPG_LOCAL 7
  171. #define MMUEXT_TLB_FLUSH_MULTI 8
  172. #define MMUEXT_INVLPG_MULTI 9
  173. #define MMUEXT_TLB_FLUSH_ALL 10
  174. #define MMUEXT_INVLPG_ALL 11
  175. #define MMUEXT_FLUSH_CACHE 12
  176. #define MMUEXT_SET_LDT 13
  177. #define MMUEXT_NEW_USER_BASEPTR 15
  178. #ifndef __ASSEMBLY__
  179. struct mmuext_op {
  180. unsigned int cmd;
  181. union {
  182. /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
  183. unsigned long mfn;
  184. /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
  185. unsigned long linear_addr;
  186. } arg1;
  187. union {
  188. /* SET_LDT */
  189. unsigned int nr_ents;
  190. /* TLB_FLUSH_MULTI, INVLPG_MULTI */
  191. void *vcpumask;
  192. } arg2;
  193. };
  194. DEFINE_GUEST_HANDLE_STRUCT(mmuext_op);
  195. #endif
  196. /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
  197. /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap. */
  198. /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer. */
  199. #define UVMF_NONE (0UL<<0) /* No flushing at all. */
  200. #define UVMF_TLB_FLUSH (1UL<<0) /* Flush entire TLB(s). */
  201. #define UVMF_INVLPG (2UL<<0) /* Flush only one entry. */
  202. #define UVMF_FLUSHTYPE_MASK (3UL<<0)
  203. #define UVMF_MULTI (0UL<<2) /* Flush subset of TLBs. */
  204. #define UVMF_LOCAL (0UL<<2) /* Flush local TLB. */
  205. #define UVMF_ALL (1UL<<2) /* Flush all TLBs. */
  206. /*
  207. * Commands to HYPERVISOR_console_io().
  208. */
  209. #define CONSOLEIO_write 0
  210. #define CONSOLEIO_read 1
  211. /*
  212. * Commands to HYPERVISOR_vm_assist().
  213. */
  214. #define VMASST_CMD_enable 0
  215. #define VMASST_CMD_disable 1
  216. #define VMASST_TYPE_4gb_segments 0
  217. #define VMASST_TYPE_4gb_segments_notify 1
  218. #define VMASST_TYPE_writable_pagetables 2
  219. #define VMASST_TYPE_pae_extended_cr3 3
  220. #define MAX_VMASST_TYPE 3
  221. #ifndef __ASSEMBLY__
  222. typedef uint16_t domid_t;
  223. /* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */
  224. #define DOMID_FIRST_RESERVED (0x7FF0U)
  225. /* DOMID_SELF is used in certain contexts to refer to oneself. */
  226. #define DOMID_SELF (0x7FF0U)
  227. /*
  228. * DOMID_IO is used to restrict page-table updates to mapping I/O memory.
  229. * Although no Foreign Domain need be specified to map I/O pages, DOMID_IO
  230. * is useful to ensure that no mappings to the OS's own heap are accidentally
  231. * installed. (e.g., in Linux this could cause havoc as reference counts
  232. * aren't adjusted on the I/O-mapping code path).
  233. * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
  234. * be specified by any calling domain.
  235. */
  236. #define DOMID_IO (0x7FF1U)
  237. /*
  238. * DOMID_XEN is used to allow privileged domains to map restricted parts of
  239. * Xen's heap space (e.g., the machine_to_phys table).
  240. * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
  241. * the caller is privileged.
  242. */
  243. #define DOMID_XEN (0x7FF2U)
  244. /*
  245. * Send an array of these to HYPERVISOR_mmu_update().
  246. * NB. The fields are natural pointer/address size for this architecture.
  247. */
  248. struct mmu_update {
  249. uint64_t ptr; /* Machine address of PTE. */
  250. uint64_t val; /* New contents of PTE. */
  251. };
  252. DEFINE_GUEST_HANDLE_STRUCT(mmu_update);
  253. /*
  254. * Send an array of these to HYPERVISOR_multicall().
  255. * NB. The fields are natural register size for this architecture.
  256. */
  257. struct multicall_entry {
  258. unsigned long op;
  259. long result;
  260. unsigned long args[6];
  261. };
  262. DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
  263. /*
  264. * Event channel endpoints per domain:
  265. * 1024 if a long is 32 bits; 4096 if a long is 64 bits.
  266. */
  267. #define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
  268. struct vcpu_time_info {
  269. /*
  270. * Updates to the following values are preceded and followed
  271. * by an increment of 'version'. The guest can therefore
  272. * detect updates by looking for changes to 'version'. If the
  273. * least-significant bit of the version number is set then an
  274. * update is in progress and the guest must wait to read a
  275. * consistent set of values. The correct way to interact with
  276. * the version number is similar to Linux's seqlock: see the
  277. * implementations of read_seqbegin/read_seqretry.
  278. */
  279. uint32_t version;
  280. uint32_t pad0;
  281. uint64_t tsc_timestamp; /* TSC at last update of time vals. */
  282. uint64_t system_time; /* Time, in nanosecs, since boot. */
  283. /*
  284. * Current system time:
  285. * system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul
  286. * CPU frequency (Hz):
  287. * ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
  288. */
  289. uint32_t tsc_to_system_mul;
  290. int8_t tsc_shift;
  291. int8_t pad1[3];
  292. }; /* 32 bytes */
  293. struct vcpu_info {
  294. /*
  295. * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
  296. * a pending notification for a particular VCPU. It is then cleared
  297. * by the guest OS /before/ checking for pending work, thus avoiding
  298. * a set-and-check race. Note that the mask is only accessed by Xen
  299. * on the CPU that is currently hosting the VCPU. This means that the
  300. * pending and mask flags can be updated by the guest without special
  301. * synchronisation (i.e., no need for the x86 LOCK prefix).
  302. * This may seem suboptimal because if the pending flag is set by
  303. * a different CPU then an IPI may be scheduled even when the mask
  304. * is set. However, note:
  305. * 1. The task of 'interrupt holdoff' is covered by the per-event-
  306. * channel mask bits. A 'noisy' event that is continually being
  307. * triggered can be masked at source at this very precise
  308. * granularity.
  309. * 2. The main purpose of the per-VCPU mask is therefore to restrict
  310. * reentrant execution: whether for concurrency control, or to
  311. * prevent unbounded stack usage. Whatever the purpose, we expect
  312. * that the mask will be asserted only for short periods at a time,
  313. * and so the likelihood of a 'spurious' IPI is suitably small.
  314. * The mask is read before making an event upcall to the guest: a
  315. * non-zero mask therefore guarantees that the VCPU will not receive
  316. * an upcall activation. The mask is cleared when the VCPU requests
  317. * to block: this avoids wakeup-waiting races.
  318. */
  319. uint8_t evtchn_upcall_pending;
  320. uint8_t evtchn_upcall_mask;
  321. unsigned long evtchn_pending_sel;
  322. struct arch_vcpu_info arch;
  323. struct pvclock_vcpu_time_info time;
  324. }; /* 64 bytes (x86) */
  325. /*
  326. * Xen/kernel shared data -- pointer provided in start_info.
  327. * NB. We expect that this struct is smaller than a page.
  328. */
  329. struct shared_info {
  330. struct vcpu_info vcpu_info[MAX_VIRT_CPUS];
  331. /*
  332. * A domain can create "event channels" on which it can send and receive
  333. * asynchronous event notifications. There are three classes of event that
  334. * are delivered by this mechanism:
  335. * 1. Bi-directional inter- and intra-domain connections. Domains must
  336. * arrange out-of-band to set up a connection (usually by allocating
  337. * an unbound 'listener' port and avertising that via a storage service
  338. * such as xenstore).
  339. * 2. Physical interrupts. A domain with suitable hardware-access
  340. * privileges can bind an event-channel port to a physical interrupt
  341. * source.
  342. * 3. Virtual interrupts ('events'). A domain can bind an event-channel
  343. * port to a virtual interrupt source, such as the virtual-timer
  344. * device or the emergency console.
  345. *
  346. * Event channels are addressed by a "port index". Each channel is
  347. * associated with two bits of information:
  348. * 1. PENDING -- notifies the domain that there is a pending notification
  349. * to be processed. This bit is cleared by the guest.
  350. * 2. MASK -- if this bit is clear then a 0->1 transition of PENDING
  351. * will cause an asynchronous upcall to be scheduled. This bit is only
  352. * updated by the guest. It is read-only within Xen. If a channel
  353. * becomes pending while the channel is masked then the 'edge' is lost
  354. * (i.e., when the channel is unmasked, the guest must manually handle
  355. * pending notifications as no upcall will be scheduled by Xen).
  356. *
  357. * To expedite scanning of pending notifications, any 0->1 pending
  358. * transition on an unmasked channel causes a corresponding bit in a
  359. * per-vcpu selector word to be set. Each bit in the selector covers a
  360. * 'C long' in the PENDING bitfield array.
  361. */
  362. unsigned long evtchn_pending[sizeof(unsigned long) * 8];
  363. unsigned long evtchn_mask[sizeof(unsigned long) * 8];
  364. /*
  365. * Wallclock time: updated only by control software. Guests should base
  366. * their gettimeofday() syscall on this wallclock-base value.
  367. */
  368. struct pvclock_wall_clock wc;
  369. struct arch_shared_info arch;
  370. };
  371. /*
  372. * Start-of-day memory layout for the initial domain (DOM0):
  373. * 1. The domain is started within contiguous virtual-memory region.
  374. * 2. The contiguous region begins and ends on an aligned 4MB boundary.
  375. * 3. The region start corresponds to the load address of the OS image.
  376. * If the load address is not 4MB aligned then the address is rounded down.
  377. * 4. This the order of bootstrap elements in the initial virtual region:
  378. * a. relocated kernel image
  379. * b. initial ram disk [mod_start, mod_len]
  380. * c. list of allocated page frames [mfn_list, nr_pages]
  381. * d. start_info_t structure [register ESI (x86)]
  382. * e. bootstrap page tables [pt_base, CR3 (x86)]
  383. * f. bootstrap stack [register ESP (x86)]
  384. * 5. Bootstrap elements are packed together, but each is 4kB-aligned.
  385. * 6. The initial ram disk may be omitted.
  386. * 7. The list of page frames forms a contiguous 'pseudo-physical' memory
  387. * layout for the domain. In particular, the bootstrap virtual-memory
  388. * region is a 1:1 mapping to the first section of the pseudo-physical map.
  389. * 8. All bootstrap elements are mapped read-writable for the guest OS. The
  390. * only exception is the bootstrap page table, which is mapped read-only.
  391. * 9. There is guaranteed to be at least 512kB padding after the final
  392. * bootstrap element. If necessary, the bootstrap virtual region is
  393. * extended by an extra 4MB to ensure this.
  394. */
  395. #define MAX_GUEST_CMDLINE 1024
  396. struct start_info {
  397. /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */
  398. char magic[32]; /* "xen-<version>-<platform>". */
  399. unsigned long nr_pages; /* Total pages allocated to this domain. */
  400. unsigned long shared_info; /* MACHINE address of shared info struct. */
  401. uint32_t flags; /* SIF_xxx flags. */
  402. unsigned long store_mfn; /* MACHINE page number of shared page. */
  403. uint32_t store_evtchn; /* Event channel for store communication. */
  404. union {
  405. struct {
  406. unsigned long mfn; /* MACHINE page number of console page. */
  407. uint32_t evtchn; /* Event channel for console page. */
  408. } domU;
  409. struct {
  410. uint32_t info_off; /* Offset of console_info struct. */
  411. uint32_t info_size; /* Size of console_info struct from start.*/
  412. } dom0;
  413. } console;
  414. /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */
  415. unsigned long pt_base; /* VIRTUAL address of page directory. */
  416. unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. */
  417. unsigned long mfn_list; /* VIRTUAL address of page-frame list. */
  418. unsigned long mod_start; /* VIRTUAL address of pre-loaded module. */
  419. unsigned long mod_len; /* Size (bytes) of pre-loaded module. */
  420. int8_t cmd_line[MAX_GUEST_CMDLINE];
  421. };
  422. struct dom0_vga_console_info {
  423. uint8_t video_type;
  424. #define XEN_VGATYPE_TEXT_MODE_3 0x03
  425. #define XEN_VGATYPE_VESA_LFB 0x23
  426. union {
  427. struct {
  428. /* Font height, in pixels. */
  429. uint16_t font_height;
  430. /* Cursor location (column, row). */
  431. uint16_t cursor_x, cursor_y;
  432. /* Number of rows and columns (dimensions in characters). */
  433. uint16_t rows, columns;
  434. } text_mode_3;
  435. struct {
  436. /* Width and height, in pixels. */
  437. uint16_t width, height;
  438. /* Bytes per scan line. */
  439. uint16_t bytes_per_line;
  440. /* Bits per pixel. */
  441. uint16_t bits_per_pixel;
  442. /* LFB physical address, and size (in units of 64kB). */
  443. uint32_t lfb_base;
  444. uint32_t lfb_size;
  445. /* RGB mask offsets and sizes, as defined by VBE 1.2+ */
  446. uint8_t red_pos, red_size;
  447. uint8_t green_pos, green_size;
  448. uint8_t blue_pos, blue_size;
  449. uint8_t rsvd_pos, rsvd_size;
  450. /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
  451. uint32_t gbl_caps;
  452. /* Mode attributes (offset 0x0, VESA command 0x4f01). */
  453. uint16_t mode_attrs;
  454. } vesa_lfb;
  455. } u;
  456. };
  457. /* These flags are passed in the 'flags' field of start_info_t. */
  458. #define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
  459. #define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
  460. #define SIF_PM_MASK (0xFF<<8) /* reserve 1 byte for xen-pm options */
  461. typedef uint64_t cpumap_t;
  462. typedef uint8_t xen_domain_handle_t[16];
  463. /* Turn a plain number into a C unsigned long constant. */
  464. #define __mk_unsigned_long(x) x ## UL
  465. #define mk_unsigned_long(x) __mk_unsigned_long(x)
  466. #define TMEM_SPEC_VERSION 1
  467. struct tmem_op {
  468. uint32_t cmd;
  469. int32_t pool_id;
  470. union {
  471. struct { /* for cmd == TMEM_NEW_POOL */
  472. uint64_t uuid[2];
  473. uint32_t flags;
  474. } new;
  475. struct {
  476. uint64_t oid[3];
  477. uint32_t index;
  478. uint32_t tmem_offset;
  479. uint32_t pfn_offset;
  480. uint32_t len;
  481. GUEST_HANDLE(void) gmfn; /* guest machine page frame */
  482. } gen;
  483. } u;
  484. };
  485. DEFINE_GUEST_HANDLE(u64);
  486. #else /* __ASSEMBLY__ */
  487. /* In assembly code we cannot use C numeric constant suffixes. */
  488. #define mk_unsigned_long(x) x
  489. #endif /* !__ASSEMBLY__ */
  490. #endif /* __XEN_PUBLIC_XEN_H__ */