当前位置: 首页>>代码示例>>C++>>正文


C++ chip_bus_lock函数代码示例

本文整理汇总了C++中chip_bus_lock函数的典型用法代码示例。如果您正苦于以下问题:C++ chip_bus_lock函数的具体用法?C++ chip_bus_lock怎么用?C++ chip_bus_lock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了chip_bus_lock函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: __irq_get_desc_lock

struct irq_desc *
__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus)
{
	struct irq_desc *desc = irq_to_desc(irq);

	if (desc) {
		if (bus)
			chip_bus_lock(desc);
		raw_spin_lock_irqsave(&desc->lock, *flags);
	}
	return desc;
}
开发者ID:hastalafiesta,项目名称:Samsung_STE_Kernel,代码行数:12,代码来源:irqdesc.c

示例2: irq_read_line

/**
 *     irq_read_line - read the value on an irq line
 *     @irq: Interrupt number representing a hardware line
 *
 *     This function is meant to be called from within the irq handler.
 *     Slowbus irq controllers might sleep, but it is assumed that the irq
 *     handler for slowbus interrupts will execute in thread context, so
 *     sleeping is okay.
 */
int irq_read_line(unsigned int irq)
{
	struct irq_desc *desc = irq_to_desc(irq);
	int val;

	if (!desc || !desc->irq_data.chip->irq_read_line)
		return -EINVAL;

	chip_bus_lock(desc);
	raw_spin_lock(&desc->lock);
	val = desc->irq_data.chip->irq_read_line(&desc->irq_data);
	raw_spin_unlock(&desc->lock);
	chip_bus_sync_unlock(desc);
	return val;
}
开发者ID:AICP,项目名称:kernel_moto_shamu,代码行数:24,代码来源:manage.c

示例3: set_tg_irq_status

/* Henry [email protected] set  tg irq status */
int  set_tg_irq_status(unsigned int irq, bool enable)
{
	struct irq_desc *desc = irq_to_desc(irq);
	unsigned long flags;
	int value;
	
	if (!desc)
		return 0xffffffff;
	chip_bus_lock(irq, desc);
	raw_spin_lock_irqsave(&desc->lock, flags);
	value=__set_tg_irq_status(desc, irq, enable);
	
	raw_spin_unlock_irqrestore(&desc->lock, flags);
	chip_bus_sync_unlock(irq, desc);
}
开发者ID:michaellass,项目名称:lenovo_a1_07_kernel,代码行数:16,代码来源:manage.c

示例4: __irq_get_desc_lock

// ARM10C 20141122
// irq: 16, flags: &flags, false, check: 0
// ARM10C 20141122
// irq: 16, flags: &flags, true, check: 0
struct irq_desc *
__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
		    unsigned int check)
{
	// irq: 16, irq_to_desc(16): kmem_cache#28-oX (irq 16)
	// irq: 16, irq_to_desc(16): kmem_cache#28-oX (irq 16)
	struct irq_desc *desc = irq_to_desc(irq);
	// desc: kmem_cache#28-oX (irq 16)
	// desc: kmem_cache#28-oX (irq 16)

	// desc: kmem_cache#28-oX (irq 16)
	// desc: kmem_cache#28-oX (irq 16)
	if (desc) {
		// check: 0, _IRQ_DESC_CHECK: 1
		// check: 0, _IRQ_DESC_CHECK: 1
		if (check & _IRQ_DESC_CHECK) {
			if ((check & _IRQ_DESC_PERCPU) &&
			    !irq_settings_is_per_cpu_devid(desc))
				return NULL;

			if (!(check & _IRQ_DESC_PERCPU) &&
			    irq_settings_is_per_cpu_devid(desc))
				return NULL;
		}

		// bus: false
		// bus: true
		if (bus)
			// desc: kmem_cache#28-oX (irq 16)
			chip_bus_lock(desc);

		// &desc->lock: &(kmem_cache#28-oX (irq 16))->lock, *flags: flags
		// &desc->lock: &(kmem_cache#28-oX (irq 16))->lock, *flags: flags
		raw_spin_lock_irqsave(&desc->lock, *flags);
		// &(kmem_cache#28-oX (irq 16))->lock을 사용하여 spinlock을 설정하고 cpsr을 flags에 저장
		// &(kmem_cache#28-oX (irq 16))->lock을 사용하여 spinlock을 설정하고 cpsr을 flags에 저장
	}

	// desc: kmem_cache#28-oX (irq 16)
	// desc: kmem_cache#28-oX (irq 16)
	return desc;
	// return kmem_cache#28-oX (irq 16)
	// return kmem_cache#28-oX (irq 16)
}
开发者ID:BozkurTR,项目名称:kernel,代码行数:48,代码来源:irqdesc.c

