aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/notifier.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-18 13:23:02 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-18 13:23:02 +0100
commitafb3100a1d8da9516fc946d9d061ba7441d1cf51 (patch)
tree9ccc45dbe03963dc19296c626ce7afb62f8470c8 /xen/include/xen/notifier.h
parent6cbd479e30dc414af9b892e96412920a753391cd (diff)
downloadxen-afb3100a1d8da9516fc946d9d061ba7441d1cf51.tar.gz
xen-afb3100a1d8da9516fc946d9d061ba7441d1cf51.tar.bz2
xen-afb3100a1d8da9516fc946d9d061ba7441d1cf51.zip
Clean up notifier-chain interface and use new interface in CPU hotplug.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/include/xen/notifier.h')
-rw-r--r--xen/include/xen/notifier.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/xen/include/xen/notifier.h b/xen/include/xen/notifier.h
index a827653849..e9519e2f76 100644
--- a/xen/include/xen/notifier.h
+++ b/xen/include/xen/notifier.h
@@ -13,6 +13,8 @@
#include <xen/config.h>
#include <xen/types.h>
#include <xen/errno.h>
+#include <xen/kernel.h>
+#include <xen/list.h>
/*
* Xen includes only one type of notifier chains inherited from Linux:
@@ -23,35 +25,33 @@
struct notifier_block {
int (*notifier_call)(struct notifier_block *, unsigned long, void *);
- struct notifier_block *next;
+ struct list_head chain;
int priority;
};
-struct raw_notifier_head {
- struct notifier_block *head;
+struct notifier_head {
+ struct notifier_block head;
};
-#define RAW_INIT_NOTIFIER_HEAD(name) do { \
- (name)->head = NULL; \
-} while (0)
+#define NOTIFIER_INIT(name) { .head.chain = LIST_HEAD_INIT(name.head.chain) }
-#define RAW_NOTIFIER_INIT(name) { .head = NULL }
+#define NOTIFIER_HEAD(name) \
+ struct notifier_head name = NOTIFIER_INIT(name)
-#define RAW_NOTIFIER_HEAD(name) \
- struct raw_notifier_head name = RAW_NOTIFIER_INIT(name)
+void notifier_chain_register(
+ struct notifier_head *nh, struct notifier_block *nb);
+void notifier_chain_unregister(
+ struct notifier_head *nh, struct notifier_block *nb);
-int raw_notifier_chain_register(
- struct raw_notifier_head *nh, struct notifier_block *nb);
+int notifier_call_chain(
+ struct notifier_head *nh, unsigned long val, void *v,
+ struct notifier_block **pcursor);
-int raw_notifier_chain_unregister(
- struct raw_notifier_head *nh, struct notifier_block *nb);
-
-int raw_notifier_call_chain(
- struct raw_notifier_head *nh, unsigned long val, void *v);
-int __raw_notifier_call_chain(
- struct raw_notifier_head *nh, unsigned long val, void *v,
- int nr_to_call, int *nr_calls);
+/* Notifier flag values: OR into @val passed to notifier_call_chain(). */
+#define NOTIFY_FORWARD 0x0000 /* Call chain highest-priority-first */
+#define NOTIFY_REVERSE 0x8000 /* Call chain lowest-priority-first */
+/* Handler completion values */
#define NOTIFY_DONE 0x0000
#define NOTIFY_STOP_MASK 0x8000
#define NOTIFY_STOP (NOTIFY_STOP_MASK|NOTIFY_DONE)