Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86 PICs as devices #1457

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d7c0fd3
intr/x86: remove ->pic_vector(), switch to ->ie_irq
ehem Jun 4, 2022
d555974
x86/atpic: inline atpic_vector() function
ehem Dec 22, 2024
1e6ff0a
x86/xen: remove null pic_source_pending hook
ehem Dec 23, 2024
e1c8165
x86/io_apic: convert ioapic_register() to calling ioapic_program_intp…
ehem Dec 10, 2024
f5d16f8
intr/x86: change intr_register_pic()'s return to void
ehem Dec 14, 2024
b88e103
intr/x86: merge pic_disable_source() call into pic_disable_intr()
ehem Nov 5, 2024
fc81f87
x86/isa/clock: revert remains of f9acc6410e5e
ehem Aug 24, 2024
a86e7ae
x86/atpic: move eoi function pointer from pic to atpic
ehem Oct 10, 2024
db7e30b
x86/atpic: split initializer for .at_pic into constant structure
ehem Oct 11, 2024
9dff594
intr/x86: introduce macros and typedefs for handling of x86 PICs
ehem Aug 24, 2024
9f7e1ba
intr/x86: add one more macro for common x86 PIC functionality
ehem Dec 9, 2024
1bc0c7d
intr/x86: add PIC argument to function declarations/calls
ehem Aug 24, 2024
3e8e044
intr/x86: add wrappers for x86 PIC function calls
ehem Aug 24, 2024
15868c6
intr/x86: add wrappers for remaining intr_event_create() functions
ehem Oct 1, 2024
e28793a
kern/bus: initialize root bus at SI_SUB_INTR
ehem Oct 5, 2024
c0be76c
intr/x86: create PIC device setup function
ehem Oct 7, 2024
43638b0
intr/x86: introduce PIC base class
ehem Oct 2, 2024
06b0ad9
intr/x86: convert pic list to separate linked list
ehem Oct 1, 2024
a0d6f6f
intr/x86: create PIC interface device for x86
ehem Jun 19, 2024
7896554
intr/x86: use softc as PIC list
ehem Oct 12, 2024
85a3160
x86/io_apic: remove ->io_pic from ioapic structure
ehem Nov 27, 2024
9b83b15
x86/io_apic: pass ioapic structure to ioapic_program_intpin()
ehem Dec 10, 2024
bc8ed68
Partially Revert "Revert "intrng: change multi-interrupt root support…
ehem Oct 27, 2024
970671f
Revert "sys/intr.h: formally depend on machine/intr.h"
ehem Oct 9, 2024
4d85fbc
intrng: cleanup #include situation
ehem Aug 10, 2024
9b3f078
intrcompat: rename "machine/intr*.h" to "machine/interrupt.h"
ehem Jun 8, 2022
5b353d2
intrcompat: add "interrupt_t" typedef for all architectures
ehem Jun 4, 2022
5b82493
intrcompat: replace many interrupt header includes with <machine/inte…
ehem Jun 8, 2022
2074bef
kern/intr: split intr_event_create() apart
ehem Jan 29, 2022
6c608f6
kern/intr: add event handling via interface
ehem Oct 1, 2024
1ab7225
kern/intr: allow for event allocation outside kern_intr.c
ehem Jan 29, 2022
33bc2e4
kern/intr: add intr_event as "source" value
ehem Oct 14, 2024
7961eec
intr/x86: convert architecture to using `intr_event_create_device()`
ehem Oct 2, 2024
746dc79
intr/x86: directly wire intr_event functions to their x86 hooks
ehem Oct 3, 2024
9df6b6d
intr/x86: convert interrupt infrastructure to inline intr_event struc…
ehem Sep 28, 2024
15fb342
x86/msi: remove msi_irq from msi_intsrc structure
ehem Aug 23, 2023
5185586
intr/x86: move setting of ->is_pic inside intr_register_source()
ehem Nov 3, 2024
78712f8
intr/x86: interpret pointer to intr_event as "source" value
ehem Oct 14, 2024
d5140de
intr/x86: remove architecture copy of PIC device
ehem Oct 14, 2024
dd5c215
intr/x86: purge transition compatibility macros/typedefs
ehem Nov 9, 2024
f0099a2
intrng: introduce PIC base class
ehem Oct 2, 2024
3cb4149
intrng: switch to intr_event_create_device()
ehem Oct 2, 2024
84a2b3b
intrng: switch support to event interrupt interface, remove INTRNG ha…
ehem Oct 3, 2024
8855ca6
arm64/mv_gpio: mark remaining functions as static
ehem Nov 28, 2024
a4ad325
arm64/mv_gpio: disable unused functions
ehem Nov 9, 2024
b734565
arm64/mv_gpio: disconnect Marvell GPIO driver from kernel build
ehem Oct 14, 2024
f2c78cc
intrng: convert interrupt infrastructure to inline intr_event structures
ehem Sep 28, 2024
4a45251
intrng: interpret pointer to intr_event as "source" value
ehem Oct 14, 2024
c2f3666
intrng: remove architecture copy of PIC device
ehem Oct 14, 2024
eba3b53
sys/powerpc: cleanup device driver module setup
ehem Oct 2, 2024
4cd6870
intr/powerpc: introduce PIC base class
ehem Oct 2, 2024
4935858
intr/powerpc: add IPI PIC device
ehem Oct 11, 2024
0d1dbb8
intr/powerpc: switch to intr_event_create_device()
ehem Oct 2, 2024
f9d463d
intr/powerpc: convert interrupt infrastructure to inline intr_event s…
ehem Sep 28, 2024
cc65616
intr/powerpc: interpret pointer to intr_event as "source" value
ehem Oct 14, 2024
13bad29
intr/powerpc: remove architecture copy of PIC device
ehem Oct 14, 2024
737e7d6
intrcompat: move pic_base_class declaration to sys/interrupt.h
ehem Nov 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion sys/amd64/acpica/acpi_wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#include <machine/clock.h>
#include <machine/cpu.h>
#include <machine/intr_machdep.h>
#include <machine/interrupt.h>
#include <machine/md_var.h>
#include <x86/mca.h>
#include <machine/pcb.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/amd64/amd64/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#include <machine/cputypes.h>
#include <machine/frame.h>
#include <machine/intr_machdep.h>
#include <machine/interrupt.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
#include <machine/psl.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/amd64/amd64/machdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
#include <machine/cpu.h>
#include <machine/cputypes.h>
#include <machine/frame.h>
#include <machine/intr_machdep.h>
#include <machine/interrupt.h>
#include <x86/mca.h>
#include <machine/md_var.h>
#include <machine/metadata.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/amd64/amd64/pmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
#include <vm/uma.h>