示例5: handle_nested_irq

/*
 *	handle_nested_irq - Handle a nested irq from a irq thread
 *	@irq:	the interrupt number
 *
 *	Handle interrupts which are nested into a threaded interrupt
 *	handler. The handler function is called inside the calling
 *	threads context.
 */
bool handle_nested_irq(unsigned int irq)
{
	struct irq_desc *desc = irq_to_desc(irq);
	struct irqaction *action;
	int mask_this_irq = 0;
	irqreturn_t action_ret;
	bool handled = false;

	might_sleep();

	raw_spin_lock_irq(&desc->lock);

	desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
	kstat_incr_irqs_this_cpu(irq, desc);

	action = desc->action;
	if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) {
		desc->istate |= IRQS_PENDING;
		mask_this_irq = 1;
		goto out_unlock;
	}

	irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
	raw_spin_unlock_irq(&desc->lock);

	action_ret = action->thread_fn(action->irq, action->dev_id);
	if (!noirqdebug)
		note_interrupt(irq, desc, action_ret);

	raw_spin_lock_irq(&desc->lock);
	irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);

	handled = true;

out_unlock:
	raw_spin_unlock_irq(&desc->lock);
	if (unlikely(mask_this_irq)) {
		chip_bus_lock(desc);
		mask_irq(desc);
		chip_bus_sync_unlock(desc);
	}

	return handled;
}
开发者ID:AICP,项目名称:kernel_moto_shamu,代码行数:52,代码来源:chip.c

示例6: handle_nested_irq

/*
 *	handle_nested_irq - Handle a nested irq from a irq thread
 *	@irq:	the interrupt number
 *
 *	Handle interrupts which are nested into a threaded interrupt
 *	handler. The handler function is called inside the calling
 *	threads context.
 */
void handle_nested_irq(unsigned int irq)
{
	struct irq_desc *desc = irq_to_desc(irq);
	struct irqaction *action;
	int mask_this_irq = 0;
	irqreturn_t action_ret;

	might_sleep();

	raw_spin_lock_irq(&desc->lock);

	kstat_incr_irqs_this_cpu(irq, desc);

	action = desc->action;
	if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
		mask_this_irq = 1;
		if (!(desc->status & IRQ_LEVEL))
			desc->status |= IRQ_PENDING;
		goto out_unlock;
	}

	desc->status |= IRQ_INPROGRESS;
	raw_spin_unlock_irq(&desc->lock);

	action_ret = action->thread_fn(action->irq, action->dev_id);
	if (!noirqdebug)
		note_interrupt(irq, desc, action_ret);

	raw_spin_lock_irq(&desc->lock);
	desc->status &= ~IRQ_INPROGRESS;

out_unlock:
	if (unlikely(mask_this_irq)) {
		chip_bus_lock(irq, desc);
		mask_irq(desc, irq);
		chip_bus_sync_unlock(irq, desc);
	}
	raw_spin_unlock_irq(&desc->lock);
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:47,代码来源:chip.c

示例7: __irq_get_desc_lock

struct irq_desc *
__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
		    unsigned int check)
{
	struct irq_desc *desc = irq_to_desc(irq);

	if (desc) {
		if (check & _IRQ_DESC_CHECK) {
			if ((check & _IRQ_DESC_PERCPU) &&
			    !irq_settings_is_per_cpu_devid(desc))
				return NULL;

			if (!(check & _IRQ_DESC_PERCPU) &&
			    irq_settings_is_per_cpu_devid(desc))
				return NULL;
		}

		if (bus)
			chip_bus_lock(desc);
		raw_spin_lock_irqsave(&desc->lock, *flags);
	}
	return desc;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:23,代码来源:irqdesc.c


注:本文中的chip_bus_lock函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。