/* * ILSEL level map, in descending order from the highest level down. * * Supported levels are 1 - 15 spread across ILSEL0 - ILSEL4, mapping * directly to IRLs. As the IRQs are numbered in reverse order relative * to the interrupt level, the level map is carefully managed to ensure a * 1:1 mapping between the bit position and the IRQ number. * * This careful constructions allows ilsel_enable*() to be referenced * directly for hooking up an ILSEL set and getting back an IRQ which can * subsequently be used for internal accounting in the (optional) disable * path.
*/ staticunsignedlong ilsel_level_map;
/** * ilsel_enable - Enable an ILSEL set. * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h). * * Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest * available interrupt level. Callers should take care to order callsites * noting descending interrupt levels. Aliasing FPGA and external board * IRQs need to use ilsel_enable_fixed(). * * The return value is an IRQ number that can later be taken down with * ilsel_disable().
*/ int ilsel_enable(ilsel_source_t set)
{ unsignedint bit;
if (unlikely(set > ILSEL_KEY)) {
pr_err("Aliased sources must use ilsel_enable_fixed()\n"); return -EINVAL;
}
do {
bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS);
} while (test_and_set_bit(bit, &ilsel_level_map));
__ilsel_enable(set, bit);
return bit;
}
EXPORT_SYMBOL_GPL(ilsel_enable);
/** * ilsel_enable_fixed - Enable an ILSEL set at a fixed interrupt level * @set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h). * @level: Interrupt level (1 - 15) * * Enables a given ILSEL source at a fixed interrupt level. Necessary * both for level reservation as well as for aliased sources that only * exist on special ILSEL#s. * * Returns an IRQ number (as ilsel_enable()).
*/ int ilsel_enable_fixed(ilsel_source_t set, unsignedint level)
{ unsignedint bit = ilsel_offset(level - 1);
if (test_and_set_bit(bit, &ilsel_level_map)) return -EBUSY;
/** * ilsel_disable - Disable an ILSEL set * @irq: Bit position for ILSEL set value (retval from enable routines) * * Disable a previously enabled ILSEL set.
*/ void ilsel_disable(unsignedint irq)
{ unsignedlong addr; unsignedint tmp;
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.