コード例 #1
0
ファイル: driver_procfs.c プロジェクト: erosca/rfm12b_chat
static void inline procfile_context_print(void)
{
    printk_d("preemptible 0x%x\n", preemptible());
    printk_d("in_atomic_preempt_off 0x%x\n", in_atomic_preempt_off());
    printk_d("in_atomic 0x%x\n", in_atomic());
    printk_d("in_nmi 0x%lx\n", in_nmi());
    printk_d("in_serving_softirq 0x%lx\n", in_serving_softirq());
    printk_d("in_interrupt 0x%lx\n", in_interrupt());
    printk_d("in_softirq 0x%lx\n", in_softirq());
    printk_d("in_irq 0x%lx\n", in_irq());
    printk_d("preempt_count 0x%x\n", preempt_count());
    printk_d("irqs_disabled 0x%x\n", irqs_disabled());
    if(current) {
        printk_d("task->comm %s\n", current->comm);
        printk_d("task->flags 0x%x\n", current->flags);
        printk_d("task->state %lu\n", current->state);
        printk_d("task->usage %d\n", atomic_read(&(current->usage)));
        printk_d("task->prio %d\n", current->prio);
        printk_d("task->static_prio %d\n", current->static_prio);
        printk_d("task->normal_prio %d\n", current->normal_prio);
        printk_d("task->rt_priority %d\n", current->rt_priority);
        printk_d("task->policy %d\n", current->policy);
        printk_d("task->pid %d\n", current->pid);
        printk_d("task->tgid %d\n", current->tgid);
    }
    else
        printk_d("task pointer NULL\n");
}
コード例 #2
0
static int panic_mode_emmc0_power_up(void *data)
{
	int ret;
	bool atomic_context;
	/*
	 * Since pmu_set_emmc_to_d0i0_atomic function can
	 * only be used in atomic context, before call this
	 * function, do a check first and make sure this function
	 * is used in atomic context.
	 */
	atomic_context = (!preemptible() || in_atomic_preempt_off());

	if (!atomic_context) {
		pr_err("%s: not in atomic context!\n", __func__);
		return -EPERM;
	}

	ret = pmu_set_emmc_to_d0i0_atomic();
	if (ret) {
		pr_err("%s: power up host failed with err %d\n",
				__func__, ret);
	}

	return ret;
}