uACPI
A portable and easy-to-integrate implementation of the Advanced Configuration and Power Interface (ACPI).
Features
- A fast and well-tested AML interpreter optimized to use very little stack space
- NT-compatible on a fundamental level (see examples)
- Very easy to integrate (ships with own overridable standard library implementation)
- Highly flexible and configurable (optional sized frees, reduced-hw-only mode, etc.)
- A fairly advanced event subsystem (GPE/fixed, wake, implicit notify, AML handlers)
- Table management API (search, dynamic installation/loading, overrides, etc.)
- Operation region subsystem (user handlers, support for BufferAcc opregions, builtins for common types)
- Sleep state management (transition to any S state, wake vector programming)
- PCI routing table retrieval & interrupt model API
- Device search API
- Resource subsystem supporting every resource defined by ACPI 6.6
- Interface & feature management exposed via _OSI
- Client-defined Notify() handlers
- Firmware global lock management (_GL, locked fields, public API)
- GAS read/write API
- Fully thread safe
- Supports both 32-bit and 64-bit platforms
- A special barebones mode with only table API (see config.h)
Why would I use this over ACPICA?
1. Performance
uACPI shows a consistent speedup of about 3.5x over ACPICA in synthetic AML tests.
More details
Code that was tested:
Method (TOMS, 2, NotSerialized) {
Return ((Arg1 - Arg0) / 10000)
}
Method (ADDM, 1, NotSerialized) {
Local0 = 0
While (Arg0) {
Local0 += Arg0 + Arg0
Arg0--
}
Return (Local0)
}
// Record start time
Local0 = Timer
// Run 10 million additions
Local1 = ADDM(10000000)
// Make sure the answer matches expected
If (Local1 != 0x5AF31112D680) {
Printf("Bad test result %o", Local1)
Return (1)
}
// Record end time
Local2 = Timer
Printf("10,000,000 additions took %o ms",
ToDecimalString(TOMS(Local0, Local2)))
Compile options (acpiexec and uACPI's test-runner): -O3 -flto -march=znver4 -mtune=znver4
CPU: AMD Ryzen 9 9950X3D
Raw test scores (~average over 10 runs):
- ACPICA: 16661 ms
- uACPI: 4753 ms
Raw difference: 3.5053x
Real hardware tests of the same operating system using uACPI vs ACPICA show at least a 1.75-2x speedup while measuring the time it takes to load the initial AML namespace.
More details
OS: proxima
Compile options: -O3 -flto
Test Subject 1
Specs: Gigabyte B550M S2H, AMD Ryzen 5800X, 64GB RAM
Firmware: F19d (10097 AML opcodes)
Results:
- ACPICA: 3,936,953 ns
- uACPI: 1,902,077 ns
Raw difference: 2.0698x
Test Subject 2
Specs: Toshiba Portege R30-A, Intel Core i5-4200M, 4GB RAM
Firmware: 4.40 (4962 AML opcodes)
Results:
- ACPICA: 10,899,233 ns
- uACPI: 6,227,036 ns
Raw difference: 1.7503x
2. NT-compatible from the ground up
Over the decades of development, ACPICA has accumulated a lot of workarounds for AML expecting NT-specific behaviors, and is still missing compatibility in a lot of critical aspects.
uACPI, on the other hand, is built to be natively NT-compatible without extra workarounds.
Some specific highlights include:
- Reference objects, especially multi-level reference chains
- Implicit cast semantics
- Object mutability
- Named object resolution, especially for named objects inside packages
3. Fundamental safety
uACPI is built to always assume the worst about the AML byte code it's executing, and as such, has a more sophisticated object lifetime tracking system, as well as carefully designed handling for various edge-cases, including race conditions.
Some of the standard uACPI test cases crash both ACPICA, and the NT AML interpreters.
While a permanent fuzzing solution for uACPI is currently WIP, it has already been fuzzed quite extensively and all known issues have been fixed.
4. No recursion
Running at kernel level has a lot of very strict limitations, one of which is a tiny stack size, which can sometimes be only a few pages in length.
Of course, both ACPICA and uACPI have non-recursive AML interpreters, but there are still edge cases that cause potentially unbounded recursion.
One such example are the dynamic table load operators from AML
(Load/LoadTable): these cause a linear growth in stack usage per call in
ACPICA, whereas in uACPI these are treated as special method calls,
and as such, don't increase stack usage whatsoever.
More detailed overview
Expressions within package:
Method (TEST) {
Local0 = 10
Local1 = Package { Local0 * 5 }
Return (DerefOf(Local1[0]))
}
// ACPICA: AE_SUPPORT, Expressions within package elements are not supported
// Windows, uACPI: Local0 = 50
Local0 = TEST()
Packages outside of a control method:
// ACPICA: internal error
// Windows, uACPI: ok
Local0 = Package { 1 }
Reference rebind semantics:
Local0 = 123
Local1 = RefOf(Local0)
// ACPICA: Local1 = 321, Local0 = 123
// Windows, uACPI: Local1 = reference->Local0, Local0 = 321
Local1 = 321
Increment/Decrement:
Local0 = 123
Local1 = RefOf(Local0)
// ACPICA: error
// Windows, uACPI: Local0 = 124
Local1++
Multilevel references:
Local0 = 123
Local1 = RefOf(Local0)
Local2 = RefOf(Local1)
// ACPICA: Local3 = reference->Local0
// Windows, uACPI: Local3 = 123
Local3 = DerefOf(Local2)
Implict-cast semantics:
Name (TEST, "BAR")
// ACPICA: TEST = "00000000004F4F46"
// Windows, uACPI: TEST = "FOO"
TEST = 0x4F4F46
Buffer size mutability:
Name (TEST, "XXXX")
Name (VAL, "")
// ACPICA: TEST = "LONGSTRING"
// Windows, UACPI: TEST = "LONG"
TEST = "LONGSTRING"
// ACPICA: VAL = "FOO"
// Windows, UACPI: VAL = ""
VAL = "FOO"
Returning a reference to a local object:
Method (TEST) {
Local0 = 123
// Use-after-free in ACPICA, perfectly fine in uACPI
Return (RefOf(Local0))
}
Method (FOO) {
Name (TEST, 123)
// Use-after-free in ACPICA, object lifetime prolonged in uACPI (node is still removed from the namespace)
Return (RefOf(TEST))
}
CopyObject into self:
Method (TEST) {
CopyObject(123, TEST)
Return (1)
}
// Segfault in ACPICA, prints 1 in uACPI
Debug = TEST()
// Unreachable in ACPICA, prints 123 in uACPI
Debug = TEST
There's even more examples, but this should be enough to demonstrate the fundamental differences in designs.
Integrating into a kernel
1. Add uACPI sources & include directories into your project
If you're using CMake
Simply add the following lines to your cmake:
include(uacpi/uacpi.cmake)
target_sources(
my-kernel
PRIVATE
${UACPI_SOURCES}
)
target_include_directories(
my-kernel
PRIVATE
${UACPI_INCLUDES}
)
If you're using Meson
Add the following lines to your meson.build:
uacpi = subproject('uacpi')
uacpi_sources = uacpi.get_variable('sources')
my_kernel_sources += uacpi_sources
uacpi_includes = uacpi.get_variable('includes')
my_kernel_includes += uacpi_includes
Any other build system
- Add all .c files from source into your target sources
- Add include into your target include directories
2. Implement/override platform-specific headers
uACPI defines all platform/architecture-specific functionality in a few headers inside include/uacpi/platform
All of the headers can be "implemented" by your project in a few ways:
- Implement the expected helpers exposed by the headers
- Replace the expected helpers by your own and override uACPI to use them by defining the respective
UACPI_OVERRIDE_Xvariable. In this case, the header becomes a proxy that includes a correspondinguacpi_x.hheader exported by your project.
Currently used platform-specific headers are:
- arch_helpers.h - defines architecture/cpu-specific helpers & thread-id-related interfaces
- compiler.h - defines compiler-specific helpers like attributes and intrinsics. This already works for MSVC, clang & GCC so you most likely won't have to override it.
- atomic.h - defines compiler-specific helpers for dealing with atomic operations. Same as the header above, this should work out of the box for MSVC, clang & GCC.
- libc.h - an empty header by default, but may be overriden by your project if it implements any of the libc functions used by uACPI (by default uACPI uses its own implementations to be platform-independent and to make porting easier). The internal implementation is just the bare minimum and not optimized in any way.
- types.h - typedefs a bunch of uacpi-specific types using the
stdint.hheader. You don't have to override this unless you don't providestdint.h. - config.h - various compile-time options and settings, preconfigured to reasonable defaults.
3. Implement kernel API
uACPI relies on kernel-specific API to do things like mapping/unmapping memory, writing/reading to/from IO, PCI config space, and many more things.
This API is declared in kernel_api.h and is implemented by your kernel.
4. Initialize uACPI
That's it, uACPI is now integrated into your project.
You should proceed to initialization.
Refer to the uACPI page on osdev wiki to see a
snippet for basic initialization, as well as some code examples of how you may
want to use certain APIs.
All of the headers and APIs defined in uacpi are public and may be utilized by your project.
Anything inside uacpi/internal is considered private/undocumented and unstable API.
Developing and contributing
Most development work is fully doable in userland using the test runner.
Setting up an IDE:
Simply open tests/runner/CMakeLists.txt in your favorite IDE.
For Visual Studio:
cd tests\runner && mkdir build && cd build && cmake ..
Then just simply open the .sln file generated by cmake.
Running the test suite:
./tests/run_tests.py
If you want to contribute:
- Commits are expected to be atomic (changing one specific thing, or introducing one feature) with detailed description (if one is warranted for), an S-o-b line is welcome
- Code style is 4-space tabs, 80 cols, the rest can be seen by just looking at the current code
All contributions are very welcome!
Notable projects using uACPI & performance leaderboards
| Project | Description | (qemu w/ Q35 + KVM) ops/s | CPU |
|---|---|---|---|
| proxima | Unix-like microkernel-based operating system with uACPI running in userspace | 10,454,158 | AMD Ryzen 9 9950X3D |
| ilobilix | Yet another monolithic Linux clone wannabe. Currently under a rewrite | 8,703,286 | AMD Ryzen 9 9950X3D |
| Crescent2 | An NT driver compatible kernel and userspace | 6,818,418 | Intel Core i5-13600K |
| davix | Yet another unix-like by some bored nerd | 6,364,623 | Intel Core i7-13700K |
| Ironclad | Formally verified, hard real-time capable kernel written in SPARK and Ada | 6,196,937 | Intel Core i9-13900KS |
| Managarm | Pragmatic microkernel-based OS with fully asynchronous I/O | 5,618,646 | Intel Core i7-14700K |
| ChronOS | Another basic hobby os held together by duct tape, made in rust | 5,416,703 | Intel Core Ultra 7 265KF |
| pmOS | Microkernel-based operating system written from scratch with uACPI running in userspace | 5,354,445 | AMD Ryzen 9 5900X |
| menix | A minimal and expandable Unix-like operating system | 5,239,043 | Intel Core Ultra 7 265KF |
| Orange | Unix-like x86_64 OS with some microkernel features | 4,204,053 | AMD Ryzen 5 3600 |
| Astral | Operating system written in C which aims be POSIX-compliant | 4,189,189 | Intel Core i5-13600K |
| Keyronex | Layered kernel with fundamentally asynchronous I/O and working set model-based memory management | 4,013,691 | AMD Ryzen 5800X |
| OBOS | Hybrid kernel with module loading | 4,003,820 | Intel Core Ultra 7 265F |
| bentobox | 64-bit SMP-enabled operating system targeting x86_64 and aarch64 | 3,709,263 | AMD Ryzen 7 5800X |
| NyauxKC | Monolithic UNIX-like multi-architecture kernel | 1,966,580 | Intel Core i7-13700K |
| imaginarium | 64-bit os in zig supporting aarch64 and x86_64 | 1,908,315 | AMD Ryzen 7 3700X |
| ElysiumOS | Hybrid Unix-like kernel | 1,737,654 | AMD Ryzen 7 5800X3D |
| BadgerOS | A monolithic lightweight UNIX clone | 1,018,518 | AMD Ryzen 5 3600 |
| Retro Rocket | A BASIC powered 64-bit SMP multitasking OS | 441,329 | Intel Xeon E5-2680 |
| Hyra | Monolithic UNIX-like OS by OSMORA.ORG | 199,873 | Intel Core i3-3220 |
License
uACPI is licensed under the MIT License.
The full license text is provided in the LICENSE file inside the root directory.
Records
- acpi_gas
- acpi_rsdp
- acpi_sdt_hdr
- acpi_rsdt
- acpi_xsdt
- acpi_entry_hdr
- acpi_madt
- acpi_madt_lapic
- acpi_madt_ioapic
- acpi_madt_interrupt_source_override
- acpi_madt_nmi_source
- acpi_madt_lapic_nmi
- acpi_madt_lapic_address_override
- acpi_madt_iosapic
- acpi_madt_lsapic
- acpi_madt_platform_interrupt_source
- acpi_madt_x2apic
- acpi_madt_x2apic_nmi
- acpi_madt_gicc
- acpi_madt_gicd
- acpi_madt_gic_msi_frame
- acpi_madt_gicr
- acpi_madt_gic_its
- acpi_madt_multiprocessor_wakeup
- acpi_madt_core_pic
- acpi_madt_lio_pic
- acpi_madt_ht_pic
- acpi_madt_eio_pic
- acpi_madt_msi_pic
- acpi_madt_bio_pic
- acpi_madt_lpc_pic
- acpi_madt_rintc
- acpi_madt_imsic
- acpi_madt_aplic
- acpi_madt_plic
- acpi_srat
- acpi_srat_processor_affinity
- acpi_srat_memory_affinity
- acpi_srat_x2apic_affinity
- acpi_srat_gicc_affinity
- acpi_srat_gic_its_affinity
- acpi_srat_generic_affinity
- acpi_srat_rintc_affinity
- acpi_slit
- acpi_gtdt
- acpi_gtdt_entry_hdr
- acpi_gtdt_timer
- acpi_gtdt_timer_entry
- acpi_gtdt_watchdog
- acpi_fadt
- acpi_facs
- acpi_mcfg_allocation
- acpi_mcfg
- acpi_hpet
- acpi_dsdt
- acpi_ssdt
- acpi_ecdt
- acpi_dbg2
- acpi_dbg2_dbg_device_info
- acpi_spcr
- acpi_rhct_hdr
- acpi_rhct
- acpi_rhct_isa_string
- acpi_rhct_cmo
- acpi_rhct_mmu
- acpi_rhct_hart_info
-
acpi_small_item
Resources as encoded by the raw AML byte stream.
- acpi_resource_irq
- acpi_resource_dma
- acpi_resource_start_dependent
- acpi_resource_end_dependent
- acpi_resource_io
- acpi_resource_fixed_io
- acpi_resource_fixed_dma
- acpi_resource_vendor_defined_type0
- acpi_resource_end_tag
- acpi_large_item
- acpi_resource_memory24
- acpi_resource_vendor_defined_type1
- acpi_resource_memory32
- acpi_resource_fixed_memory32
- acpi_resource_address
- acpi_resource_address64
- acpi_resource_address32
- acpi_resource_address16
- acpi_resource_address64_extended
- acpi_resource_extended_irq
- acpi_resource_generic_register
- acpi_resource_gpio_connection
- acpi_resource_serial
- acpi_resource_serial_i2c
- acpi_resource_serial_spi
- acpi_resource_serial_uart
- acpi_resource_serial_csi2
- acpi_resource_pin_function
- acpi_resource_pin_configuration
- acpi_resource_pin_group
- acpi_resource_pin_group_function
- acpi_resource_pin_group_configuration
- acpi_resource_clock_input
- acpi_dmar_entry_hdr
- acpi_dmar
- acpi_dmar_dss
- acpi_dmar_drhd
- acpi_dmar_rmrr
- acpi_dmar_atsr
- acpi_dmar_rhsa
- acpi_dmar_andd
- acpi_dmar_satc
- acpi_dmar_sidp
- uacpi_resource_source
- uacpi_resource_irq
- uacpi_resource_extended_irq
- uacpi_resource_dma
- uacpi_resource_fixed_dma
- uacpi_resource_io
- uacpi_resource_fixed_io
- uacpi_memory_attribute
- uacpi_io_attribute
- uacpi_address_attribute
- uacpi_resource_address_common
- uacpi_resource_address16
- uacpi_resource_address32
- uacpi_resource_address64
- uacpi_resource_address64_extended
- uacpi_resource_memory24
- uacpi_resource_memory32
- uacpi_resource_fixed_memory32
- uacpi_resource_start_dependent
- uacpi_resource_vendor_defined
- uacpi_resource_vendor_typed
- uacpi_resource_generic_register
- uacpi_interrupt_connection_flags
- uacpi_io_connection_flags
- uacpi_resource_gpio_connection
- uacpi_resource_serial_bus_common
- uacpi_resource_i2c_connection
- uacpi_resource_spi_connection
- uacpi_resource_uart_connection
- uacpi_resource_csi2_connection
- uacpi_resource_pin_function
- uacpi_resource_pin_configuration
- uacpi_resource_label
- uacpi_resource_pin_group
- uacpi_resource_pin_group_function
- uacpi_resource_pin_group_configuration
- uacpi_resource_clock_input
- uacpi_resource
- uacpi_resources
- uacpi_table_identifiers
- uacpi_table
- uacpi_object_name
- uacpi_pci_address
- uacpi_data_view
- uacpi_object_array
- uacpi_processor_info
- uacpi_power_resource_info
- uacpi_generic_region_info
- uacpi_pcc_region_info
- uacpi_gpio_region_info
- uacpi_region_attach_data
- uacpi_region_rw_data
- uacpi_region_pcc_send_data
- uacpi_region_gpio_rw_data
- uacpi_region_ipmi_rw_data
- uacpi_region_prm_rw_data
- uacpi_region_serial_rw_data
- uacpi_region_detach_data
- uacpi_firmware_request
- uacpi_pci_routing_table_entry
- uacpi_pci_routing_table
- uacpi_id_string
- uacpi_pnp_id_list
- uacpi_namespace_node_info
Functions
-
uacpi_context_set_log_level
Set the minimum log level to be accepted by the logging facilities. Any logs
-
uacpi_context_set_proactive_table_checksum
Enables table checksum validation at installation time instead of first use.
-
uacpi_context_set_loop_timeout
Set the maximum number of seconds a While loop is allowed to run for before
-
uacpi_context_set_max_call_stack_depth
Set the maximum call stack depth AML can reach before getting aborted.
- uacpi_context_get_loop_timeout
- uacpi_install_fixed_event_handler
- uacpi_uninstall_fixed_event_handler
-
uacpi_enable_fixed_event
Enable/disable a fixed event. Note that the event is automatically enabled
-
uacpi_disable_fixed_event
Enable/disable a fixed event. Note that the event is automatically enabled
-
uacpi_clear_fixed_event
Enable/disable a fixed event. Note that the event is automatically enabled
- uacpi_fixed_event_info
- uacpi_gpe_info
- uacpi_gpe_triggering_to_string
-
uacpi_install_gpe_handler
Installs a handler to the provided GPE at 'idx' controlled by device
-
uacpi_install_gpe_handler_raw
Installs a raw handler to the provided GPE at 'idx' controlled by device
-
uacpi_uninstall_gpe_handler
Installs a raw handler to the provided GPE at 'idx' controlled by device
-
uacpi_setup_gpe_for_wake
Marks the GPE 'idx' managed by 'gpe_device' as wake-capable. 'wake_device' is
-
uacpi_enable_gpe_for_wake
Mark a GPE managed by 'gpe_device' as enabled/disabled for wake. The GPE must
-
uacpi_disable_gpe_for_wake
Mark a GPE managed by 'gpe_device' as enabled/disabled for wake. The GPE must
-
uacpi_finalize_gpe_initialization
Finalize GPE initialization by enabling all GPEs not configured for wake and
-
uacpi_enable_gpe
Enable/disable a general purpose event managed by 'gpe_device'. Internally
-
uacpi_disable_gpe
Enable/disable a general purpose event managed by 'gpe_device'. Internally
-
uacpi_clear_gpe
Clear the status bit of the event 'idx' managed by 'gpe_device'.
-
uacpi_suspend_gpe
Suspend/resume a general purpose event managed by 'gpe_device'. This bypasses
-
uacpi_resume_gpe
Suspend/resume a general purpose event managed by 'gpe_device'. This bypasses
-
uacpi_finish_handling_gpe
Finish handling the GPE managed by 'gpe_device' at 'idx'. This clears the
-
uacpi_mask_gpe
Hard mask/umask a general purpose event at 'idx' managed by 'gpe_device'.
-
uacpi_unmask_gpe
Hard mask/umask a general purpose event at 'idx' managed by 'gpe_device'.
-
uacpi_disable_all_gpes
Disable all GPEs currently set up on the system.
-
uacpi_enable_all_runtime_gpes
Enable all GPEs not marked as wake. This is only needed after the system
-
uacpi_enable_all_wake_gpes
Enable all GPEs marked as wake. This is only needed before the system goes
-
uacpi_install_gpe_block
Install/uninstall a new GPE block, usually defined by a device in the
-
uacpi_uninstall_gpe_block
Install/uninstall a new GPE block, usually defined by a device in the
- uacpi_gas_read
- uacpi_gas_write
-
uacpi_map_gas
Map a GAS for faster access in the future. The handle returned via
- uacpi_unmap_gas
-
uacpi_gas_read_mapped
Same as uacpi_gas_{read,write} but operates on a pre-mapped handle for faster
- uacpi_gas_write_mapped
- uacpi_kernel_get_rsdp
-
uacpi_kernel_map
Map a physical memory range starting at 'addr' with length 'len', and return
-
uacpi_kernel_unmap
Unmap a virtual memory range at 'addr' with a length of 'len' bytes.
- uacpi_kernel_log
-
uacpi_kernel_pci_device_open
Open a PCI device at 'address' for reading & writing.
- uacpi_kernel_pci_device_close
-
uacpi_kernel_pci_read8
Read & write the configuration space of a previously open PCI device.
- uacpi_kernel_pci_read16
- uacpi_kernel_pci_read32
- uacpi_kernel_pci_write8
- uacpi_kernel_pci_write16
- uacpi_kernel_pci_write32
-
uacpi_kernel_io_map
Map a SystemIO address at [base, base + len) and return a kernel-implemented
- uacpi_kernel_io_unmap
-
uacpi_kernel_io_read8
Read/Write the IO range mapped via uacpi_kernel_io_map
- uacpi_kernel_io_read16
- uacpi_kernel_io_read32
- uacpi_kernel_io_write8
- uacpi_kernel_io_write16
- uacpi_kernel_io_write32
-
uacpi_kernel_alloc
Allocate a block of memory of 'size' bytes.
- uacpi_kernel_free
-
uacpi_kernel_get_nanoseconds_since_boot
Returns the number of nanosecond ticks elapsed since boot,
-
uacpi_kernel_stall
Spin for N microseconds.
-
uacpi_kernel_sleep
Sleep for N milliseconds.
-
uacpi_kernel_create_mutex
Create/free an opaque non-recursive kernel mutex object.
- uacpi_kernel_free_mutex
-
uacpi_kernel_create_event
Create/free an opaque kernel (semaphore-like) event object.
- uacpi_kernel_free_event
-
uacpi_kernel_get_thread_id
Returns a unique identifier of the currently executing thread.
-
uacpi_kernel_disable_interrupts
Disable interrupts and return an kernel-defined value representing the
-
uacpi_kernel_restore_interrupts
Restore the state of the interrupt flags to the kernel-defined value provided
-
uacpi_kernel_acquire_mutex
Try to acquire the mutex with a millisecond timeout.
- uacpi_kernel_release_mutex
-
uacpi_kernel_wait_for_event
Try to wait for an event (counter > 0) with a millisecond timeout.
-
uacpi_kernel_signal_event
Signal the event object by incrementing its internal counter by 1.
-
uacpi_kernel_reset_event
Reset the event counter to 0.
-
uacpi_kernel_handle_firmware_request
Handle a firmware request.
-
uacpi_kernel_install_interrupt_handler
Install an interrupt handler at 'irq', 'ctx' is passed to the provided
-
uacpi_kernel_uninstall_interrupt_handler
Uninstall an interrupt handler. 'irq_handle' is the value returned via
-
uacpi_kernel_create_spinlock
Create/free a kernel spinlock object.
- uacpi_kernel_free_spinlock
-
uacpi_kernel_lock_spinlock
Lock/unlock helpers for spinlocks.
- uacpi_kernel_unlock_spinlock
-
uacpi_kernel_schedule_work
Schedules deferred work for execution.
-
uacpi_kernel_wait_for_work_completion
Waits for two types of work to finish:
- uacpi_namespace_root
- uacpi_namespace_get_predefined
-
uacpi_namespace_node_is_alias
Returns UACPI_TRUE if the provided 'node' is an alias.
- uacpi_namespace_node_name
-
uacpi_namespace_node_type
Returns the type of object stored at the namespace node.
-
uacpi_namespace_node_is
Returns UACPI_TRUE via 'out' if the type of the object stored at the
-
uacpi_namespace_node_is_one_of
Returns UACPI_TRUE via 'out' if the type of the object stored at the
- uacpi_namespace_node_depth
- uacpi_namespace_node_parent
- uacpi_namespace_node_find
-
uacpi_namespace_node_resolve_from_aml_namepath
Same as uacpi_namespace_node_find, except the search recurses upwards when
-
uacpi_namespace_for_each_child_simple
Depth-first iterate the namespace starting at the first child of 'parent'.
-
uacpi_namespace_for_each_child
Depth-first iterate the namespace starting at the first child of 'parent'.
-
uacpi_namespace_node_next
Retrieve the next peer namespace node of '*iter', or, if '*iter' is
-
uacpi_namespace_node_next_typed
Retrieve the next peer namespace node of '*iter', or, if '*iter' is
- uacpi_namespace_node_generate_absolute_path
- uacpi_free_absolute_path
-
uacpi_install_notify_handler
Install a Notify() handler to a device node.
- uacpi_uninstall_notify_handler
-
uacpi_install_address_space_handler
Install an address space handler to a device node.
-
uacpi_uninstall_address_space_handler
Uninstall the handler of type 'space' from a given device node.
-
uacpi_reg_all_opregions
Execute _REG(space, ACPI_REG_CONNECT) for all of the opregions with this
-
uacpi_latest_queried_vendor_interface
Returns the "latest" AML-queried _OSI vendor interface.
-
uacpi_install_interface
Install or uninstall an interface.
- uacpi_uninstall_interface
-
uacpi_enable_host_interface
Same as install/uninstall interface, but comes with an enum of known
- uacpi_disable_host_interface
-
uacpi_set_interface_query_handler
Set a custom interface query (_OSI) handler.
-
uacpi_bulk_configure_interfaces
Bulk interface configuration, used to disable or enable all interfaces that
-
uacpi_read_register
Read a register from FADT
-
uacpi_write_register
Write a register from FADT
-
uacpi_write_registers
Write a register from FADT
-
uacpi_read_register_field
Read a field from a FADT register
-
uacpi_write_register_field
Write to a field of a FADT register
- uacpi_free_resources
-
uacpi_get_current_resources
Evaluate the _CRS method for a 'device' and get the returned resource list
-
uacpi_get_possible_resources
Evaluate the _PRS method for a 'device' and get the returned resource list
-
uacpi_get_device_resources
Evaluate an arbitrary method that is expected to return an AML resource
-
uacpi_set_resources
Set the configuration to be used by the 'device' by calling its _SRS method.
-
uacpi_for_each_resource
A convenience helper for iterating over the resource list returned by any
-
uacpi_for_each_device_resource
A shorthand for uacpi_get_device_resources() + uacpi_for_each_resource().
-
uacpi_get_resource_from_buffer
Convert a single AML-encoded resource to native format.
- uacpi_free_resource
-
uacpi_set_waking_vector
Set the firmware waking vector in FACS.
-
uacpi_prepare_for_sleep_state
Prepare for a given sleep state.
-
uacpi_enter_sleep_state
Enter the given sleep state after preparation.
-
uacpi_prepare_for_wake_from_sleep_state
Prepare to leave the given sleep state.
-
uacpi_wake_from_sleep_state
Wake from the given sleep state.
-
uacpi_reboot
Attempt reset via the FADT reset register.
- uacpi_status_to_string
-
uacpi_table_install
Install a table from either a virtual or a physical address.
- uacpi_table_install_physical
-
uacpi_table_load
Load a previously installed table by feeding it to the interpreter.
-
uacpi_table_find_by_signature
Helpers for finding tables.
- uacpi_table_find_next_with_same_signature
- uacpi_table_find
-
uacpi_table_ref
Increment/decrement a table's reference count.
- uacpi_table_unref
-
uacpi_table_fadt
Returns the pointer to a sanitized internal version of FADT.
-
uacpi_set_table_installation_handler
Set a handler that is invoked for each table before it gets installed.
-
uacpi_for_each_subtable
Iterate every subtable of a table such as MADT or SRAT.
- uacpi_address_space_to_string
- uacpi_object_ref
- uacpi_object_unref
- uacpi_object_get_type
- uacpi_object_get_type_bit
-
uacpi_object_is
Returns UACPI_TRUE if the provided object's type matches this type.
-
uacpi_object_is_one_of
Returns UACPI_TRUE if the provided object's type is one of the values
- uacpi_object_type_to_string
-
uacpi_object_create_uninitialized
Create an uninitialized object. The object can be further overwritten via
-
uacpi_object_create_integer
Create an integer object with the value provided.
-
uacpi_object_create_integer_safe
Same as uacpi_object_create_integer, but introduces additional ways to
- uacpi_object_assign_integer
- uacpi_object_get_integer
-
uacpi_object_create_string
Create a string/buffer object. Takes in a constant view of the data.
- uacpi_object_create_cstring
- uacpi_object_create_buffer
-
uacpi_object_get_string_or_buffer
Returns a writable view of the data stored in the string or buffer type
- uacpi_object_get_string
- uacpi_object_get_buffer
-
uacpi_object_is_aml_namepath
Returns UACPI_TRUE if the provided string object is actually an AML namepath.
-
uacpi_object_resolve_as_aml_namepath
Resolve an AML namepath contained in a string object.
-
uacpi_object_assign_string
Make the provided object a string/buffer.
- uacpi_object_assign_buffer
-
uacpi_object_create_package
Create a package object and store all of the objects in the array inside.
-
uacpi_object_get_package
Returns the list of objects stored in a package object.
-
uacpi_object_assign_package
Make the provided object a package and store all of the objects in the array
-
uacpi_object_create_reference
Create a reference object and make it point to 'child'.
-
uacpi_object_assign_reference
Make the provided object a reference and make it point to 'child'.
-
uacpi_object_get_dereferenced
Retrieve the object pointed to by a reference object.
-
uacpi_object_get_processor_info
Returns the information about the provided processor object.
-
uacpi_object_get_power_resource_info
Returns the information about the provided power resource object.
-
uacpi_setup_early_table_access
Set up early access to the table subsystem. What this means is:
-
uacpi_table_subsystem_available
Returns UACPI_TRUE if the table subsystem is available for use by the kernel.
-
uacpi_is_platform_reduced_hardware
Returns UACPI_TRUE via 'out_value' if the current platform is reduced ACPI
-
uacpi_initialize
Initializes the uACPI subsystem, iterates & records all relevant RSDT/XSDT
-
uacpi_namespace_load
Parses & executes all of the DSDT/SSDT tables.
-
uacpi_namespace_initialize
Initializes all the necessary objects in the namespaces by calling
- uacpi_get_current_init_level
-
uacpi_eval
Evaluate an object within the namespace and get back its value.
- uacpi_eval_simple
-
uacpi_execute
Same as uacpi_eval() but without a return value.
- uacpi_execute_simple
-
uacpi_eval_typed
Same as uacpi_eval, but the return value type is validated against
- uacpi_eval_simple_typed
-
uacpi_eval_integer
A shorthand for uacpi_eval_typed with UACPI_OBJECT_INTEGER_BIT.
- uacpi_eval_simple_integer
-
uacpi_eval_buffer_or_string
A shorthand for uacpi_eval_typed with
- uacpi_eval_simple_buffer_or_string
-
uacpi_eval_string
A shorthand for uacpi_eval_typed with UACPI_OBJECT_STRING_BIT.
- uacpi_eval_simple_string
-
uacpi_eval_buffer
A shorthand for uacpi_eval_typed with UACPI_OBJECT_BUFFER_BIT.
- uacpi_eval_simple_buffer
-
uacpi_eval_package
A shorthand for uacpi_eval_typed with UACPI_OBJECT_PACKAGE_BIT.
- uacpi_eval_simple_package
-
uacpi_get_aml_bitness
Get the bitness of the currently loaded AML code according to the DSDT.
-
uacpi_enter_acpi_mode
Helpers for entering & leaving ACPI mode. Note that ACPI mode is entered
-
uacpi_leave_acpi_mode
Helpers for entering & leaving ACPI mode. Note that ACPI mode is entered
-
uacpi_acquire_global_lock
Attempt to acquire the global lock for 'timeout' milliseconds.
- uacpi_release_global_lock
-
uacpi_state_reset
Reset the global uACPI state by freeing all internally allocated data
-
uacpi_device_matches_pnp_id
Checks whether the device at 'node' matches any of the PNP ids provided in
-
uacpi_find_devices_at
Find all the devices in the namespace starting at 'parent' matching the
-
uacpi_find_devices
Same as uacpi_find_devices_at, except this starts at the root and only
- uacpi_set_interrupt_model
- uacpi_free_pci_routing_table
- uacpi_get_pci_routing_table
- uacpi_free_id_string
-
uacpi_eval_hid
Evaluate a device's _HID method and get its value.
- uacpi_free_pnp_id_list
-
uacpi_eval_cid
Evaluate a device's _CID method and get its value.
-
uacpi_eval_sta
Evaluate a device's _STA method and get its value.
-
uacpi_eval_adr
Evaluate a device's _ADR method and get its value.
-
uacpi_eval_cls
Evaluate a device's _CLS method and get its value.
-
uacpi_eval_uid
Evaluate a device's _UID method and get its value.
- uacpi_free_namespace_node_info
-
uacpi_get_namespace_node_info
Retrieve information about a namespace node. This includes the attached
Enums
- acpi_madt_entry_type
- acpi_srat_entry_type
- acpi_gtdt_entry_type
- acpi_dbg2_type
-
acpi_dbg2_serial_subtype
Constants for:
-
acpi_dbg2_1394_subtype
Constants for acpi_dbg2_device_info->port_subtype
-
acpi_dbg2_usb_subtype
Constants for acpi_dbg2_device_info->port_subtype
- acpi_spcr_terminal_type
- acpi_rhct_entry_type
- acpi_rhct_mmu_type
- acpi_dmar_entry_type
- uacpi_fixed_event
-
uacpi_event_info
Enable/disable a fixed event. Note that the event is automatically enabled
- uacpi_gpe_triggering
- uacpi_work_type
- uacpi_log_level
- uacpi_predefined_namespace
- uacpi_vendor_interface
- uacpi_interface_kind
- uacpi_host_interface
- uacpi_interface_action
- uacpi_register
- uacpi_register_field
- uacpi_resource_type
-
uacpi_resource_length_kind
This applies to IRQ & StartDependent resources only. The DONT_CARE value is
-
uacpi_sleep_state
Set the firmware waking vector in FACS.
- uacpi_status
- uacpi_table_installation_disposition
- uacpi_iteration_decision
- uacpi_address_space
- uacpi_init_level
- uacpi_object_type
- uacpi_object_type_bits
- uacpi_overflow_behavior
- uacpi_region_op
- uacpi_access_attribute
- uacpi_firmware_request_type
- uacpi_interrupt_model
Aliases
- uacpi_fixed_event
-
uacpi_event_info
Enable/disable a fixed event. Note that the event is automatically enabled
- uacpi_gpe_handler
- uacpi_gpe_triggering
- uacpi_mapped_gas
- uacpi_work_type
- uacpi_work_handler
- uacpi_log_level
- uacpi_namespace_node
- uacpi_predefined_namespace
- uacpi_iteration_callback
- uacpi_vendor_interface
- uacpi_interface_kind
- uacpi_host_interface
- uacpi_interface_handler
- uacpi_interface_action
- uacpi_register
- uacpi_register_field
- uacpi_resource_type
- uacpi_resource_source
- uacpi_resource_irq
- uacpi_resource_extended_irq
- uacpi_resource_dma
- uacpi_resource_fixed_dma
- uacpi_resource_io
- uacpi_resource_fixed_io
- uacpi_memory_attribute
- uacpi_io_attribute
- uacpi_address_attribute
- uacpi_resource_address_common
- uacpi_resource_address16
- uacpi_resource_address32
- uacpi_resource_address64
- uacpi_resource_address64_extended
- uacpi_resource_memory24
- uacpi_resource_memory32
- uacpi_resource_fixed_memory32
- uacpi_resource_start_dependent
- uacpi_resource_vendor
- uacpi_resource_vendor_typed
- uacpi_resource_generic_register
- uacpi_interrupt_connection_flags
- uacpi_io_connection_flags
- uacpi_resource_gpio_connection
- uacpi_resource_serial_bus_common
- uacpi_resource_i2c_connection
- uacpi_resource_spi_connection
- uacpi_resource_uart_connection
- uacpi_resource_csi2_connection
- uacpi_resource_pin_function
- uacpi_resource_pin_configuration
- uacpi_resource_label
- uacpi_resource_pin_group
- uacpi_resource_pin_group_function
- uacpi_resource_pin_group_configuration
- uacpi_resource_clock_input
- uacpi_resource
- uacpi_resources
- uacpi_resource_iteration_callback
-
uacpi_sleep_state
Set the firmware waking vector in FACS.
- uacpi_status
- uacpi_table_identifiers
- uacpi_table
- uacpi_table_installation_disposition
- uacpi_table_installation_handler
- uacpi_subtable_iteration_callback
- uacpi_phys_addr
- uacpi_io_addr
- uacpi_handle
- uacpi_object_name
- uacpi_iteration_decision
- uacpi_address_space
- uacpi_init_level
- uacpi_pci_address
- uacpi_data_view
- uacpi_namespace_node
- uacpi_object_type
- uacpi_object_type_bits
- uacpi_object
- uacpi_overflow_behavior
- uacpi_object_array
- uacpi_processor_info
- uacpi_power_resource_info
- uacpi_region_op
- uacpi_generic_region_info
- uacpi_pcc_region_info
- uacpi_gpio_region_info
- uacpi_region_attach_data
- uacpi_region_rw_data
- uacpi_region_pcc_send_data
- uacpi_region_gpio_rw_data
- uacpi_region_ipmi_rw_data
- uacpi_region_ffixedhw_rw_data
- uacpi_region_prm_rw_data
- uacpi_access_attribute
- uacpi_region_serial_rw_data
- uacpi_region_detach_data
- uacpi_region_handler
- uacpi_notify_handler
- uacpi_firmware_request_type
- uacpi_firmware_request
- uacpi_interrupt_ret
- uacpi_interrupt_handler
- uacpi_interrupt_model
- uacpi_pci_routing_table_entry
- uacpi_pci_routing_table
- uacpi_id_string
- uacpi_pnp_id_list
- uacpi_namespace_node_info