diff options
Diffstat (limited to 'include/xen')
-rw-r--r-- | include/xen/balloon.h | 25 | ||||
-rw-r--r-- | include/xen/events.h | 6 | ||||
-rw-r--r-- | include/xen/gntalloc.h | 82 | ||||
-rw-r--r-- | include/xen/gntdev.h | 31 | ||||
-rw-r--r-- | include/xen/interface/io/blkif.h | 37 | ||||
-rw-r--r-- | include/xen/interface/io/netif.h | 80 | ||||
-rw-r--r-- | include/xen/interface/sched.h | 34 | ||||
-rw-r--r-- | include/xen/interface/xen.h | 4 | ||||
-rw-r--r-- | include/xen/xen-ops.h | 6 |
9 files changed, 257 insertions, 48 deletions
diff --git a/include/xen/balloon.h b/include/xen/balloon.h new file mode 100644 index 000000000000..a2b22f01a51d --- /dev/null +++ b/include/xen/balloon.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /****************************************************************************** | ||
2 | * Xen balloon functionality | ||
3 | */ | ||
4 | |||
5 | #define RETRY_UNLIMITED 0 | ||
6 | |||
7 | struct balloon_stats { | ||
8 | /* We aim for 'current allocation' == 'target allocation'. */ | ||
9 | unsigned long current_pages; | ||
10 | unsigned long target_pages; | ||
11 | /* Number of pages in high- and low-memory balloons. */ | ||
12 | unsigned long balloon_low; | ||
13 | unsigned long balloon_high; | ||
14 | unsigned long schedule_delay; | ||
15 | unsigned long max_schedule_delay; | ||
16 | unsigned long retry_count; | ||
17 | unsigned long max_retry_count; | ||
18 | }; | ||
19 | |||
20 | extern struct balloon_stats balloon_stats; | ||
21 | |||
22 | void balloon_set_new_target(unsigned long target); | ||
23 | |||
24 | int alloc_xenballooned_pages(int nr_pages, struct page** pages); | ||
25 | void free_xenballooned_pages(int nr_pages, struct page** pages); | ||
diff --git a/include/xen/events.h b/include/xen/events.h index 32ebebacee7f..f1b87ad48ac7 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
@@ -23,6 +23,12 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi, | |||
23 | unsigned long irqflags, | 23 | unsigned long irqflags, |
24 | const char *devname, | 24 | const char *devname, |
25 | void *dev_id); | 25 | void *dev_id); |
26 | int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain, | ||
27 | unsigned int remote_port, | ||
28 | irq_handler_t handler, | ||
29 | unsigned long irqflags, | ||
30 | const char *devname, | ||
31 | void *dev_id); | ||
26 | 32 | ||
27 | /* | 33 | /* |
28 | * Common unbind function for all event sources. Takes IRQ to unbind from. | 34 | * Common unbind function for all event sources. Takes IRQ to unbind from. |
diff --git a/include/xen/gntalloc.h b/include/xen/gntalloc.h new file mode 100644 index 000000000000..76bd58065f4f --- /dev/null +++ b/include/xen/gntalloc.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /****************************************************************************** | ||
2 | * gntalloc.h | ||
3 | * | ||
4 | * Interface to /dev/xen/gntalloc. | ||
5 | * | ||
6 | * Author: Daniel De Graaf <dgdegra@tycho.nsa.gov> | ||
7 | * | ||
8 | * This file is in the public domain. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_PUBLIC_GNTALLOC_H__ | ||
12 | #define __LINUX_PUBLIC_GNTALLOC_H__ | ||
13 | |||
14 | /* | ||
15 | * Allocates a new page and creates a new grant reference. | ||
16 | */ | ||
17 | #define IOCTL_GNTALLOC_ALLOC_GREF \ | ||
18 | _IOC(_IOC_NONE, 'G', 5, sizeof(struct ioctl_gntalloc_alloc_gref)) | ||
19 | struct ioctl_gntalloc_alloc_gref { | ||
20 | /* IN parameters */ | ||
21 | /* The ID of the domain to be given access to the grants. */ | ||
22 | uint16_t domid; | ||
23 | /* Flags for this mapping */ | ||
24 | uint16_t flags; | ||
25 | /* Number of pages to map */ | ||
26 | uint32_t count; | ||
27 | /* OUT parameters */ | ||
28 | /* The offset to be used on a subsequent call to mmap(). */ | ||
29 | uint64_t index; | ||
30 | /* The grant references of the newly created grant, one per page */ | ||
31 | /* Variable size, depending on count */ | ||
32 | uint32_t gref_ids[1]; | ||
33 | }; | ||
34 | |||
35 | #define GNTALLOC_FLAG_WRITABLE 1 | ||
36 | |||
37 | /* | ||
38 | * Deallocates the grant reference, allowing the associated page to be freed if | ||
39 | * no other domains are using it. | ||
40 | */ | ||
41 | #define IOCTL_GNTALLOC_DEALLOC_GREF \ | ||
42 | _IOC(_IOC_NONE, 'G', 6, sizeof(struct ioctl_gntalloc_dealloc_gref)) | ||
43 | struct ioctl_gntalloc_dealloc_gref { | ||
44 | /* IN parameters */ | ||
45 | /* The offset returned in the map operation */ | ||
46 | uint64_t index; | ||
47 | /* Number of references to unmap */ | ||
48 | uint32_t count; | ||
49 | }; | ||
50 | |||
51 | /* | ||
52 | * Sets up an unmap notification within the page, so that the other side can do | ||
53 | * cleanup if this side crashes. Required to implement cross-domain robust | ||
54 | * mutexes or close notification on communication channels. | ||
55 | * | ||
56 | * Each mapped page only supports one notification; multiple calls referring to | ||
57 | * the same page overwrite the previous notification. You must clear the | ||
58 | * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it | ||
59 | * to occur. | ||
60 | */ | ||
61 | #define IOCTL_GNTALLOC_SET_UNMAP_NOTIFY \ | ||
62 | _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntalloc_unmap_notify)) | ||
63 | struct ioctl_gntalloc_unmap_notify { | ||
64 | /* IN parameters */ | ||
65 | /* Offset in the file descriptor for a byte within the page (same as | ||
66 | * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to | ||
67 | * be cleared. Otherwise, it can be any byte in the page whose | ||
68 | * notification we are adjusting. | ||
69 | */ | ||
70 | uint64_t index; | ||
71 | /* Action(s) to take on unmap */ | ||
72 | uint32_t action; | ||
73 | /* Event channel to notify */ | ||
74 | uint32_t event_channel_port; | ||
75 | }; | ||
76 | |||
77 | /* Clear (set to zero) the byte specified by index */ | ||
78 | #define UNMAP_NOTIFY_CLEAR_BYTE 0x1 | ||
79 | /* Send an interrupt on the indicated event channel */ | ||
80 | #define UNMAP_NOTIFY_SEND_EVENT 0x2 | ||
81 | |||
82 | #endif /* __LINUX_PUBLIC_GNTALLOC_H__ */ | ||
diff --git a/include/xen/gntdev.h b/include/xen/gntdev.h index eb23f4188f5a..5304bd3c84c5 100644 --- a/include/xen/gntdev.h +++ b/include/xen/gntdev.h | |||
@@ -116,4 +116,35 @@ struct ioctl_gntdev_set_max_grants { | |||
116 | uint32_t count; | 116 | uint32_t count; |
117 | }; | 117 | }; |
118 | 118 | ||
119 | /* | ||
120 | * Sets up an unmap notification within the page, so that the other side can do | ||
121 | * cleanup if this side crashes. Required to implement cross-domain robust | ||
122 | * mutexes or close notification on communication channels. | ||
123 | * | ||
124 | * Each mapped page only supports one notification; multiple calls referring to | ||
125 | * the same page overwrite the previous notification. You must clear the | ||
126 | * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it | ||
127 | * to occur. | ||
128 | */ | ||
129 | #define IOCTL_GNTDEV_SET_UNMAP_NOTIFY \ | ||
130 | _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify)) | ||
131 | struct ioctl_gntdev_unmap_notify { | ||
132 | /* IN parameters */ | ||
133 | /* Offset in the file descriptor for a byte within the page (same as | ||
134 | * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to | ||
135 | * be cleared. Otherwise, it can be any byte in the page whose | ||
136 | * notification we are adjusting. | ||
137 | */ | ||
138 | uint64_t index; | ||
139 | /* Action(s) to take on unmap */ | ||
140 | uint32_t action; | ||
141 | /* Event channel to notify */ | ||
142 | uint32_t event_channel_port; | ||
143 | }; | ||
144 | |||
145 | /* Clear (set to zero) the byte specified by index */ | ||
146 | #define UNMAP_NOTIFY_CLEAR_BYTE 0x1 | ||
147 | /* Send an interrupt on the indicated event channel */ | ||
148 | #define UNMAP_NOTIFY_SEND_EVENT 0x2 | ||
149 | |||
119 | #endif /* __LINUX_PUBLIC_GNTDEV_H__ */ | 150 | #endif /* __LINUX_PUBLIC_GNTDEV_H__ */ |
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index c2d1fa4dc1ee..61e523af3c46 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
@@ -51,11 +51,7 @@ typedef uint64_t blkif_sector_t; | |||
51 | */ | 51 | */ |
52 | #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 | 52 | #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 |
53 | 53 | ||
54 | struct blkif_request { | 54 | struct blkif_request_rw { |
55 | uint8_t operation; /* BLKIF_OP_??? */ | ||
56 | uint8_t nr_segments; /* number of segments */ | ||
57 | blkif_vdev_t handle; /* only for read/write requests */ | ||
58 | uint64_t id; /* private guest value, echoed in resp */ | ||
59 | blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ | 55 | blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ |
60 | struct blkif_request_segment { | 56 | struct blkif_request_segment { |
61 | grant_ref_t gref; /* reference to I/O buffer frame */ | 57 | grant_ref_t gref; /* reference to I/O buffer frame */ |
@@ -65,6 +61,16 @@ struct blkif_request { | |||
65 | } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | 61 | } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; |
66 | }; | 62 | }; |
67 | 63 | ||
64 | struct blkif_request { | ||
65 | uint8_t operation; /* BLKIF_OP_??? */ | ||
66 | uint8_t nr_segments; /* number of segments */ | ||
67 | blkif_vdev_t handle; /* only for read/write requests */ | ||
68 | uint64_t id; /* private guest value, echoed in resp */ | ||
69 | union { | ||
70 | struct blkif_request_rw rw; | ||
71 | } u; | ||
72 | }; | ||
73 | |||
68 | struct blkif_response { | 74 | struct blkif_response { |
69 | uint64_t id; /* copied from request */ | 75 | uint64_t id; /* copied from request */ |
70 | uint8_t operation; /* copied from request */ | 76 | uint8_t operation; /* copied from request */ |
@@ -91,4 +97,25 @@ DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response); | |||
91 | #define VDISK_REMOVABLE 0x2 | 97 | #define VDISK_REMOVABLE 0x2 |
92 | #define VDISK_READONLY 0x4 | 98 | #define VDISK_READONLY 0x4 |
93 | 99 | ||
100 | /* Xen-defined major numbers for virtual disks, they look strangely | ||
101 | * familiar */ | ||
102 | #define XEN_IDE0_MAJOR 3 | ||
103 | #define XEN_IDE1_MAJOR 22 | ||
104 | #define XEN_SCSI_DISK0_MAJOR 8 | ||
105 | #define XEN_SCSI_DISK1_MAJOR 65 | ||
106 | #define XEN_SCSI_DISK2_MAJOR 66 | ||
107 | #define XEN_SCSI_DISK3_MAJOR 67 | ||
108 | #define XEN_SCSI_DISK4_MAJOR 68 | ||
109 | #define XEN_SCSI_DISK5_MAJOR 69 | ||
110 | #define XEN_SCSI_DISK6_MAJOR 70 | ||
111 | #define XEN_SCSI_DISK7_MAJOR 71 | ||
112 | #define XEN_SCSI_DISK8_MAJOR 128 | ||
113 | #define XEN_SCSI_DISK9_MAJOR 129 | ||
114 | #define XEN_SCSI_DISK10_MAJOR 130 | ||
115 | #define XEN_SCSI_DISK11_MAJOR 131 | ||
116 | #define XEN_SCSI_DISK12_MAJOR 132 | ||
117 | #define XEN_SCSI_DISK13_MAJOR 133 | ||
118 | #define XEN_SCSI_DISK14_MAJOR 134 | ||
119 | #define XEN_SCSI_DISK15_MAJOR 135 | ||
120 | |||
94 | #endif /* __XEN_PUBLIC_IO_BLKIF_H__ */ | 121 | #endif /* __XEN_PUBLIC_IO_BLKIF_H__ */ |
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h index 518481c95f18..cb94668f6e9f 100644 --- a/include/xen/interface/io/netif.h +++ b/include/xen/interface/io/netif.h | |||
@@ -22,50 +22,50 @@ | |||
22 | 22 | ||
23 | /* | 23 | /* |
24 | * This is the 'wire' format for packets: | 24 | * This is the 'wire' format for packets: |
25 | * Request 1: netif_tx_request -- NETTXF_* (any flags) | 25 | * Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags) |
26 | * [Request 2: netif_tx_extra] (only if request 1 has NETTXF_extra_info) | 26 | * [Request 2: xen_netif_extra_info] (only if request 1 has XEN_NETTXF_extra_info) |
27 | * [Request 3: netif_tx_extra] (only if request 2 has XEN_NETIF_EXTRA_MORE) | 27 | * [Request 3: xen_netif_extra_info] (only if request 2 has XEN_NETIF_EXTRA_MORE) |
28 | * Request 4: netif_tx_request -- NETTXF_more_data | 28 | * Request 4: xen_netif_tx_request -- XEN_NETTXF_more_data |
29 | * Request 5: netif_tx_request -- NETTXF_more_data | 29 | * Request 5: xen_netif_tx_request -- XEN_NETTXF_more_data |
30 | * ... | 30 | * ... |
31 | * Request N: netif_tx_request -- 0 | 31 | * Request N: xen_netif_tx_request -- 0 |
32 | */ | 32 | */ |
33 | 33 | ||
34 | /* Protocol checksum field is blank in the packet (hardware offload)? */ | 34 | /* Protocol checksum field is blank in the packet (hardware offload)? */ |
35 | #define _NETTXF_csum_blank (0) | 35 | #define _XEN_NETTXF_csum_blank (0) |
36 | #define NETTXF_csum_blank (1U<<_NETTXF_csum_blank) | 36 | #define XEN_NETTXF_csum_blank (1U<<_XEN_NETTXF_csum_blank) |
37 | 37 | ||
38 | /* Packet data has been validated against protocol checksum. */ | 38 | /* Packet data has been validated against protocol checksum. */ |
39 | #define _NETTXF_data_validated (1) | 39 | #define _XEN_NETTXF_data_validated (1) |
40 | #define NETTXF_data_validated (1U<<_NETTXF_data_validated) | 40 | #define XEN_NETTXF_data_validated (1U<<_XEN_NETTXF_data_validated) |
41 | 41 | ||
42 | /* Packet continues in the next request descriptor. */ | 42 | /* Packet continues in the next request descriptor. */ |
43 | #define _NETTXF_more_data (2) | 43 | #define _XEN_NETTXF_more_data (2) |
44 | #define NETTXF_more_data (1U<<_NETTXF_more_data) | 44 | #define XEN_NETTXF_more_data (1U<<_XEN_NETTXF_more_data) |
45 | 45 | ||
46 | /* Packet to be followed by extra descriptor(s). */ | 46 | /* Packet to be followed by extra descriptor(s). */ |
47 | #define _NETTXF_extra_info (3) | 47 | #define _XEN_NETTXF_extra_info (3) |
48 | #define NETTXF_extra_info (1U<<_NETTXF_extra_info) | 48 | #define XEN_NETTXF_extra_info (1U<<_XEN_NETTXF_extra_info) |
49 | 49 | ||
50 | struct xen_netif_tx_request { | 50 | struct xen_netif_tx_request { |
51 | grant_ref_t gref; /* Reference to buffer page */ | 51 | grant_ref_t gref; /* Reference to buffer page */ |
52 | uint16_t offset; /* Offset within buffer page */ | 52 | uint16_t offset; /* Offset within buffer page */ |
53 | uint16_t flags; /* NETTXF_* */ | 53 | uint16_t flags; /* XEN_NETTXF_* */ |
54 | uint16_t id; /* Echoed in response message. */ | 54 | uint16_t id; /* Echoed in response message. */ |
55 | uint16_t size; /* Packet size in bytes. */ | 55 | uint16_t size; /* Packet size in bytes. */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /* Types of netif_extra_info descriptors. */ | 58 | /* Types of xen_netif_extra_info descriptors. */ |
59 | #define XEN_NETIF_EXTRA_TYPE_NONE (0) /* Never used - invalid */ | 59 | #define XEN_NETIF_EXTRA_TYPE_NONE (0) /* Never used - invalid */ |
60 | #define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */ | 60 | #define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */ |
61 | #define XEN_NETIF_EXTRA_TYPE_MAX (2) | 61 | #define XEN_NETIF_EXTRA_TYPE_MAX (2) |
62 | 62 | ||
63 | /* netif_extra_info flags. */ | 63 | /* xen_netif_extra_info flags. */ |
64 | #define _XEN_NETIF_EXTRA_FLAG_MORE (0) | 64 | #define _XEN_NETIF_EXTRA_FLAG_MORE (0) |
65 | #define XEN_NETIF_EXTRA_FLAG_MORE (1U<<_XEN_NETIF_EXTRA_FLAG_MORE) | 65 | #define XEN_NETIF_EXTRA_FLAG_MORE (1U<<_XEN_NETIF_EXTRA_FLAG_MORE) |
66 | 66 | ||
67 | /* GSO types - only TCPv4 currently supported. */ | 67 | /* GSO types - only TCPv4 currently supported. */ |
68 | #define XEN_NETIF_GSO_TYPE_TCPV4 (1) | 68 | #define XEN_NETIF_GSO_TYPE_TCPV4 (1) |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * This structure needs to fit within both netif_tx_request and | 71 | * This structure needs to fit within both netif_tx_request and |
@@ -107,7 +107,7 @@ struct xen_netif_extra_info { | |||
107 | 107 | ||
108 | struct xen_netif_tx_response { | 108 | struct xen_netif_tx_response { |
109 | uint16_t id; | 109 | uint16_t id; |
110 | int16_t status; /* NETIF_RSP_* */ | 110 | int16_t status; /* XEN_NETIF_RSP_* */ |
111 | }; | 111 | }; |
112 | 112 | ||
113 | struct xen_netif_rx_request { | 113 | struct xen_netif_rx_request { |
@@ -116,25 +116,29 @@ struct xen_netif_rx_request { | |||
116 | }; | 116 | }; |
117 | 117 | ||
118 | /* Packet data has been validated against protocol checksum. */ | 118 | /* Packet data has been validated against protocol checksum. */ |
119 | #define _NETRXF_data_validated (0) | 119 | #define _XEN_NETRXF_data_validated (0) |
120 | #define NETRXF_data_validated (1U<<_NETRXF_data_validated) | 120 | #define XEN_NETRXF_data_validated (1U<<_XEN_NETRXF_data_validated) |
121 | 121 | ||
122 | /* Protocol checksum field is blank in the packet (hardware offload)? */ | 122 | /* Protocol checksum field is blank in the packet (hardware offload)? */ |
123 | #define _NETRXF_csum_blank (1) | 123 | #define _XEN_NETRXF_csum_blank (1) |
124 | #define NETRXF_csum_blank (1U<<_NETRXF_csum_blank) | 124 | #define XEN_NETRXF_csum_blank (1U<<_XEN_NETRXF_csum_blank) |
125 | 125 | ||
126 | /* Packet continues in the next request descriptor. */ | 126 | /* Packet continues in the next request descriptor. */ |
127 | #define _NETRXF_more_data (2) | 127 | #define _XEN_NETRXF_more_data (2) |
128 | #define NETRXF_more_data (1U<<_NETRXF_more_data) | 128 | #define XEN_NETRXF_more_data (1U<<_XEN_NETRXF_more_data) |
129 | 129 | ||
130 | /* Packet to be followed by extra descriptor(s). */ | 130 | /* Packet to be followed by extra descriptor(s). */ |
131 | #define _NETRXF_extra_info (3) | 131 | #define _XEN_NETRXF_extra_info (3) |
132 | #define NETRXF_extra_info (1U<<_NETRXF_extra_info) | 132 | #define XEN_NETRXF_extra_info (1U<<_XEN_NETRXF_extra_info) |
133 | |||
134 | /* GSO Prefix descriptor. */ | ||
135 | #define _XEN_NETRXF_gso_prefix (4) | ||
136 | #define XEN_NETRXF_gso_prefix (1U<<_XEN_NETRXF_gso_prefix) | ||
133 | 137 | ||
134 | struct xen_netif_rx_response { | 138 | struct xen_netif_rx_response { |
135 | uint16_t id; | 139 | uint16_t id; |
136 | uint16_t offset; /* Offset in page of start of received packet */ | 140 | uint16_t offset; /* Offset in page of start of received packet */ |
137 | uint16_t flags; /* NETRXF_* */ | 141 | uint16_t flags; /* XEN_NETRXF_* */ |
138 | int16_t status; /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */ | 142 | int16_t status; /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */ |
139 | }; | 143 | }; |
140 | 144 | ||
@@ -149,10 +153,10 @@ DEFINE_RING_TYPES(xen_netif_rx, | |||
149 | struct xen_netif_rx_request, | 153 | struct xen_netif_rx_request, |
150 | struct xen_netif_rx_response); | 154 | struct xen_netif_rx_response); |
151 | 155 | ||
152 | #define NETIF_RSP_DROPPED -2 | 156 | #define XEN_NETIF_RSP_DROPPED -2 |
153 | #define NETIF_RSP_ERROR -1 | 157 | #define XEN_NETIF_RSP_ERROR -1 |
154 | #define NETIF_RSP_OKAY 0 | 158 | #define XEN_NETIF_RSP_OKAY 0 |
155 | /* No response: used for auxiliary requests (e.g., netif_tx_extra). */ | 159 | /* No response: used for auxiliary requests (e.g., xen_netif_extra_info). */ |
156 | #define NETIF_RSP_NULL 1 | 160 | #define XEN_NETIF_RSP_NULL 1 |
157 | 161 | ||
158 | #endif | 162 | #endif |
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h index 5fec575a800a..dd55dac340de 100644 --- a/include/xen/interface/sched.h +++ b/include/xen/interface/sched.h | |||
@@ -65,6 +65,39 @@ struct sched_poll { | |||
65 | DEFINE_GUEST_HANDLE_STRUCT(sched_poll); | 65 | DEFINE_GUEST_HANDLE_STRUCT(sched_poll); |
66 | 66 | ||
67 | /* | 67 | /* |
68 | * Declare a shutdown for another domain. The main use of this function is | ||
69 | * in interpreting shutdown requests and reasons for fully-virtualized | ||
70 | * domains. A para-virtualized domain may use SCHEDOP_shutdown directly. | ||
71 | * @arg == pointer to sched_remote_shutdown structure. | ||
72 | */ | ||
73 | #define SCHEDOP_remote_shutdown 4 | ||
74 | struct sched_remote_shutdown { | ||
75 | domid_t domain_id; /* Remote domain ID */ | ||
76 | unsigned int reason; /* SHUTDOWN_xxx reason */ | ||
77 | }; | ||
78 | |||
79 | /* | ||
80 | * Latch a shutdown code, so that when the domain later shuts down it | ||
81 | * reports this code to the control tools. | ||
82 | * @arg == as for SCHEDOP_shutdown. | ||
83 | */ | ||
84 | #define SCHEDOP_shutdown_code 5 | ||
85 | |||
86 | /* | ||
87 | * Setup, poke and destroy a domain watchdog timer. | ||
88 | * @arg == pointer to sched_watchdog structure. | ||
89 | * With id == 0, setup a domain watchdog timer to cause domain shutdown | ||
90 | * after timeout, returns watchdog id. | ||
91 | * With id != 0 and timeout == 0, destroy domain watchdog timer. | ||
92 | * With id != 0 and timeout != 0, poke watchdog timer and set new timeout. | ||
93 | */ | ||
94 | #define SCHEDOP_watchdog 6 | ||
95 | struct sched_watchdog { | ||
96 | uint32_t id; /* watchdog ID */ | ||
97 | uint32_t timeout; /* timeout */ | ||
98 | }; | ||
99 | |||
100 | /* | ||
68 | * Reason codes for SCHEDOP_shutdown. These may be interpreted by control | 101 | * Reason codes for SCHEDOP_shutdown. These may be interpreted by control |
69 | * software to determine the appropriate action. For the most part, Xen does | 102 | * software to determine the appropriate action. For the most part, Xen does |
70 | * not care about the shutdown code. | 103 | * not care about the shutdown code. |
@@ -73,5 +106,6 @@ DEFINE_GUEST_HANDLE_STRUCT(sched_poll); | |||
73 | #define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */ | 106 | #define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */ |
74 | #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ | 107 | #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ |
75 | #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ | 108 | #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ |
109 | #define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */ | ||
76 | 110 | ||
77 | #endif /* __XEN_PUBLIC_SCHED_H__ */ | 111 | #endif /* __XEN_PUBLIC_SCHED_H__ */ |
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index 2befa3e2f1bc..b33257bc7e83 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #define __HYPERVISOR_stack_switch 3 | 30 | #define __HYPERVISOR_stack_switch 3 |
31 | #define __HYPERVISOR_set_callbacks 4 | 31 | #define __HYPERVISOR_set_callbacks 4 |
32 | #define __HYPERVISOR_fpu_taskswitch 5 | 32 | #define __HYPERVISOR_fpu_taskswitch 5 |
33 | #define __HYPERVISOR_sched_op 6 | 33 | #define __HYPERVISOR_sched_op_compat 6 |
34 | #define __HYPERVISOR_dom0_op 7 | 34 | #define __HYPERVISOR_dom0_op 7 |
35 | #define __HYPERVISOR_set_debugreg 8 | 35 | #define __HYPERVISOR_set_debugreg 8 |
36 | #define __HYPERVISOR_get_debugreg 9 | 36 | #define __HYPERVISOR_get_debugreg 9 |
@@ -52,7 +52,7 @@ | |||
52 | #define __HYPERVISOR_mmuext_op 26 | 52 | #define __HYPERVISOR_mmuext_op 26 |
53 | #define __HYPERVISOR_acm_op 27 | 53 | #define __HYPERVISOR_acm_op 27 |
54 | #define __HYPERVISOR_nmi_op 28 | 54 | #define __HYPERVISOR_nmi_op 28 |
55 | #define __HYPERVISOR_sched_op_new 29 | 55 | #define __HYPERVISOR_sched_op 29 |
56 | #define __HYPERVISOR_callback_op 30 | 56 | #define __HYPERVISOR_callback_op 30 |
57 | #define __HYPERVISOR_xenoprof_op 31 | 57 | #define __HYPERVISOR_xenoprof_op 31 |
58 | #define __HYPERVISOR_event_channel_op 32 | 58 | #define __HYPERVISOR_event_channel_op 32 |
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h index 98b92154a264..03c85d7387fb 100644 --- a/include/xen/xen-ops.h +++ b/include/xen/xen-ops.h | |||
@@ -5,9 +5,9 @@ | |||
5 | 5 | ||
6 | DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); | 6 | DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); |
7 | 7 | ||
8 | void xen_pre_suspend(void); | 8 | void xen_arch_pre_suspend(void); |
9 | void xen_post_suspend(int suspend_cancelled); | 9 | void xen_arch_post_suspend(int suspend_cancelled); |
10 | void xen_hvm_post_suspend(int suspend_cancelled); | 10 | void xen_arch_hvm_post_suspend(int suspend_cancelled); |
11 | 11 | ||
12 | void xen_mm_pin_all(void); | 12 | void xen_mm_pin_all(void); |
13 | void xen_mm_unpin_all(void); | 13 | void xen_mm_unpin_all(void); |