git: 0bb867e9f565 - main - acpi: Split ACPI IVARs into global and private sets
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Feb 2026 20:33:28 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=0bb867e9f56500e30948ea7c440dd1166097df7f
commit 0bb867e9f56500e30948ea7c440dd1166097df7f
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-02-24 20:30:06 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-02-24 20:30:06 +0000
acpi: Split ACPI IVARs into global and private sets
ACPI_IVAR_HANDLE is the only true "global" IVAR that can be used
across multiple bus drivers. The other IVARs are private to direct
children of acpi0. However, they need to be numbered after ISA IVARs
as ACPI mimics an ISA bus device. To ensure this remains true, add an
ISA_IVAR_LAST to use in assert that the private ACPI IVARs do not
overlap with ISA IVARs.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55354
---
sys/dev/acpica/acpi.c | 3 +++
sys/dev/acpica/acpivar.h | 6 +++---
sys/isa/isavar.h | 3 ++-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index f903f265f9fa..3a664523c27e 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1154,6 +1154,9 @@ acpi_child_deleted(device_t dev, device_t child)
free(dinfo, M_ACPIDEV);
}
+_Static_assert(ACPI_IVAR_PRIVATE >= ISA_IVAR_LAST,
+ "ACPI private IVARs overlap with ISA IVARs");
+
/*
* Handle per-device ivars
*/
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index d1d55d2b7e5f..336f6ed1dc94 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -278,10 +278,10 @@ extern int acpi_override_isa_irq_polarity;
* attach to ACPI.
*/
enum {
- ACPI_IVAR_HANDLE = BUS_IVARS_ACPI,
- ACPI_IVAR_PRIVATE,
+ ACPI_IVAR_PRIVATE = 20,
ACPI_IVAR_FLAGS,
- ACPI_IVAR_DOMAIN
+ ACPI_IVAR_DOMAIN,
+ ACPI_IVAR_HANDLE = BUS_IVARS_ACPI
};
/*
diff --git a/sys/isa/isavar.h b/sys/isa/isavar.h
index f0b880de2930..39eb7c2bc76c 100644
--- a/sys/isa/isavar.h
+++ b/sys/isa/isavar.h
@@ -128,7 +128,8 @@ enum isa_device_ivars {
ISA_IVAR_CONFIGATTR,
ISA_IVAR_PNP_CSN,
ISA_IVAR_PNP_LDN,
- ISA_IVAR_PNPBIOS_HANDLE
+ ISA_IVAR_PNPBIOS_HANDLE,
+ ISA_IVAR_LAST
};
/*