#include <machine/asan.h>
#include <machine/intr_machdep.h>
#include <machine/interrupt.h>
#include <x86/apicvar.h>
#include <x86/ifunc.h>
#include <machine/cpu.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/amd64/amd64/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ PMC_SOFT_DEFINE( , , page_fault, write);
#include <vm/vm_extern.h>

#include <machine/cpu.h>
#include <machine/intr_machdep.h>
#include <machine/interrupt.h>
#include <x86/mca.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/amd64/ia32/ia32_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#include <vm/vm_extern.h>

#include <machine/cpu.h>
#include <machine/intr_machdep.h>
#include <machine/interrupt.h>
#include <machine/md_var.h>

#include <compat/freebsd32/freebsd32_signal.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
* SUCH DAMAGE.
*/

#ifndef __MACHINE_INTR_MACHDEP_H__
#define __MACHINE_INTR_MACHDEP_H__
#ifndef __MACHINE_INTERRUPT_H__
#define __MACHINE_INTERRUPT_H__

#include <x86/intr_machdep.h>
#include <x86/interrupt.h>

/*
* The following data structure holds per-cpu data, and is placed just
Expand All @@ -44,4 +44,4 @@ struct nmi_pcpu {
#define MCE_STACK_SIZE PAGE_SIZE
#define DBG_STACK_SIZE PAGE_SIZE

#endif /* !__MACHINE_INTR_MACHDEP_H__ */
#endif /* !__MACHINE_INTERRUPT_H__ */
20 changes: 10 additions & 10 deletions sys/arm/allwinner/a10/a10_intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <sys/systm.h>
#include <sys/sched.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/interrupt.h>

#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
Expand Down Expand Up @@ -366,21 +366,21 @@ static device_method_t a10_aintc_methods[] = {
DEVMETHOD(device_probe, a10_aintc_probe),
DEVMETHOD(device_attach, a10_aintc_attach),

/* Interrupt event interface */
DEVMETHOD(intr_event_pre_ithread, a10_intr_pre_ithread),
DEVMETHOD(intr_event_post_ithread, a10_intr_post_ithread),
DEVMETHOD(intr_event_post_filter, a10_intr_post_filter),

/* Interrupt controller interface */
DEVMETHOD(pic_disable_intr, a10_intr_disable_intr),
DEVMETHOD(pic_enable_intr, a10_intr_enable_intr),
DEVMETHOD(pic_map_intr, a10_intr_map_intr),
DEVMETHOD(pic_post_filter, a10_intr_post_filter),
DEVMETHOD(pic_post_ithread, a10_intr_post_ithread),
DEVMETHOD(pic_pre_ithread, a10_intr_pre_ithread),
{ 0, 0 }
};

static driver_t a10_aintc_driver = {
"aintc",
a10_aintc_methods,
sizeof(struct a10_aintc_softc),
DEVMETHOD_END
};

DEFINE_CLASS_1(aintc, a10_aintc_driver, a10_aintc_methods,
sizeof(struct a10_aintc_softc), pic_base_class);

EARLY_DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, 0, 0,
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_FIRST);
2 changes: 1 addition & 1 deletion sys/arm/allwinner/a10_sramc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/intr.h>
#include <machine/interrupt.h>

#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/arm/allwinner/a10_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <sys/timetc.h>
#include <sys/watchdog.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/interrupt.h>
#include <machine/machdep.h>

#include <dev/ofw/openfirm.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/arm/allwinner/a20/a20_cpu_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <sys/watchdog.h>
#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/intr.h>
#include <machine/interrupt.h>

#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
Expand Down
17 changes: 8 additions & 9 deletions sys/arm/allwinner/aw_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include <sys/proc.h>

#include <machine/bus.h>
#include <machine/interrupt.h>
#include <machine/resource.h>
#include <machine/intr.h>

