ia64/xen-unstable

view extras/mini-os/include/xenbus.h @ 10843:4f6d858ea570

[PCI] Per-device permissive flag (replaces global permissive flag).
Signed-off-by: Chris Bookholt <hap10@tycho.ncsc.mil>
author kfraser@localhost.localdomain
date Fri Jul 28 12:56:10 2006 +0100 (2006-07-28)
parents fed18f971f72
children 1fc8fb8ea425
line source
1 #ifndef XENBUS_H__
2 #define XENBUS_H__
4 typedef unsigned long xenbus_transaction_t;
5 #define XBT_NIL ((xenbus_transaction_t)0)
7 /* Initialize the XenBus system. */
8 void init_xenbus(void);
10 /* Read the value associated with a path. Returns a malloc'd error
11 string on failure and sets *value to NULL. On success, *value is
12 set to a malloc'd copy of the value. */
13 char *xenbus_read(xenbus_transaction_t xbt, const char *path, char **value);
15 /* Associates a value with a path. Returns a malloc'd error string on
16 failure. */
17 char *xenbus_write(xenbus_transaction_t xbt, const char *path, const char *value);
19 /* Removes the value associated with a path. Returns a malloc'd error
20 string on failure. */
21 char *xenbus_rm(xenbus_transaction_t xbt, const char *path);
23 /* List the contents of a directory. Returns a malloc'd error string
24 on failure and sets *contents to NULL. On success, *contents is
25 set to a malloc'd array of pointers to malloc'd strings. The array
26 is NULL terminated. May block. */
27 char *xenbus_ls(xenbus_transaction_t xbt, const char *prefix, char ***contents);
29 /* Reads permissions associated with a path. Returns a malloc'd error
30 string on failure and sets *value to NULL. On success, *value is
31 set to a malloc'd copy of the value. */
32 char *xenbus_get_perms(xenbus_transaction_t xbt, const char *path, char **value);
34 /* Sets the permissions associated with a path. Returns a malloc'd
35 error string on failure. */
36 char *xenbus_set_perms(xenbus_transaction_t xbt, const char *path, domid_t dom, char perm);
38 /* Start a xenbus transaction. Returns the transaction in xbt on
39 success or a malloc'd error string otherwise. */
40 char *xenbus_transaction_start(xenbus_transaction_t *xbt);
42 /* End a xenbus transaction. Returns a malloc'd error string if it
43 fails. abort says whether the transaction should be aborted.
44 Returns 1 in *retry iff the transaction should be retried. */
45 char *xenbus_transaction_end(xenbus_transaction_t, int abort,
46 int *retry);
48 /* Read path and parse it as an integer. Returns -1 on error. */
49 int xenbus_read_integer(char *path);
51 #endif /* XENBUS_H__ */