Skip to content

Commit

Permalink
intrng: cleanup #include situation
Browse files Browse the repository at this point in the history
Various files #including INTRNG interrupt headers were inconsistent
in whether they #include'd sys/intr.h or machine/intr.h.  Since there is
a need to work with other architectures, move to #include of
machine/intr.h.  Modify sys/intr.h to #error if machine headers are
included first and future uses match this.

Remove #include of intr.h where possible.

Sort of fixes c85855a.  The breakage was out too long.
  • Loading branch information
ehem committed Nov 4, 2024
1 parent 21b31cd commit 44533dc
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 20 deletions.
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: 0 additions & 2 deletions sys/arm/broadcom/bcm2835/bcm2838_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <sys/bus.h>
#include <sys/proc.h>
#include <sys/rman.h>
#include <sys/intr.h>
#include <sys/mutex.h>

#include <dev/ofw/openfirm.h>
Expand All @@ -47,7 +46,6 @@
#include <dev/pci/pcib_private.h>

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

#include "pcib_if.h"
#include "msi_if.h"
Expand Down
2 changes: 0 additions & 2 deletions sys/arm64/rockchip/rk3568_pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <sys/bus.h>
#include <sys/proc.h>
#include <sys/rman.h>
#include <sys/intr.h>
#include <sys/mutex.h>
#include <sys/gpio.h>

Expand All @@ -55,7 +54,6 @@
#include <dev/hwreset/hwreset.h>

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

#include <vm/vm.h>
#include <vm/vm_extern.h>
Expand Down
6 changes: 3 additions & 3 deletions sys/dev/acpica/acpivar.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
#include "acpi_if.h"
#include "bus_if.h"
#include <sys/_eventhandler.h>
#ifdef INTRNG
#include <sys/intr.h>
#endif
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/mutex.h>
Expand All @@ -45,6 +42,9 @@
#include <sys/sysctl.h>

#include <machine/bus.h>
#ifdef INTRNG
#include <machine/intr.h>
#endif
#include <machine/resource.h>

struct apm_clone_data;
Expand Down
3 changes: 0 additions & 3 deletions sys/dev/gpio/gpiobus.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/gpio.h>
#ifdef INTRNG
#include <sys/intr.h>
#endif
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
Expand Down
9 changes: 5 additions & 4 deletions sys/dev/gpio/gpiobusvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
#include <sys/mutex.h>
#include <sys/rman.h>

#ifdef FDT
#include <dev/ofw/ofw_bus_subr.h>
#ifdef INTRNG
/* touched by LINT-ACPI */
#include <machine/intr.h>
#endif

#ifdef INTRNG
#include <sys/intr.h>
#ifdef FDT
#include <dev/ofw/ofw_bus_subr.h>
#endif

#include "gpio_if.h"
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ofw/ofw_bus_subr.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <sys/bus.h>
#ifdef INTRNG
#include <sys/intr.h>
#include <machine/intr.h>
#endif
#include <dev/ofw/openfirm.h>

Expand Down
3 changes: 2 additions & 1 deletion sys/kern/pic_if.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
#include <sys/bus.h>
#include <sys/cpuset.h>
#include <sys/resource.h>
#include <sys/intr.h>

#include <machine/intr.h>

INTERFACE pic;

Expand Down
6 changes: 3 additions & 3 deletions sys/kern/subr_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/cpuset.h>
#ifdef INTRNG
#include <sys/intr.h>
#endif

#include <net/vnet.h>

#include <machine/cpu.h>
#ifdef INTRNG
#include <machine/intr.h>
#endif
#include <machine/stdarg.h>

#include <vm/uma.h>
Expand Down
4 changes: 4 additions & 0 deletions sys/sys/intr.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#error Need INTRNG for this file
#endif

#if !defined(_MACHINE_INTR_MACHDEP_H_) && !defined(_MACHINE_INTR_H_)
#error "sys/intr.h included without architecture interrupt header!"
#endif

#include <sys/systm.h>

Check warning on line 40 in sys/sys/intr.h

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line

#define INTR_IRQ_INVALID 0xFFFFFFFF

Check warning on line 42 in sys/sys/intr.h

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
Expand Down

0 comments on commit 44533dc

Please sign in to comment.