FreeBSD kernel /amd64 XEN device code
|
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/uio.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/conf.h>
#include <sys/module.h>
#include <sys/selinfo.h>
#include <sys/sysctl.h>
#include <sys/poll.h>
#include <xen/xen-os.h>
#include <xen/hypervisor.h>
#include <xen/xenstore/xenstorevar.h>
#include <xen/xenstore/xenstore_internal.h>
Go to the source code of this file.
Data Structures | |
struct | xs_dev_transaction |
struct | xs_dev_watch |
struct | xs_dev_data |
Macros | |
#define | MASK_READ_IDX(idx) ((idx)&(PAGE_SIZE-1)) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | xs_queue_reply (struct xs_dev_data *u, const char *data, unsigned int len) |
static const char * | xs_dev_error_to_string (int error) |
static void | xs_dev_return_error (struct xs_dev_data *u, int error, int req_id, int tx_id) |
static int | xs_dev_watch_message_parse_string (const char **p, const char *end, const char **string_r) |
static int | xs_dev_watch_message_parse (const struct xsd_sockmsg *msg, const char **path_r, const char **token_r) |
static struct xs_dev_watch * | xs_dev_find_watch (struct xs_dev_data *u, const char *token) |
static void | xs_dev_watch_cb (struct xs_watch *watch, const char **vec, unsigned int len) |
static struct xs_dev_transaction * | xs_dev_find_transaction (struct xs_dev_data *u, uint32_t tx_id) |
static int | xs_dev_read (struct cdev *dev, struct uio *uio, int ioflag) |
static int | xs_dev_write (struct cdev *dev, struct uio *uio, int ioflag) |
static int | xs_dev_poll (struct cdev *dev, int events, struct thread *td) |
static void | xs_dev_dtor (void *arg) |
static int | xs_dev_open (struct cdev *dev, int oflags, int devtype, struct thread *td) |
static void | xs_dev_identify (driver_t *driver __unused, device_t parent) |
Identify instances of this device type in the system. More... | |
static int | xs_dev_probe (device_t dev) |
Probe for the existence of the Xenstore device. More... | |
static int | xs_dev_attach (device_t dev) |
Attach the Xenstore device. More... | |
DEFINE_CLASS_0 (xs_dev, xs_dev_driver, xs_dev_methods, 0) | |
DRIVER_MODULE (xs_dev, xenstore, xs_dev_driver, xs_dev_devclass, NULL, NULL) | |
Variables | |
static unsigned int | max_pending_watches = 1000 |
static struct cdevsw | xs_dev_cdevsw |
static device_method_t | xs_dev_methods [] |
devclass_t | xs_dev_devclass |
#define MASK_READ_IDX | ( | idx | ) | ((idx)&(PAGE_SIZE-1)) |
Definition at line 85 of file xenstore_dev.c.
__FBSDID | ( | "$FreeBSD$" | ) |
DEFINE_CLASS_0 | ( | xs_dev | , |
xs_dev_driver | , | ||
xs_dev_methods | , | ||
0 | |||
) |
DRIVER_MODULE | ( | xs_dev | , |
xenstore | , | ||
xs_dev_driver | , | ||
xs_dev_devclass | , | ||
NULL | , | ||
NULL | |||
) |
|
static |
Attach the Xenstore device.
dev | NewBus device_t for this instance. |
Definition at line 513 of file xenstore_dev.c.
References max_pending_watches, and xs_dev_cdevsw.
|
static |
Definition at line 420 of file xenstore_dev.c.
References xs_dev_data::ev_rsel, xs_dev_data::lock, xs_dev_data::u, xs_transaction_end(), and xs_unregister_watch().
Referenced by xs_dev_open().
|
static |
Definition at line 112 of file xenstore_dev.c.
Referenced by xs_dev_return_error().
|
static |
Definition at line 219 of file xenstore_dev.c.
Referenced by xs_dev_write().
|
static |
Definition at line 185 of file xenstore_dev.c.
Referenced by xs_dev_write().
|
static |
Identify instances of this device type in the system.
driver | The driver performing this identify action. |
parent | The NewBus parent device for any devices this method adds. |
Definition at line 480 of file xenstore_dev.c.
|
static |
Definition at line 447 of file xenstore_dev.c.
References xs_dev_data::u, and xs_dev_dtor().
|
static |
Definition at line 395 of file xenstore_dev.c.
References xs_dev_data::u.
|
static |
Probe for the existence of the Xenstore device.
dev | NewBus device_t for this instance. |
Definition at line 497 of file xenstore_dev.c.
|
static |
Definition at line 231 of file xenstore_dev.c.
References MASK_READ_IDX, and xs_dev_data::u.
|
static |
Definition at line 124 of file xenstore_dev.c.
References xs_dev_data::lock, xs_dev_error_to_string(), and xs_queue_reply().
Referenced by xs_dev_write().
|
static |
Definition at line 197 of file xenstore_dev.c.
References xs_queue_reply().
Referenced by xs_dev_write().
|
static |
Definition at line 164 of file xenstore_dev.c.
References xs_dev_watch_message_parse_string().
Referenced by xs_dev_write().
|
static |
Definition at line 148 of file xenstore_dev.c.
Referenced by xs_dev_watch_message_parse().
|
static |
Definition at line 259 of file xenstore_dev.c.
References xs_dev_data::lock, max_pending_watches, xs_dev_data::u, xs_dev_find_transaction(), xs_dev_find_watch(), xs_dev_request_and_reply(), xs_dev_return_error(), xs_dev_watch_cb(), xs_dev_watch_message_parse(), xs_queue_reply(), xs_register_watch(), and xs_unregister_watch().
|
static |
Definition at line 97 of file xenstore_dev.c.
References xs_dev_data::ev_rsel, MASK_READ_IDX, xs_dev_data::read_buffer, xs_dev_data::read_cons, and xs_dev_data::read_prod.
Referenced by xs_dev_return_error(), xs_dev_watch_cb(), and xs_dev_write().
|
static |
Definition at line 56 of file xenstore_dev.c.
Referenced by xs_dev_attach(), and xs_dev_write().
|
static |
Definition at line 463 of file xenstore_dev.c.
Referenced by xs_dev_attach().
devclass_t xs_dev_devclass |
Definition at line 547 of file xenstore_dev.c.
|
static |
Definition at line 537 of file xenstore_dev.c.