|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
Go to the source code of this file.
Data Structures | |
| struct | notifier |
| struct | notify_chain |
| struct | notify_dev_table |
| struct | notify_dev |
Macros | |
| #define | NOTIFY_OK 1 |
| #define | NOTIFY_STOP -1 |
| #define | NOTIFY_BAD -2 |
| #define | NOTIFIER_FLAG_ONCE (1 << 0) |
| #define | NOTIFIER_FLAG_ATOMIC (1 << 1) |
| #define | NOTIFIER_FLAG_DISABLED (1 << 2) |
| #define | NOTIFY_HIGHT 1000 |
| #define | NOTIFY_MEDIUM 500 |
| #define | NOTIFY_NORMAL 100 |
| #define | NOTIFY_LOW 50 |
| #define | NOTIFY_DEV_HASH_SIZE 64 |
| #define | NOTIFY_DEV_HASH_MASK (NOTIFY_DEV_HASH_SIZE - 1) |
Typedefs | |
| typedef void(* | notify_callback_t) (uint32_t event, void *data, void *context) |
Functions | |
| void | notify_dev_create (kstring name) |
| int | notify_dev_destroy (kstring name) |
| int | notify_register (char *name, struct notifier *n) |
| int | notify_unregister (kstring name, struct notifier *n) |
| int | wait_until_receive_notify (const char *name, uint64_t timeout) |
| int | notify_call (char *name, uint32_t event, void *data) |
| #define NOTIFY_DEV_HASH_MASK (NOTIFY_DEV_HASH_SIZE - 1) |
Definition at line 44 of file notify.h.
Referenced by find_dev(), and notify_dev_create().
| #define NOTIFY_DEV_HASH_SIZE 64 |
Definition at line 43 of file notify.h.
Referenced by find_dev(), and notify_dev_create().
| int notify_call | ( | char * | name, |
| uint32_t | event, | ||
| void * | data ) |
Definition at line 110 of file notify.c.
References notifier::callback, notifier::context, count, data, find_dev(), MAX_SNAPSHOT, name, notifier::next, notify_dev_put(), spin_acquire(), and spin_release().
Referenced by __attribute__(), ATAPIModule::identify(), and input_report_key().
| void notify_dev_create | ( | kstring | name | ) |
Definition at line 41 of file notify.c.
References flags, h, hash, irq_restore(), irq_save(), kalloc(), kfree2(), memset(), name, name_len, NOTIFY_DEV_HASH_MASK, NOTIFY_DEV_HASH_SIZE, notify_table, spin_acquire(), spin_release(), SPINLOCK_INIT, strlen(), and strncmp().
| int notify_register | ( | char * | name, |
| struct notifier * | n ) |
Definition at line 78 of file notify.c.
References notifier::callback, notifier::context, find_dev(), notifier::flags, kalloc(), name, notify_dev_put(), notifier::priority, serial2_printf(), spin_acquire(), and spin_release().
| int wait_until_receive_notify | ( | const char * | name, |
| uint64_t | timeout ) |
Definition at line 140 of file notify.c.
References notify_dev::event_received, find_dev(), ms2ns, name, notify_dev_put(), and usleep().
Referenced by __attribute__().