Esempio n. 1
0
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;
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
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);
}
Esempio n. 4
0
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;
}
Esempio n. 6
0
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;
}
Esempio n. 7
0
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;
}
Esempio n. 8
0
/**
 *	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;
}
Esempio n. 9
0
/*! 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;
}
Esempio n. 10
0
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;
}
Esempio n. 11
0
/**
 *	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;
}
Esempio n. 12
0
/*! 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;
}
Esempio n. 13
0
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;
}
Esempio n. 14
0
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;
}
Esempio n. 15
0
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;
}
Esempio n. 18
0
int netlink_register_notifier(struct notifier_block *nb)
{
	return notifier_chain_register(&netlink_chain, nb);
}
Esempio n. 19
0
int vmm_raw_notifier_register(struct vmm_raw_notifier_chain *nc,
			      struct vmm_notifier_block *n)
{
	return notifier_chain_register(&nc->head, n);
}
Esempio n. 20
0
int register_inetaddr_notifier(struct notifier_block *nb)
{
	return notifier_chain_register(&inetaddr_chain, nb);
}
Esempio n. 21
0
/*! 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);
}
Esempio n. 23
0
int visdn_register_notifier(struct notifier_block *nb)
{
    return notifier_chain_register(&visdn_notify_chain, nb);
}
Esempio n. 24
0
int register_netdevice_notifier(struct notifier_block *nb)
{
	return notifier_chain_register(&netdev_chain, nb);
}
Esempio n. 25
0
void ibmasm_register_panic_notifier(void)
{
	notifier_chain_register(&panic_notifier_list, &panic_notifier);
}