Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/io_apic.c
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* Documentation for the I/O APIC: "82093AA I/O Advanced Programmable | * Documentation for the I/O APIC: "82093AA I/O Advanced Programmable | ||||
* Interrupt Controller (IOAPIC)", May 1996, Intel Corp. | * Interrupt Controller (IOAPIC)", May 1996, Intel Corp. | ||||
* ftp://download.intel.com/design/chipsets/datashts/29056601.pdf | * ftp://download.intel.com/design/chipsets/datashts/29056601.pdf | ||||
*/ | */ | ||||
struct ioapic_intsrc { | struct ioapic_intsrc { | ||||
struct intsrc io_intsrc; | struct intsrc io_intsrc; | ||||
int io_irq; | int io_irq; | ||||
jhb: This one needs to stay signed. The cookie values IRQ_DISABLED, etc. are all -ve values. | |||||
Done Inline ActionsI noticed, that is why all the comparisons for io_irq >= 0 were converted to io_irq < num_io_irqs and similar for io_irq < 0 => io_irq >= num_io_irqs. ehem_freebsd_m5p.com: I noticed, that is why all the comparisons for `io_irq >= 0` were converted to `io_irq <… | |||||
u_int io_intpin:8; | u_int io_intpin:8; | ||||
u_int io_vector:8; | u_int io_vector:8; | ||||
u_int io_cpu; | u_int io_cpu; | ||||
u_int io_activehi:1; | u_int io_activehi:1; | ||||
u_int io_edgetrigger:1; | u_int io_edgetrigger:1; | ||||
u_int io_masked:1; | u_int io_masked:1; | ||||
int io_bus:4; | int io_bus:4; | ||||
uint32_t io_lowreg; | uint32_t io_lowreg; | ||||
Show All 22 Lines | |||||
static const char *ioapic_bus_string(int bus_type); | static const char *ioapic_bus_string(int bus_type); | ||||
static void ioapic_print_irq(struct ioapic_intsrc *intpin); | static void ioapic_print_irq(struct ioapic_intsrc *intpin); | ||||
static void ioapic_register_sources(struct pic *pic); | static void ioapic_register_sources(struct pic *pic); | ||||
static void ioapic_enable_source(struct intsrc *isrc); | static void ioapic_enable_source(struct intsrc *isrc); | ||||
static void ioapic_disable_source(struct intsrc *isrc, int eoi); | static void ioapic_disable_source(struct intsrc *isrc, int eoi); | ||||
static void ioapic_eoi_source(struct intsrc *isrc); | static void ioapic_eoi_source(struct intsrc *isrc); | ||||
static void ioapic_enable_intr(struct intsrc *isrc); | static void ioapic_enable_intr(struct intsrc *isrc); | ||||
static void ioapic_disable_intr(struct intsrc *isrc); | static void ioapic_disable_intr(struct intsrc *isrc); | ||||
static int ioapic_vector(struct intsrc *isrc); | static u_int ioapic_vector(struct intsrc *isrc); | ||||
static int ioapic_source_pending(struct intsrc *isrc); | static int ioapic_source_pending(struct intsrc *isrc); | ||||
static int ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig, | static int ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig, | ||||
enum intr_polarity pol); | enum intr_polarity pol); | ||||
static void ioapic_resume(struct pic *pic, bool suspend_cancelled); | static void ioapic_resume(struct pic *pic, bool suspend_cancelled); | ||||
static int ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id); | static int ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id); | ||||
static void ioapic_program_intpin(struct ioapic_intsrc *intpin); | static void ioapic_program_intpin(struct ioapic_intsrc *intpin); | ||||
static void ioapic_reprogram_intpin(struct intsrc *isrc); | static void ioapic_reprogram_intpin(struct intsrc *isrc); | ||||
▲ Show 20 Lines • Show All 394 Lines • ▼ Show 20 Lines | if (intpin->io_vector != 0) { | ||||
intpin->io_masked = 1; | intpin->io_masked = 1; | ||||
intpin->io_vector = 0; | intpin->io_vector = 0; | ||||
ioapic_program_intpin(intpin); | ioapic_program_intpin(intpin); | ||||
mtx_unlock_spin(&icu_lock); | mtx_unlock_spin(&icu_lock); | ||||
apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); | apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); | ||||
} | } | ||||
} | } | ||||
static int | static u_int | ||||
ioapic_vector(struct intsrc *isrc) | ioapic_vector(struct intsrc *isrc) | ||||
{ | { | ||||
struct ioapic_intsrc *pin; | struct ioapic_intsrc *pin; | ||||
pin = (struct ioapic_intsrc *)isrc; | pin = (struct ioapic_intsrc *)isrc; | ||||
return (pin->io_irq); | return (pin->io_irq); | ||||
Done Inline ActionsInstead, just cast the value here for this file. jhb: Instead, just cast the value here for this file. | |||||
} | } | ||||
static int | static int | ||||
ioapic_source_pending(struct intsrc *isrc) | ioapic_source_pending(struct intsrc *isrc) | ||||
{ | { | ||||
struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; | struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; | ||||
if (intpin->io_vector == 0) | if (intpin->io_vector == 0) | ||||
▲ Show 20 Lines • Show All 703 Lines • Show Last 20 Lines |
This one needs to stay signed. The cookie values IRQ_DISABLED, etc. are all -ve values.