-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[GSoC WIP] efi: create libacpi #1818
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for taking the time to contribute to FreeBSD! Please review CONTRIBUTING.md, then update and push your branch again. |
stand/efi/acpica/init_acpi.c
Outdated
/* Initialize root tables. */ | ||
if (ACPI_FAILURE(status = acpi_Startup())) { | ||
printf("ACPI: Startup failed with status %s\n", AcpiFormatException(status)); | ||
printf("ACPI: Try disabling either ACPI or apic support.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this advice needs to be tailored to the loader.
And suggests we want a way to disable looking for ACPI which might be its own can of worms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted to have method headers and minimal error message. Let me know if a more verbose error message is preferred.
@@ -0,0 +1,1526 @@ | |||
/****************************************************************************** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to snag this diff, github's tool is useless for review.
* because ACPICA is fully compatible with other ACPI implementations. | ||
* Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior. | ||
*/ | ||
#ifndef _STANDALONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this false for the loader?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. So, when I first was building, I was consistently getting a null reference on the _OSI node when I was printing the ACPI namespace for debug in one of the ACPI routines. May be my own error. I did test that it compiles and runs without the interjected print statements, so I reverted this change. Let me know if we should keep it.
764e41e
to
4c39c41
Compare
This work follows freebsd#1818.
This work follows freebsd#1818.
This work follows freebsd#1818.
This work follows freebsd#1818.
This work follows freebsd#1818.
This work follows freebsd#1818.
4c39c41
to
4bcc762
Compare
Module for evaluating ACPI objects. Currently being tested. This work follows freebsd#1818.
f822fba
to
eb02ef3
Compare
Description: Refactored ACPICA for partial initialization in the loader. This work is the final preface for Lua bindings. Work on this commit involves: Subset ACPICA for loader land: For our Lua bindings, we need to be able to walk the ACPI namespace and evaluate objects. To do so, we need AcpiInitializeSubsystem, AcpiInitializeTables, AcpiEnableSubsystem, and AcpiLoadTables. 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)
eb02ef3
to
284441c
Compare
284441c
to
8d354b3
Compare
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:
(arm64 will be addressed in a future update)
but with events enabled. This is so that we do not need to pull
in all of ACPI_HARDWARE, but can evaluate objects.
around loader's/lua binding's needs:
the namespace and evaluating objects. (utxfinit.c)
output. (osunixxf.c)
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]