Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/arm/gic.c
Show First 20 Lines • Show All 518 Lines • ▼ Show 20 Lines | arm_gic_write_ivar(device_t dev, device_t child, int which, uintptr_t value) | ||||
case GIC_IVAR_BUS: | case GIC_IVAR_BUS: | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
return (ENOENT); | return (ENOENT); | ||||
} | } | ||||
int | int | ||||
arm_gic_intr(void *arg) | arm_gic_intr(INTR_IRQ_FILTER_ARGS(arg, tf)) | ||||
{ | { | ||||
struct arm_gic_softc *sc = arg; | struct arm_gic_softc *sc = arg; | ||||
struct gic_irqsrc *gi; | struct gic_irqsrc *gi; | ||||
uint32_t irq_active_reg, irq; | uint32_t irq_active_reg, irq; | ||||
struct trapframe *tf; | INTR_IRQ_FILTER_TRAPFRAME(tf) | ||||
irq_active_reg = gic_c_read_4(sc, GICC_IAR); | irq_active_reg = gic_c_read_4(sc, GICC_IAR); | ||||
irq = irq_active_reg & 0x3FF; | irq = irq_active_reg & 0x3FF; | ||||
/* | /* | ||||
* 1. We do EOI here because recent read value from active interrupt | * 1. We do EOI here because recent read value from active interrupt | ||||
* register must be used for it. Another approach is to save this | * register must be used for it. Another approach is to save this | ||||
* value into associated interrupt source. | * value into associated interrupt source. | ||||
Show All 14 Lines | arm_gic_intr(INTR_IRQ_FILTER_ARGS(arg, tf)) | ||||
if (irq >= sc->nirqs) { | if (irq >= sc->nirqs) { | ||||
if (gic_debug_spurious) | if (gic_debug_spurious) | ||||
device_printf(sc->gic_dev, | device_printf(sc->gic_dev, | ||||
"Spurious interrupt detected: last irq: %d on CPU%d\n", | "Spurious interrupt detected: last irq: %d on CPU%d\n", | ||||
sc->last_irq[PCPU_GET(cpuid)], PCPU_GET(cpuid)); | sc->last_irq[PCPU_GET(cpuid)], PCPU_GET(cpuid)); | ||||
return (FILTER_HANDLED); | return (FILTER_HANDLED); | ||||
} | } | ||||
tf = curthread->td_intr_frame; | |||||
dispatch_irq: | dispatch_irq: | ||||
gi = sc->gic_irqs + irq; | gi = sc->gic_irqs + irq; | ||||
/* | /* | ||||
* Note that GIC_FIRST_SGI is zero and is not used in 'if' statement | * Note that GIC_FIRST_SGI is zero and is not used in 'if' statement | ||||
* as compiler complains that comparing u_int >= 0 is always true. | * as compiler complains that comparing u_int >= 0 is always true. | ||||
*/ | */ | ||||
if (irq <= GIC_LAST_SGI) { | if (irq <= GIC_LAST_SGI) { | ||||
#ifdef SMP | #ifdef SMP | ||||
▲ Show 20 Lines • Show All 742 Lines • Show Last 20 Lines |