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
This commit is contained in:
John Baldwin
2026-02-24 15:30:06 -05:00
parent b937f9bf75
commit 0bb867e9f5
3 changed files with 8 additions and 4 deletions
+3
View File
@@ -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
*/
+3 -3
View File
@@ -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
};
/*
+2 -1
View File
@@ -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
};
/*