Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / xen / include / xen3-public / hvm / hvm_op.h
bloba018745525f8fee74d1560293d984f56efd7eed6
1 /* $NetBSD: hvm_op.h,v 1.3 2008/05/04 19:56:29 cegger Exp $ */
2 /*
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to
5 * deal in the Software without restriction, including without limitation the
6 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 * sell copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 * DEALINGS IN THE SOFTWARE.
22 #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
23 #define __XEN_PUBLIC_HVM_HVM_OP_H__
25 /* Get/set subcommands: extra argument == pointer to xen_hvm_param struct. */
26 #define HVMOP_set_param 0
27 #define HVMOP_get_param 1
28 struct xen_hvm_param {
29 domid_t domid; /* IN */
30 uint32_t index; /* IN */
31 uint64_t value; /* IN/OUT */
33 typedef struct xen_hvm_param xen_hvm_param_t;
34 DEFINE_XEN_GUEST_HANDLE(xen_hvm_param_t);
36 /* Set the logical level of one of a domain's PCI INTx wires. */
37 #define HVMOP_set_pci_intx_level 2
38 struct xen_hvm_set_pci_intx_level {
39 /* Domain to be updated. */
40 domid_t domid;
41 /* PCI INTx identification in PCI topology (domain:bus:device:intx). */
42 uint8_t domain, bus, device, intx;
43 /* Assertion level (0 = unasserted, 1 = asserted). */
44 uint8_t level;
46 typedef struct xen_hvm_set_pci_intx_level xen_hvm_set_pci_intx_level_t;
47 DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_intx_level_t);
49 /* Set the logical level of one of a domain's ISA IRQ wires. */
50 #define HVMOP_set_isa_irq_level 3
51 struct xen_hvm_set_isa_irq_level {
52 /* Domain to be updated. */
53 domid_t domid;
54 /* ISA device identification, by ISA IRQ (0-15). */
55 uint8_t isa_irq;
56 /* Assertion level (0 = unasserted, 1 = asserted). */
57 uint8_t level;
59 typedef struct xen_hvm_set_isa_irq_level xen_hvm_set_isa_irq_level_t;
60 DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_isa_irq_level_t);
62 #define HVMOP_set_pci_link_route 4
63 struct xen_hvm_set_pci_link_route {
64 /* Domain to be updated. */
65 domid_t domid;
66 /* PCI link identifier (0-3). */
67 uint8_t link;
68 /* ISA IRQ (1-15), or 0 (disable link). */
69 uint8_t isa_irq;
71 typedef struct xen_hvm_set_pci_link_route xen_hvm_set_pci_link_route_t;
72 DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_link_route_t);
74 /* Flushes all VCPU TLBs: @arg must be NULL. */
75 #define HVMOP_flush_tlbs 5
77 /* Following tools-only interfaces may change in future. */
78 #if defined(__XEN__) || defined(__XEN_TOOLS__)
80 /* Track dirty VRAM. */
81 #define HVMOP_track_dirty_vram 6
82 struct xen_hvm_track_dirty_vram {
83 /* Domain to be tracked. */
84 domid_t domid;
85 /* First pfn to track. */
86 uint64_aligned_t first_pfn;
87 /* Number of pages to track. */
88 uint64_aligned_t nr;
89 /* OUT variable. */
90 /* Dirty bitmap buffer. */
91 XEN_GUEST_HANDLE_64(uint8) dirty_bitmap;
93 typedef struct xen_hvm_track_dirty_vram xen_hvm_track_dirty_vram_t;
94 DEFINE_XEN_GUEST_HANDLE(xen_hvm_track_dirty_vram_t);
96 /* Notify that some pages got modified by the Device Model. */
97 #define HVMOP_modified_memory 7
98 struct xen_hvm_modified_memory {
99 /* Domain to be updated. */
100 domid_t domid;
101 /* First pfn. */
102 uint64_aligned_t first_pfn;
103 /* Number of pages. */
104 uint64_aligned_t nr;
106 typedef struct xen_hvm_modified_memory xen_hvm_modified_memory_t;
107 DEFINE_XEN_GUEST_HANDLE(xen_hvm_modified_memory_t);
109 #define HVMOP_set_mem_type 8
110 typedef enum {
111 HVMMEM_ram_rw, /* Normal read/write guest RAM */
112 HVMMEM_ram_ro, /* Read-only; writes are discarded */
113 HVMMEM_mmio_dm, /* Reads and write go to the device model */
114 } hvmmem_type_t;
115 /* Notify that a region of memory is to be treated in a specific way. */
116 struct xen_hvm_set_mem_type {
117 /* Domain to be updated. */
118 domid_t domid;
119 /* Memory type */
120 hvmmem_type_t hvmmem_type;
121 /* First pfn. */
122 uint64_aligned_t first_pfn;
123 /* Number of pages. */
124 uint64_aligned_t nr;
126 typedef struct xen_hvm_set_mem_type xen_hvm_set_mem_type_t;
127 DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_mem_type_t);
130 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
132 #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */