include/xen/xenbus.h
Source file repositories/reference/linux-study-clean/include/xen/xenbus.h
File Facts
- System
- Linux kernel
- Corpus path
include/xen/xenbus.h- Extension
.h- Size
- 8875 bytes
- Lines
- 249
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/notifier.hlinux/mutex.hlinux/export.hlinux/fs.hlinux/completion.hlinux/init.hlinux/slab.hlinux/semaphore.hxen/interface/xen.hxen/interface/grant_table.hxen/interface/io/xenbus.hxen/interface/io/xs_wire.hxen/interface/event_channel.h
Detected Declarations
struct xenbus_watchstruct xenbus_devicestruct xenbus_device_idstruct xenbus_driverstruct xenbus_transactionstruct work_struct
Annotated Snippet
struct device_driver driver;
int (*read_otherend_details)(struct xenbus_device *dev);
int (*is_ready)(struct xenbus_device *dev);
void (*reclaim_memory)(struct xenbus_device *dev);
};
#define to_xenbus_driver(__drv) container_of_const(__drv, struct xenbus_driver, driver)
int __must_check __xenbus_register_frontend(struct xenbus_driver *drv,
struct module *owner,
const char *mod_name);
int __must_check __xenbus_register_backend(struct xenbus_driver *drv,
struct module *owner,
const char *mod_name);
#define xenbus_register_frontend(drv) \
__xenbus_register_frontend(drv, THIS_MODULE, KBUILD_MODNAME)
#define xenbus_register_backend(drv) \
__xenbus_register_backend(drv, THIS_MODULE, KBUILD_MODNAME)
void xenbus_unregister_driver(struct xenbus_driver *drv);
struct xenbus_transaction
{
u32 id;
};
/* Nil transaction ID. */
#define XBT_NIL ((struct xenbus_transaction) { 0 })
char **xenbus_directory(struct xenbus_transaction t,
const char *dir, const char *node, unsigned int *num);
void *xenbus_read(struct xenbus_transaction t,
const char *dir, const char *node, unsigned int *len);
int xenbus_write(struct xenbus_transaction t,
const char *dir, const char *node, const char *string);
int xenbus_exists(struct xenbus_transaction t,
const char *dir, const char *node);
int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *node);
int xenbus_transaction_start(struct xenbus_transaction *t);
int xenbus_transaction_end(struct xenbus_transaction t, bool abort);
/* Single read and scanf: returns -errno or num scanned if > 0. */
__scanf(4, 5)
int xenbus_scanf(struct xenbus_transaction t,
const char *dir, const char *node, const char *fmt, ...);
/* Read an (optional) unsigned value. */
unsigned int xenbus_read_unsigned(const char *dir, const char *node,
unsigned int default_val);
/* Single printf and write: returns -errno or 0. */
__printf(4, 5)
int xenbus_printf(struct xenbus_transaction t,
const char *dir, const char *node, const char *fmt, ...);
/* Generic read function: NULL-terminated triples of name,
* sprintf-style type string, and pointer. Returns 0 or errno.*/
int xenbus_gather(struct xenbus_transaction t, const char *dir, ...);
/* notifier routines for when the xenstore comes up */
extern int xenstored_ready;
int register_xenstore_notifier(struct notifier_block *nb);
void unregister_xenstore_notifier(struct notifier_block *nb);
int register_xenbus_watch(struct xenbus_watch *watch);
void unregister_xenbus_watch(struct xenbus_watch *watch);
void xs_suspend(void);
void xs_resume(void);
void xs_suspend_cancel(void);
struct work_struct;
#define XENBUS_IS_ERR_READ(str) ({ \
if (!IS_ERR(str) && strlen(str) == 0) { \
kfree(str); \
str = ERR_PTR(-ERANGE); \
} \
IS_ERR(str); \
})
#define XENBUS_EXIST_ERR(err) ((err) == -ENOENT || (err) == -ERANGE)
int xenbus_watch_path(struct xenbus_device *dev, const char *path,
struct xenbus_watch *watch,
bool (*will_handle)(struct xenbus_watch *,
const char *, const char *),
void (*callback)(struct xenbus_watch *,
const char *, const char *));
__printf(5, 6)
Annotation
- Immediate include surface: `linux/device.h`, `linux/notifier.h`, `linux/mutex.h`, `linux/export.h`, `linux/fs.h`, `linux/completion.h`, `linux/init.h`, `linux/slab.h`.
- Detected declarations: `struct xenbus_watch`, `struct xenbus_device`, `struct xenbus_device_id`, `struct xenbus_driver`, `struct xenbus_transaction`, `struct work_struct`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.