xenbusvar.h (214077) | xenbusvar.h (222975) |
---|---|
1/****************************************************************************** 2 * Copyright (C) 2005 Rusty Russell, IBM Corporation 3 * Copyright (C) 2005 XenSource Ltd. 4 * 5 * This file may be distributed separately from the Linux kernel, or 6 * incorporated into other software packages, subject to the following license: 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 9 unchanged lines hidden (view full) --- 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 24 * IN THE SOFTWARE. 25 * | 1/****************************************************************************** 2 * Copyright (C) 2005 Rusty Russell, IBM Corporation 3 * Copyright (C) 2005 XenSource Ltd. 4 * 5 * This file may be distributed separately from the Linux kernel, or 6 * incorporated into other software packages, subject to the following license: 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 9 unchanged lines hidden (view full) --- 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 24 * IN THE SOFTWARE. 25 * |
26 * $FreeBSD: head/sys/xen/xenbus/xenbusvar.h 214077 2010-10-19 20:53:30Z gibbs $ | 26 * $FreeBSD: head/sys/xen/xenbus/xenbusvar.h 222975 2011-06-11 04:59:01Z gibbs $ |
27 */ 28 29/** 30 * \file xenbusvar.h 31 * 32 * \brief Datastructures and function declarations for usedby device 33 * drivers operating on the XenBus. 34 */ --- 11 unchanged lines hidden (view full) --- 46#include <machine/xen/xen-os.h> 47 48#include <xen/interface/grant_table.h> 49#include <xen/interface/io/xenbus.h> 50#include <xen/interface/io/xs_wire.h> 51 52#include <xen/xenstore/xenstorevar.h> 53 | 27 */ 28 29/** 30 * \file xenbusvar.h 31 * 32 * \brief Datastructures and function declarations for usedby device 33 * drivers operating on the XenBus. 34 */ --- 11 unchanged lines hidden (view full) --- 46#include <machine/xen/xen-os.h> 47 48#include <xen/interface/grant_table.h> 49#include <xen/interface/io/xenbus.h> 50#include <xen/interface/io/xs_wire.h> 51 52#include <xen/xenstore/xenstorevar.h> 53 |
54#include "xenbus_if.h" 55 | |
56/* XenBus allocations including XenStore data returned to clients. */ 57MALLOC_DECLARE(M_XENBUS); 58 59enum { 60 /** 61 * Path of this device node. 62 */ 63 XENBUS_IVAR_NODE, --- 47 unchanged lines hidden (view full) --- 111 * \param dev The XenBus device requesting the watch service. 112 * \param path The XenStore path of the object to be watched. The 113 * storage for this string must be stable for the lifetime 114 * of the watch. 115 * \param watch The watch object to use for this request. This object 116 * must be stable for the lifetime of the watch. 117 * \param callback The function to call when XenStore objects at or below 118 * path are modified. | 54/* XenBus allocations including XenStore data returned to clients. */ 55MALLOC_DECLARE(M_XENBUS); 56 57enum { 58 /** 59 * Path of this device node. 60 */ 61 XENBUS_IVAR_NODE, --- 47 unchanged lines hidden (view full) --- 109 * \param dev The XenBus device requesting the watch service. 110 * \param path The XenStore path of the object to be watched. The 111 * storage for this string must be stable for the lifetime 112 * of the watch. 113 * \param watch The watch object to use for this request. This object 114 * must be stable for the lifetime of the watch. 115 * \param callback The function to call when XenStore objects at or below 116 * path are modified. |
117 * \param cb_data Client data that can be retrieved from the watch object 118 * during the callback. |
|
119 * 120 * \return On success, 0. Otherwise an errno value indicating the 121 * type of failure. 122 * 123 * \note On error, the device 'dev' will be switched to the XenbusStateClosing 124 * state and the returned error is saved in the per-device error node 125 * for dev in the XenStore. 126 */ 127int xenbus_watch_path(device_t dev, char *path, 128 struct xs_watch *watch, | 119 * 120 * \return On success, 0. Otherwise an errno value indicating the 121 * type of failure. 122 * 123 * \note On error, the device 'dev' will be switched to the XenbusStateClosing 124 * state and the returned error is saved in the per-device error node 125 * for dev in the XenStore. 126 */ 127int xenbus_watch_path(device_t dev, char *path, 128 struct xs_watch *watch, |
129 xs_watch_cb_t *callback); | 129 xs_watch_cb_t *callback, 130 uintptr_t cb_data); |
130 131/** 132 * Initialize and register a watch at path/path2 in the XenStore. 133 * 134 * \param dev The XenBus device requesting the watch service. 135 * \param path The base XenStore path of the object to be watched. 136 * \param path2 The tail XenStore path of the object to be watched. 137 * \param watch The watch object to use for this request. This object 138 * must be stable for the lifetime of the watch. 139 * \param callback The function to call when XenStore objects at or below 140 * path are modified. | 131 132/** 133 * Initialize and register a watch at path/path2 in the XenStore. 134 * 135 * \param dev The XenBus device requesting the watch service. 136 * \param path The base XenStore path of the object to be watched. 137 * \param path2 The tail XenStore path of the object to be watched. 138 * \param watch The watch object to use for this request. This object 139 * must be stable for the lifetime of the watch. 140 * \param callback The function to call when XenStore objects at or below 141 * path are modified. |
142 * \param cb_data Client data that can be retrieved from the watch object 143 * during the callback. |
|
141 * 142 * \return On success, 0. Otherwise an errno value indicating the 143 * type of failure. 144 * 145 * \note On error, \a dev will be switched to the XenbusStateClosing 146 * state and the returned error is saved in the per-device error node 147 * for \a dev in the XenStore. 148 * 149 * Similar to xenbus_watch_path, however the storage for the path to the 150 * watched object is allocated from the heap and filled with "path '/' path2". 151 * Should a call to this function succeed, it is the callers responsibility 152 * to free watch->node using the M_XENBUS malloc type. 153 */ 154int xenbus_watch_path2(device_t dev, const char *path, 155 const char *path2, struct xs_watch *watch, | 144 * 145 * \return On success, 0. Otherwise an errno value indicating the 146 * type of failure. 147 * 148 * \note On error, \a dev will be switched to the XenbusStateClosing 149 * state and the returned error is saved in the per-device error node 150 * for \a dev in the XenStore. 151 * 152 * Similar to xenbus_watch_path, however the storage for the path to the 153 * watched object is allocated from the heap and filled with "path '/' path2". 154 * Should a call to this function succeed, it is the callers responsibility 155 * to free watch->node using the M_XENBUS malloc type. 156 */ 157int xenbus_watch_path2(device_t dev, const char *path, 158 const char *path2, struct xs_watch *watch, |
156 xs_watch_cb_t *callback); | 159 xs_watch_cb_t *callback, 160 uintptr_t cb_data); |
157 158/** 159 * Grant access to the given ring_mfn to the peer of the given device. 160 * 161 * \param dev The device granting access to the ring page. 162 * \param ring_mfn The guest machine page number of the page to grant 163 * peer access rights. 164 * \param refp[out] The grant reference for the page. --- 105 unchanged lines hidden (view full) --- 270 * 271 * \param dev The XenBus device to query. 272 * 273 * \return The value of the "online" node for the device. If the node 274 * does not exist, 0 (offline) is returned. 275 */ 276int xenbus_dev_is_online(device_t dev); 277 | 161 162/** 163 * Grant access to the given ring_mfn to the peer of the given device. 164 * 165 * \param dev The device granting access to the ring page. 166 * \param ring_mfn The guest machine page number of the page to grant 167 * peer access rights. 168 * \param refp[out] The grant reference for the page. --- 105 unchanged lines hidden (view full) --- 274 * 275 * \param dev The XenBus device to query. 276 * 277 * \return The value of the "online" node for the device. If the node 278 * does not exist, 0 (offline) is returned. 279 */ 280int xenbus_dev_is_online(device_t dev); 281 |
282/** 283 * Default callback invoked when a change to the local XenStore sub-tree 284 * for a device is modified. 285 * 286 * \param dev The XenBus device whose tree was modified. 287 * \param path The tree relative sub-path to the modified node. The empty 288 * string indicates the root of the tree was destroyed. 289 */ 290void xenbus_localend_changed(device_t dev, const char *path); 291 292#include "xenbus_if.h" 293 |
|
278#endif /* _XEN_XENBUS_XENBUSVAR_H */ | 294#endif /* _XEN_XENBUS_XENBUSVAR_H */ |