-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[GSoC WIP] liblua: ACPICA Lua bindings #1819
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
Open
kpowkitty
wants to merge
5
commits into
freebsd:main
Choose a base branch
from
kpowkitty:lacpi_clean
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+3,557
−49
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bsdimp
reviewed
Aug 24, 2025
bsdimp
reviewed
Aug 24, 2025
bsdimp
reviewed
Aug 24, 2025
bsdimp
reviewed
Aug 24, 2025
bsdimp
reviewed
Aug 24, 2025
bsdimp
reviewed
Aug 24, 2025
bsdimp
reviewed
Aug 24, 2025
f797cb7
to
bf884a3
Compare
kpowkitty
added a commit
to kpowkitty/freebsd-src
that referenced
this pull request
Sep 8, 2025
Description: Continuation of freebsd#1819. [WIP] Needs to be tested.
kpowkitty
added a commit
to kpowkitty/freebsd-src
that referenced
this pull request
Sep 8, 2025
Description: Continuation of freebsd#1819. [WIP] Needs to be tested.
kpowkitty
added a commit
to kpowkitty/freebsd-src
that referenced
this pull request
Sep 8, 2025
Description: Continuation of freebsd#1819. [WIP] Needs to be tested.
bf884a3
to
843f714
Compare
1f67a35
to
2452892
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)
These bindings have two conditions: (1) Must be built on `amd64` (2) Must be building `loader_lua` If these conditions are met: - Add liblua as a subdir in EFI - Include liblua/acpi/include in loader/Makefile - Add set_lua_acpi_modules to the loader compile set - Add 'lacpi.h' to loader/main.c and reference the bindings
2452892
to
a53ebc2
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GSoC WIP under @bsdimp
Follows #1843 and #1818 in that order.
Description:
Lua bindings for ACPICA in loader to provide an interface for users to
print the ACPI namespace, attach/detach/get data off of device nodes,
and evaluate objects.
Please see man page commit for
acpi.lua
for more informationlacpi_object.c
Module for evaluating ACPI objects.
This module also provides the ability to convert pathnames into
their opaque pointer using
get_handle
.lacpi_walk.c
Allows users to walk the namespace in the loader.
Currently works by walking the entire namespace and
storing each node in a 2D table of nodes.
Use case:
nodes = lacpi.walk.namespace()
for _, node in ipairs(nodes) do
print(node.path, node.lvl, node.hid, node.uid)
end
Future plans:
(1) better representation of nodes for the user when printed
(2) strategy patterns for how to receive the namespace
lacpi_data.c
Allows a user to post ACPI_OBJECTs onto namespace nodes.
See actypes.h for all possible ACPI_OBJECTs.
Sponsored by: Google Summer of Code 2025
Signed-off-by: Kayla Powell (AKA Kat) [email protected]