1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _LINUX_NOTIFIER_H 20 #define _LINUX_NOTIFIER_H 21 #include <linux/errno.h> 22 #include <linux/mutex.h> 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #include <linux/rwsem.h> 25 struct notifier_block { 26 int (*notifier_call)(struct notifier_block *, unsigned long, void *); 27 struct notifier_block *next; 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 int priority; 30 }; 31 struct atomic_notifier_head { 32 spinlock_t lock; 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 struct notifier_block *head; 35 }; 36 struct blocking_notifier_head { 37 struct rw_semaphore rwsem; 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 struct notifier_block *head; 40 }; 41 struct raw_notifier_head { 42 struct notifier_block *head; 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 }; 45 #define ATOMIC_INIT_NOTIFIER_HEAD(name) do { spin_lock_init(&(name)->lock); (name)->head = NULL; } while (0) 46 #define BLOCKING_INIT_NOTIFIER_HEAD(name) do { init_rwsem(&(name)->rwsem); (name)->head = NULL; } while (0) 47 #define RAW_INIT_NOTIFIER_HEAD(name) do { (name)->head = NULL; } while (0) 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 #define ATOMIC_NOTIFIER_INIT(name) { .lock = __SPIN_LOCK_UNLOCKED(name.lock), .head = NULL } 50 #define BLOCKING_NOTIFIER_INIT(name) { .rwsem = __RWSEM_INITIALIZER((name).rwsem), .head = NULL } 51 #define RAW_NOTIFIER_INIT(name) { .head = NULL } 52 #define ATOMIC_NOTIFIER_HEAD(name) struct atomic_notifier_head name = ATOMIC_NOTIFIER_INIT(name) 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 #define BLOCKING_NOTIFIER_HEAD(name) struct blocking_notifier_head name = BLOCKING_NOTIFIER_INIT(name) 55 #define RAW_NOTIFIER_HEAD(name) struct raw_notifier_head name = RAW_NOTIFIER_INIT(name) 56 #endif 57