FreeBSD kernel /amd64 XEN device code
xs_softc Struct Reference

Data Fields

device_t xs_dev
 
struct mtx ring_lock
 
struct sx request_mutex
 
struct xs_stored_msg_list reply_list
 
struct mtx reply_lock
 
struct xs_watch_list registered_watches
 
struct mtx registered_watches_lock
 
struct xs_stored_msg_list watch_events
 
struct mtx watch_events_lock
 
pid_t xenwatch_pid
 
struct sx xenwatch_mutex
 
unsigned long gpfn
 
int evtchn
 
xen_intr_handle_t xen_intr_handle
 
struct intr_config_hook xs_attachcb
 
bool initialized
 
struct task xs_late_init
 

Detailed Description

Container for all XenStore related state.

Definition at line 148 of file xenstore.c.

Field Documentation

◆ evtchn

int xs_softc::evtchn

The event channel for communicating with the XenStore service.

Definition at line 230 of file xenstore.c.

Referenced by xs_attach(), xs_evtchn(), and xs_init_comms().

◆ gpfn

unsigned long xs_softc::gpfn

The HVM guest pseudo-physical frame number. This is Xen's mapping of the true machine frame number into our "physical address space".

Definition at line 224 of file xenstore.c.

Referenced by xs_address(), and xs_attach().

◆ initialized

bool xs_softc::initialized

Xenstore is a user-space process that usually runs in Dom0, so if this domain is booting as Dom0, xenstore wont we accessible, and we have to defer the initialization of xenstore related devices to later (when xenstore is started).

Definition at line 248 of file xenstore.c.

Referenced by xs_attach(), xs_initialized(), and xs_intr().

◆ registered_watches

struct xs_watch_list xs_softc::registered_watches

List of registered watches.

Definition at line 190 of file xenstore.c.

Referenced by find_watch(), xs_register_watch(), and xs_resume().

◆ registered_watches_lock

struct mtx xs_softc::registered_watches_lock

Lock protecting the registered watches list.

Definition at line 193 of file xenstore.c.

Referenced by xs_attach(), xs_process_msg(), xs_register_watch(), and xs_unregister_watch().

◆ reply_list

struct xs_stored_msg_list xs_softc::reply_list

A list of replies to our requests.

The reply list is filled by xs_rcv_thread(). It is consumed by the context that issued the request to which a reply is made. The requester blocks in xs_read_reply().

/note Only one requesting context can be active at a time. This is guaranteed by the request_mutex and insures that the requester sees replies matching the order of its requests.

Definition at line 182 of file xenstore.c.

Referenced by xs_attach(), xs_process_msg(), and xs_read_reply().

◆ reply_lock

struct mtx xs_softc::reply_lock

Lock protecting the reply list.

Definition at line 185 of file xenstore.c.

Referenced by xs_attach(), xs_process_msg(), and xs_read_reply().

◆ request_mutex

struct sx xs_softc::request_mutex

◆ ring_lock

struct mtx xs_softc::ring_lock

Lock serializing access to ring producer/consumer indexes. Use of this lock guarantees that wakeups of blocking readers/writers are not missed due to races with the XenStore service.

Definition at line 158 of file xenstore.c.

Referenced by xs_attach(), xs_intr(), xs_read_store(), and xs_write_store().

◆ watch_events

struct xs_stored_msg_list xs_softc::watch_events

List of pending watch callback events.

Definition at line 198 of file xenstore.c.

Referenced by xenwatch_thread(), xs_attach(), xs_process_msg(), and xs_unregister_watch().

◆ watch_events_lock

struct mtx xs_softc::watch_events_lock

Lock protecting the watch calback list.

Definition at line 201 of file xenstore.c.

Referenced by xenwatch_thread(), xs_attach(), xs_process_msg(), and xs_unregister_watch().

◆ xen_intr_handle

xen_intr_handle_t xs_softc::xen_intr_handle

Handle for XenStore interrupts.

Definition at line 233 of file xenstore.c.

Referenced by xs_init_comms(), xs_read_store(), and xs_write_store().

◆ xenwatch_mutex

struct sx xs_softc::xenwatch_mutex

Sleepable mutex used to gate the execution of XenStore watch event callbacks.

xenwatch_thread holds an exclusive lock on this mutex while delivering event callbacks, and xenstore_unregister_watch() uses an exclusive lock of this mutex to guarantee that no callbacks of the just unregistered watch are pending before returning to its caller.

Definition at line 218 of file xenstore.c.

Referenced by xenwatch_thread(), xs_attach(), and xs_unregister_watch().

◆ xenwatch_pid

pid_t xs_softc::xenwatch_pid

The processid of the xenwatch thread.

Definition at line 206 of file xenstore.c.

Referenced by xs_attach(), and xs_unregister_watch().

◆ xs_attachcb

struct intr_config_hook xs_softc::xs_attachcb

Interrupt driven config hook allowing us to defer attaching children until interrupts (and thus communication with the XenStore service) are available.

Definition at line 240 of file xenstore.c.

Referenced by xs_attach(), and xs_attach_deferred().

◆ xs_dev

device_t xs_softc::xs_dev

Newbus device for the XenStore.

Definition at line 150 of file xenstore.c.

Referenced by xs_attach(), xs_attach_deferred(), xs_attach_late(), and xs_init_comms().

◆ xs_late_init

struct task xs_softc::xs_late_init

Task to run when xenstore is initialized (Dom0 only), will take care of attaching xenstore related devices.

Definition at line 254 of file xenstore.c.

Referenced by xs_attach(), and xs_intr().


The documentation for this struct was generated from the following file: