Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | /* * Copyright (c) 2014 Wind River Systems, Inc. * * SPDX-License-Identifier: Apache-2.0 */ /** * @file * @brief ARCv2 interrupt management * * * Interrupt management: * * - enabling/disabling * * An IRQ number passed to the @a irq parameters found in this file is a * number from 16 to last IRQ number on the platform. */ #include <kernel.h> #include <arch/cpu.h> #include <misc/__assert.h> #include <toolchain.h> #include <sections.h> #include <sw_isr_table.h> #include <irq.h> /* * @brief Enable an interrupt line * * Clear possible pending interrupts on the line, and enable the interrupt * line. After this call, the CPU will receive interrupts for the specified * @a irq. * * @return N/A */ void _arch_irq_enable(unsigned int irq) { int key = irq_lock(); _arc_v2_irq_unit_int_enable(irq); irq_unlock(key); } /* * @brief Disable an interrupt line * * Disable an interrupt line. After this call, the CPU will stop receiving * interrupts for the specified @a irq. * * @return N/A */ void _arch_irq_disable(unsigned int irq) { int key = irq_lock(); _arc_v2_irq_unit_int_disable(irq); irq_unlock(key); } /* * @internal * * @brief Set an interrupt's priority * * Lower values take priority over higher values. Special case priorities are * expressed via mutually exclusive flags. * The priority is verified if ASSERT_ON is enabled; max priority level * depends on CONFIG_NUM_IRQ_PRIO_LEVELS. * * @return N/A */ void _irq_priority_set(unsigned int irq, unsigned int prio, u32_t flags) { ARG_UNUSED(flags); int key = irq_lock(); __ASSERT(prio < CONFIG_NUM_IRQ_PRIO_LEVELS, "invalid priority %d for irq %d", prio, irq); _arc_v2_irq_unit_prio_set(irq, prio); irq_unlock(key); } /* * @brief Spurious interrupt handler * * Installed in all dynamic interrupt slots at boot time. Throws an error if * called. * * @return N/A */ #include <misc/printk.h> void _irq_spurious(void *unused) { ARG_UNUSED(unused); printk("_irq_spurious(). Spinning...\n"); for (;;) ; } |