int blocking_notifier_chain_register(struct blocking_notifier_head *nh, struct notifier_block *n) { int ret; if (unlikely(system_state == SYSTEM_BOOTING)) return notifier_chain_register(&nh->head, n); down_write(&nh->rwsem); ret = notifier_chain_register(&nh->head, n); up_write(&nh->rwsem); return ret; }
int srcu_notifier_chain_register(struct srcu_notifier_head *nh, struct notifier_block *n) { int ret; if (unlikely(system_state == SYSTEM_BOOTING)) return notifier_chain_register(&nh->head, n); mutex_lock(&nh->mutex); ret = notifier_chain_register(&nh->head, n); mutex_unlock(&nh->mutex); return ret; }
void register_cpu_notifier(struct notifier_block *nb) { if ( !spin_trylock(&cpu_add_remove_lock) ) BUG(); /* Should never fail as we are called only during boot. */ notifier_chain_register(&cpu_chain, nb); spin_unlock(&cpu_add_remove_lock); }
void __init setup_arch(char **cmdline_p) { notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); paging_init(); strcpy(command_line, saved_command_line); *cmdline_p = command_line; setup_hostinfo(); }
int register_profile_notifier(struct notifier_block * nb) { int err; write_lock_irq(&profile_lock); err = notifier_chain_register(&profile_listeners, nb); write_unlock_irq(&profile_lock); return err; }
int task_handoff_register(struct notifier_block * n) { int err = -EINVAL; write_lock(&handoff_lock); err = notifier_chain_register(&task_free_notifier, n); write_unlock(&handoff_lock); return err; }
int register_die_notifier(struct notifier_block *nb) { int err = 0; unsigned long flags; spin_lock_irqsave(&die_notifier_lock, flags); err = notifier_chain_register(&die_chain, nb); spin_unlock_irqrestore(&die_notifier_lock, flags); return err; }
/** * srcu_notifier_chain_register - Add notifier to an SRCU notifier chain * @nh: Pointer to head of the SRCU notifier chain * @n: New entry in notifier chain * * Adds a notifier to an SRCU notifier chain. * Must be called in process context. * * Currently always returns zero. */ int srcu_notifier_chain_register(struct srcu_notifier_head *nh, struct notifier_block *n) { int ret; /* * This code gets used during boot-up, when task switching is * not yet working and interrupts must remain disabled. At * such times we must not call mutex_lock(). */ if (unlikely(system_state == SYSTEM_BOOTING)) return notifier_chain_register(&nh->head, n); mutex_lock(&nh->mutex); ret = notifier_chain_register(&nh->head, n); mutex_unlock(&nh->mutex); return ret; }
/*! 2016.10.15 study -ing */ int blocking_notifier_chain_register(struct blocking_notifier_head *nh, struct notifier_block *n) { int ret; /* * This code gets used during boot-up, when task switching is * not yet working and interrupts must remain disabled. At * such times we must not call down_write(). */ if (unlikely(system_state == SYSTEM_BOOTING)) /*! n->next에 nh->head 대입, nh->head에 n 대입 */ return notifier_chain_register(&nh->head, n); down_write(&nh->rwsem); ret = notifier_chain_register(&nh->head, n); up_write(&nh->rwsem); return ret; }
int profile_event_register(enum profile_type type, struct notifier_block * n) { int err = -EINVAL; down_write(&profile_rwsem); switch (type) { case PROFILE_TASK_EXIT: err = notifier_chain_register(&task_exit_notifier, n); break; case PROFILE_MUNMAP: err = notifier_chain_register(&munmap_notifier, n); break; } up_write(&profile_rwsem); return err; }
/** * cpufreq_register_notifier - register a driver with cpufreq * @nb: notifier function to register * * Add a driver to the list of drivers that which to be notified about * CPU clock rate changes. The driver will be called three times on * clock change. * * This function may sleep, and has the same return conditions as * notifier_chain_register. */ int cpufreq_register_notifier(struct notifier_block *nb) { int ret; down(&cpufreq_sem); ret = notifier_chain_register(&cpufreq_notifier_list, nb); up(&cpufreq_sem); return ret; }
/*! 2016.10.29 study -ing */ int atomic_notifier_chain_register(struct atomic_notifier_head *nh, struct notifier_block *n) { unsigned long flags; int ret; spin_lock_irqsave(&nh->lock, flags); ret = notifier_chain_register(&nh->head, n); spin_unlock_irqrestore(&nh->lock, flags); return ret; }
int vmm_blocking_notifier_register(struct vmm_blocking_notifier_chain *nc, struct vmm_notifier_block *n) { int ret; vmm_semaphore_down(&nc->rwsem); ret = notifier_chain_register(&nc->head, n); vmm_semaphore_up(&nc->rwsem); return ret; }
int register_xenstore_notifier(struct notifier_block *nb) { int ret = 0; if (xenstored_ready > 0) ret = nb->notifier_call(nb, 0, NULL); else notifier_chain_register(&xenstore_chain, nb); return ret; }
int vmm_atomic_notifier_register(struct vmm_atomic_notifier_chain *nc, struct vmm_notifier_block *n) { irq_flags_t flags; int ret; vmm_spin_lock_irqsave(&nc->lock, flags); ret = notifier_chain_register(&nc->head, n); vmm_spin_unlock_irqrestore(&nc->lock, flags); return ret; }
int profile_event_register(enum profile_type type, struct notifier_block * n) { int err = -EINVAL; down_write(&profile_rwsem); switch (type) { case EXIT_TASK: err = notifier_chain_register(&exit_task_notifier, n); break; case EXIT_MMAP: err = notifier_chain_register(&exit_mmap_notifier, n); break; case EXEC_UNMAP: err = notifier_chain_register(&exec_unmap_notifier, n); break; } up_write(&profile_rwsem); return err; }
/* * We use kgdb_early_setup so that functions we need to call now don't * cause trouble when called again later. */ int kgdb_arch_init(void) { /* Board-specifics. */ /* Force some calls to happen earlier. */ if (kgdb_early_setup == 0) { trap_init(); init_IRQ(); kgdb_early_setup = 1; } /* Set our traps. */ /* This needs to be done more finely grained again, paired in * a before/after in kgdb_handle_exception(...) -- Tom */ set_debug_traps(); notifier_chain_register(&mips_die_chain, &kgdb_notifier); return 0; }
int netlink_register_notifier(struct notifier_block *nb) { return notifier_chain_register(&netlink_chain, nb); }
int vmm_raw_notifier_register(struct vmm_raw_notifier_chain *nc, struct vmm_notifier_block *n) { return notifier_chain_register(&nc->head, n); }
int register_inetaddr_notifier(struct notifier_block *nb) { return notifier_chain_register(&inetaddr_chain, nb); }
/*! From cpu_notifier() * n = page_alloc_cpu_notify_nb */ int raw_notifier_chain_register(struct raw_notifier_head *nh, struct notifier_block *n) { return notifier_chain_register(&nh->head, n); }
int register_reboot_notifier(struct notifier_block * nb) { return notifier_chain_register(&reboot_notifier_list, nb); }
int visdn_register_notifier(struct notifier_block *nb) { return notifier_chain_register(&visdn_notify_chain, nb); }
int register_netdevice_notifier(struct notifier_block *nb) { return notifier_chain_register(&netdev_chain, nb); }
void ibmasm_register_panic_notifier(void) { notifier_chain_register(&panic_notifier_list, &panic_notifier); }