[GSoC WIP] efi: create libacpi
GSoC WIP under @bsdimp
Description:
Refactored ACPICA for partial initialization in the loader. This work is the preface for Lua bindings.
For our Lua bindings, we want to be able to walk the ACPI namespace and evaluate objects. So, I've taken what the kernel does in acpi_Startup() as a starting point, and added the ACPI initialization for this. That includes AcpiInitializeSubsystem, AcpiInitializeTables, AcpiEnableSubsystem, and AcpiLoadTables. It is initialized in reduced hardware mode with events enabled, to (1) match what our Lua interface desires and (2) create a smaller subset of ACPICA for the loader environment.
Notes:
- acpi_detect() moved into libacpi.
- Libacpi conditionally compiles ACPICA and glue code on amd64. (arm64 will be addressed in a future update)
- AcpiEnableSubsystem is initialized in reduced hardware mode, but with events enabled. This is so that we do not need to pull in all of ACPI_HARDWARE, but can evaluate objects.
- Stubbed out Osd functions required for this limited initialization.
- Conditionally exclude functions to make a minimal subset designed
around loader's/lua binding's needs:
- Exclude AcpiInitializeObjects, as we do not need this for walking the namespace and evaluating objects. (utxfinit.c)
- Exclude notify handlers or fixed event handlers. (evxface.c)
- Stub out print functions, as the loader does not have standard output. (osunixxf.c)
- Stub out AcpiOsSleep and AcpiOsGetTimer, as the loader is not multi-threaded and does not implement timers. (osunixxf.c)
Sponsored by: Google Summer of Code 2025 Signed-off-by: Kayla Powell (AKA Kat) [email protected]
Thank you for taking the time to contribute to FreeBSD! There is an issue that needs to be fixed:
- Missing Signed-off-by linesb5d71ae63f66c89022781d01b9aeebc1a5746798, 8d354b3bda4f01f4929279ba3d048461b0c1bfa8
Please review CONTRIBUTING.md, then update and push your branch again.