.. | .. |
---|
42 | 42 | #include <linux/completion.h> |
---|
43 | 43 | #include <linux/init.h> |
---|
44 | 44 | #include <linux/slab.h> |
---|
| 45 | +#include <linux/semaphore.h> |
---|
45 | 46 | #include <xen/interface/xen.h> |
---|
46 | 47 | #include <xen/interface/grant_table.h> |
---|
47 | 48 | #include <xen/interface/io/xenbus.h> |
---|
48 | 49 | #include <xen/interface/io/xs_wire.h> |
---|
| 50 | +#include <xen/interface/event_channel.h> |
---|
49 | 51 | |
---|
50 | 52 | #define XENBUS_MAX_RING_GRANT_ORDER 4 |
---|
51 | 53 | #define XENBUS_MAX_RING_GRANTS (1U << XENBUS_MAX_RING_GRANT_ORDER) |
---|
.. | .. |
---|
85 | 87 | enum xenbus_state state; |
---|
86 | 88 | struct completion down; |
---|
87 | 89 | struct work_struct work; |
---|
| 90 | + struct semaphore reclaim_sem; |
---|
88 | 91 | }; |
---|
89 | 92 | |
---|
90 | 93 | static inline struct xenbus_device *to_xenbus_device(struct device *dev) |
---|
.. | .. |
---|
102 | 105 | struct xenbus_driver { |
---|
103 | 106 | const char *name; /* defaults to ids[0].devicetype */ |
---|
104 | 107 | const struct xenbus_device_id *ids; |
---|
| 108 | + bool allow_rebind; /* avoid setting xenstore closed during remove */ |
---|
105 | 109 | int (*probe)(struct xenbus_device *dev, |
---|
106 | 110 | const struct xenbus_device_id *id); |
---|
107 | 111 | void (*otherend_changed)(struct xenbus_device *dev, |
---|
.. | .. |
---|
113 | 117 | struct device_driver driver; |
---|
114 | 118 | int (*read_otherend_details)(struct xenbus_device *dev); |
---|
115 | 119 | int (*is_ready)(struct xenbus_device *dev); |
---|
| 120 | + void (*reclaim_memory)(struct xenbus_device *dev); |
---|
116 | 121 | }; |
---|
117 | 122 | |
---|
118 | 123 | static inline struct xenbus_driver *to_xenbus_driver(struct device_driver *drv) |
---|
.. | .. |
---|
216 | 221 | unsigned int nr_pages, grant_ref_t *grefs); |
---|
217 | 222 | int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs, |
---|
218 | 223 | unsigned int nr_grefs, void **vaddr); |
---|
219 | | -int xenbus_map_ring(struct xenbus_device *dev, |
---|
220 | | - grant_ref_t *gnt_refs, unsigned int nr_grefs, |
---|
221 | | - grant_handle_t *handles, unsigned long *vaddrs, |
---|
222 | | - bool *leaked); |
---|
223 | 224 | |
---|
224 | 225 | int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr); |
---|
225 | | -int xenbus_unmap_ring(struct xenbus_device *dev, |
---|
226 | | - grant_handle_t *handles, unsigned int nr_handles, |
---|
227 | | - unsigned long *vaddrs); |
---|
228 | 226 | |
---|
229 | | -int xenbus_alloc_evtchn(struct xenbus_device *dev, int *port); |
---|
230 | | -int xenbus_free_evtchn(struct xenbus_device *dev, int port); |
---|
| 227 | +int xenbus_alloc_evtchn(struct xenbus_device *dev, evtchn_port_t *port); |
---|
| 228 | +int xenbus_free_evtchn(struct xenbus_device *dev, evtchn_port_t port); |
---|
231 | 229 | |
---|
232 | 230 | enum xenbus_state xenbus_read_driver_state(const char *path); |
---|
233 | 231 | |
---|