#include <dev/gpio/gpiobusvar.h>
#include <dev/ofw/ofw_bus.h>
Expand Down Expand Up @@ -1530,15 +1530,17 @@ static device_method_t aw_gpio_methods[] = {
DEVMETHOD(device_attach, aw_gpio_attach),
DEVMETHOD(device_detach, aw_gpio_detach),

/* Interrupt event interface */
DEVMETHOD(intr_event_pre_ithread, aw_gpio_pic_pre_ithread),
DEVMETHOD(intr_event_post_ithread, aw_gpio_pic_post_ithread),
DEVMETHOD(intr_event_post_filter, aw_gpio_pic_post_filter),

/* Interrupt controller interface */
DEVMETHOD(pic_disable_intr, aw_gpio_pic_disable_intr),
DEVMETHOD(pic_enable_intr, aw_gpio_pic_enable_intr),
DEVMETHOD(pic_map_intr, aw_gpio_pic_map_intr),
DEVMETHOD(pic_setup_intr, aw_gpio_pic_setup_intr),
DEVMETHOD(pic_teardown_intr, aw_gpio_pic_teardown_intr),
DEVMETHOD(pic_post_filter, aw_gpio_pic_post_filter),
DEVMETHOD(pic_post_ithread, aw_gpio_pic_post_ithread),
DEVMETHOD(pic_pre_ithread, aw_gpio_pic_pre_ithread),

/* GPIO protocol */
DEVMETHOD(gpio_get_bus, aw_gpio_get_bus),
Expand All @@ -1563,11 +1565,8 @@ static device_method_t aw_gpio_methods[] = {
DEVMETHOD_END
};

static driver_t aw_gpio_driver = {
"gpio",
aw_gpio_methods,
sizeof(struct aw_gpio_softc),
};
DEFINE_CLASS_1(gpio, aw_gpio_driver, aw_gpio_methods,
sizeof(struct aw_gpio_softc), pic_base_class);

EARLY_DRIVER_MODULE(aw_gpio, simplebus, aw_gpio_driver, 0, 0,
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
2 changes: 1 addition & 1 deletion sys/arm/allwinner/aw_mp.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <machine/cpu.h>
#include <machine/smp.h>
#include <machine/fdt.h>
#include <machine/intr.h>
#include <machine/interrupt.h>
#include <machine/platformvar.h>

#include <arm/allwinner/aw_mp.h>
Expand Down
19 changes: 9 additions & 10 deletions sys/arm/allwinner/aw_nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <sys/proc.h>
#include <sys/rman.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/interrupt.h>

#include <dev/fdt/fdt_intr.h>
#include <dev/ofw/openfirm.h>
Expand Down Expand Up @@ -393,24 +393,23 @@ static device_method_t aw_nmi_methods[] = {
DEVMETHOD(device_probe, aw_nmi_probe),
DEVMETHOD(device_attach, aw_nmi_attach),

/* Interrupt event interface */
DEVMETHOD(intr_event_pre_ithread, aw_nmi_pre_ithread),
DEVMETHOD(intr_event_post_ithread, aw_nmi_post_ithread),
DEVMETHOD(intr_event_post_filter, aw_nmi_post_filter),

/* Interrupt controller interface */
DEVMETHOD(pic_disable_intr, aw_nmi_disable_intr),
DEVMETHOD(pic_enable_intr, aw_nmi_enable_intr),
DEVMETHOD(pic_map_intr, aw_nmi_map_intr),
DEVMETHOD(pic_setup_intr, aw_nmi_setup_intr),
DEVMETHOD(pic_teardown_intr, aw_nmi_teardown_intr),
DEVMETHOD(pic_post_filter, aw_nmi_post_filter),
DEVMETHOD(pic_post_ithread, aw_nmi_post_ithread),
DEVMETHOD(pic_pre_ithread, aw_nmi_pre_ithread),

{0, 0},
DEVMETHOD_END
};

static driver_t aw_nmi_driver = {
"aw_nmi",
aw_nmi_methods,
sizeof(struct aw_nmi_softc),
};
DEFINE_CLASS_1(aw_nmi, aw_nmi_driver, aw_nmi_methods,
sizeof(struct aw_nmi_softc), pic_base_class);

EARLY_DRIVER_MODULE(aw_nmi, simplebus, aw_nmi_driver, 0, 0,
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
25 changes: 12 additions & 13 deletions sys/arm/allwinner/aw_r_intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <machine/intr.h>
#include <machine/interrupt.h>

#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
Expand Down Expand Up @@ -189,7 +189,7 @@ aw_r_intc_gicp_map_intr(device_t dev, struct intr_map_data *data,
return (EINVAL);

ret = PIC_MAP_INTR(sc->parent, data, isrcp);
(*isrcp)->isrc_dev = sc->dev;
(*isrcp)->isrc_event.ie_pic = sc->dev;
return(ret);
}

Expand Down Expand Up @@ -243,7 +243,7 @@ aw_r_intc_gicp_pre_ithread(device_t dev, struct intr_irqsrc *isrc)

sc = device_get_softc(dev);

PIC_PRE_ITHREAD(sc->parent, isrc);
INTR_EVENT_PRE_ITHREAD(sc->parent, isrc);
}

static void
Expand All @@ -253,7 +253,7 @@ aw_r_intc_gicp_post_ithread(device_t dev, struct intr_irqsrc *isrc)

sc = device_get_softc(dev);

PIC_POST_ITHREAD(sc->parent, isrc);
INTR_EVENT_POST_ITHREAD(sc->parent, isrc);
}

static void
Expand All @@ -263,7 +263,7 @@ aw_r_intc_gicp_post_filter(device_t dev, struct intr_irqsrc *isrc)

sc = device_get_softc(dev);

PIC_POST_FILTER(sc->parent, isrc);
INTR_EVENT_POST_FILTER(sc->parent, isrc);
}

static device_method_t aw_r_intc_gicp_methods[] = {
Expand All @@ -272,6 +272,11 @@ static device_method_t aw_r_intc_gicp_methods[] = {
DEVMETHOD(device_attach, aw_r_intc_gicp_attach),
DEVMETHOD(device_detach, aw_r_intc_gicp_detach),

/* Interrupt event interface */
DEVMETHOD(intr_event_pre_ithread, aw_r_intc_gicp_pre_ithread),
DEVMETHOD(intr_event_post_ithread, aw_r_intc_gicp_post_ithread),
DEVMETHOD(intr_event_post_filter, aw_r_intc_gicp_post_filter),

/* Interrupt controller interface */
DEVMETHOD(pic_activate_intr, aw_r_intc_gicp_activate_intr),
DEVMETHOD(pic_disable_intr, aw_r_intc_gicp_disable_intr),
Expand All @@ -280,18 +285,12 @@ static device_method_t aw_r_intc_gicp_methods[] = {
DEVMETHOD(pic_deactivate_intr, aw_r_intc_gicp_deactivate_intr),
DEVMETHOD(pic_setup_intr, aw_r_intc_gicp_setup_intr),
DEVMETHOD(pic_teardown_intr, aw_r_intc_gicp_teardown_intr),
DEVMETHOD(pic_post_filter, aw_r_intc_gicp_post_filter),
DEVMETHOD(pic_post_ithread, aw_r_intc_gicp_post_ithread),
DEVMETHOD(pic_pre_ithread, aw_r_intc_gicp_pre_ithread),

DEVMETHOD_END
};

static driver_t aw_r_intc_gicp_driver = {
"aw_r_intc_gicp",
aw_r_intc_gicp_methods,
sizeof(struct aw_r_intc_gicp_softc),
};
DEFINE_CLASS_1(aw_r_intc_gicp, aw_r_intc_gicp_driver, aw_r_intc_gicp_methods,
sizeof(struct aw_r_intc_gicp_softc), pic_base_class);

EARLY_DRIVER_MODULE(aw_r_intc_gicp, simplebus, aw_r_intc_gicp_driver, 0, 0,
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
2 changes: 1 addition & 1 deletion sys/arm/allwinner/if_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include <sys/gpio.h>

#include <machine/bus.h>
#include <machine/interrupt.h>
#include <machine/resource.h>
#include <machine/intr.h>

#include <net/if.h>
#include <net/if_var.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/arm/annapurna/alpine/alpine_machdep_mp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include <machine/smp.h>
#include <machine/fdt.h>
#include <machine/intr.h>
#include <machine/interrupt.h>
#include <machine/cpu.h>
#include <machine/platformvar.h>

Expand Down
1 change: 0 additions & 1 deletion sys/arm/annapurna/alpine/alpine_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/intr.h>

#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
Expand Down
2 changes: 1 addition & 1 deletion sys/arm/arm/busdma_machdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <sys/bus.h>
#include <sys/busdma_bufalloc.h>
#include <sys/counter.h>
#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/lock.h>
Expand All @@ -59,6 +58,7 @@
#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/interrupt.h>
#include <machine/md_var.h>

//#define ARM_BUSDMA_MAPLOAD_STATS
Expand Down
2 changes: 1 addition & 1 deletion sys/arm/arm/exception.S
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
#include <machine/asm.h>
#include <machine/armreg.h>
#include <machine/asmacros.h>
#include <machine/interrupt.h>
#include <machine/trap.h>
#include <sys/intr.h>

#ifdef KDTRACE_HOOKS
.bss
Expand Down
2 changes: 1 addition & 1 deletion sys/arm/arm/generic_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/intr.h>
#include <machine/interrupt.h>
#include <machine/machdep.h>
#include <machine/md_var.h>

Expand Down
Loading
Loading