Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/gic_v3.c
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <sys/pcpu.h> | #include <sys/pcpu.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/cpuset.h> | #include <sys/cpuset.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/smp.h> | #include <sys/smp.h> | ||||
#include <sys/interrupt.h> | |||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <machine/cpu.h> | #include <machine/cpu.h> | ||||
#include <machine/intr.h> | #include <machine/intr.h> | ||||
▲ Show 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | |||||
gic_v3_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) | gic_v3_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) | ||||
{ | { | ||||
struct gic_v3_softc *sc; | struct gic_v3_softc *sc; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
switch (which) { | switch (which) { | ||||
case GICV3_IVAR_NIRQS: | case GICV3_IVAR_NIRQS: | ||||
*result = (NIRQ - sc->gic_nirqs) / sc->gic_nchildren; | *result = (intr_nirq - sc->gic_nirqs) / sc->gic_nchildren; | ||||
return (0); | return (0); | ||||
case GICV3_IVAR_REDIST: | case GICV3_IVAR_REDIST: | ||||
*result = (uintptr_t)sc->gic_redists.pcpu[PCPU_GET(cpuid)]; | *result = (uintptr_t)sc->gic_redists.pcpu[PCPU_GET(cpuid)]; | ||||
return (0); | return (0); | ||||
case GIC_IVAR_HW_REV: | case GIC_IVAR_HW_REV: | ||||
KASSERT( | KASSERT( | ||||
GICR_PIDR2_ARCH(sc->gic_pidr2) == GICR_PIDR2_ARCH_GICv3 || | GICR_PIDR2_ARCH(sc->gic_pidr2) == GICR_PIDR2_ARCH_GICv3 || | ||||
GICR_PIDR2_ARCH(sc->gic_pidr2) == GICR_PIDR2_ARCH_GICv4, | GICR_PIDR2_ARCH(sc->gic_pidr2) == GICR_PIDR2_ARCH_GICv4, | ||||
▲ Show 20 Lines • Show All 872 Lines • Show Last 20 Lines |