/* * Access rules: * * procfs protects read/write of /proc/irq/N/ files against a * concurrent free of the interrupt descriptor. remove_proc_entry() * immediately prevents new read/writes to happen and waits for * already running read/write functions to complete. * * We remove the proc entries first and then delete the interrupt * descriptor from the radix tree and free it. So it is guaranteed * that irq_to_desc(N) is valid as long as the read/writes are * permitted by procfs. * * The read from /proc/interrupts is a different problem because there * is no protection. So the lookup and the access to irqdesc * information must be protected by sparse_irq_lock.
*/ staticstruct proc_dir_entry *root_irq_dir;
#ifndef CONFIG_AUTO_IRQ_AFFINITY staticinlineint irq_select_affinity_usr(unsignedint irq)
{ /* * If the interrupt is started up already then this fails. The * interrupt is assigned to an online CPU already. There is no * point to move it around randomly. Tell user space that the * selected mask is bogus. * * If not then any change to the affinity is pointless because the * startup code invokes irq_setup_affinity() which will select * a online CPU anyway.
*/ return -EINVAL;
} #else /* ALPHA magic affinity auto selector. Keep it for historical reasons. */ staticinlineint irq_select_affinity_usr(unsignedint irq)
{ return irq_select_affinity(irq);
} #endif
if (!irq_can_set_affinity_usr(irq) || no_irq_affinity) return -EPERM;
if (!zalloc_cpumask_var(&new_value, GFP_KERNEL)) return -ENOMEM;
if (type)
err = cpumask_parselist_user(buffer, count, new_value); else
err = cpumask_parse_user(buffer, count, new_value); if (err) goto free_cpumask;
/* * Do not allow disabling IRQs completely - it's a too easy * way to make the system unusable accidentally :-) At least * one online CPU still has to be targeted.
*/ if (!cpumask_intersects(new_value, cpu_online_mask)) { /* * Special case for empty set - allow the architecture code * to set default SMP affinity.
*/
err = irq_select_affinity_usr(irq) ? -EINVAL : count;
} else {
err = irq_set_affinity(irq, new_value); if (!err)
err = count;
}
if (!zalloc_cpumask_var(&new_value, GFP_KERNEL)) return -ENOMEM;
err = cpumask_parse_user(buffer, count, new_value); if (err) goto out;
/* * Do not allow disabling IRQs completely - it's a too easy * way to make the system unusable accidentally :-) At least * one online CPU still has to be targeted.
*/ if (!cpumask_intersects(new_value, cpu_online_mask)) {
err = -EINVAL; goto out;
}
if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip)) return;
/* * irq directories are registered only when a handler is * added, not when the descriptor is created, so multiple * tasks might try to register at the same time.
*/
guard(mutex)(®ister_lock);
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.12Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-06-05)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.