Example #1
0
// ARM10C 20141122
// irq: 16
int irq_set_percpu_devid(unsigned int irq)
{
	// 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)
	if (!desc)
		return -EINVAL;

	// desc->percpu_enabled: (kmem_cache#28-oX (irq 16))->percpu_enabled: NULL
	if (desc->percpu_enabled)
		return -EINVAL;

	// desc->percpu_enabled: (kmem_cache#28-oX (irq 16))->percpu_enabled: NULL
	// sizeof(struct cpumask): 4, GFP_KERNEL: 0xD0, kzalloc(4, GFP_KERNEL: 0xD0): kmem_cache#30-oX
	desc->percpu_enabled = kzalloc(sizeof(*desc->percpu_enabled), GFP_KERNEL);
	// desc->percpu_enabled: (kmem_cache#28-oX (irq 16))->percpu_enabled: kmem_cache#30-oX

	// desc->percpu_enabled: (kmem_cache#28-oX (irq 16))->percpu_enabled: kmem_cache#30-oX
	if (!desc->percpu_enabled)
		return -ENOMEM;

	// irq: 16
	irq_set_percpu_devid_flags(irq);

	// irq_set_percpu_devid_flags에서 한일:
	// (kmem_cache#28-oX (irq 16))->status_use_accessors: 0x31600
	// (&(kmem_cache#28-oX (irq 16))->irq_data)->state_use_accessors: 0x10800

	return 0;
	// return 0
}
int irq_set_percpu_devid(unsigned int irq)
{
	struct irq_desc *desc = irq_to_desc(irq);

	if (!desc)
		return -EINVAL;

	if (desc->percpu_enabled)
		return -EINVAL;

	desc->percpu_enabled = kzalloc(sizeof(*desc->percpu_enabled), GFP_KERNEL);

	if (!desc->percpu_enabled)
		return -ENOMEM;

	irq_set_percpu_devid_flags(irq);
	return 0;
}
Example #3
0
int irq_set_percpu_devid_partition(unsigned int irq,
				   const struct cpumask *affinity)
{
	struct irq_desc *desc = irq_to_desc(irq);

	if (!desc)
		return -EINVAL;

	if (desc->percpu_enabled)
		return -EINVAL;

	desc->percpu_enabled = kzalloc(sizeof(*desc->percpu_enabled), GFP_KERNEL);

	if (!desc->percpu_enabled)
		return -ENOMEM;

	if (affinity)
		desc->percpu_affinity = affinity;
	else
		desc->percpu_affinity = cpu_possible_mask;

	irq_set_percpu_devid_flags(irq);
	return 0;
}