Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Using uACPI in Haiku operating system #116

@pulkomandy

Description

@pulkomandy

Here is my attept to use uACPI in Haiku so far:
https://review.haiku-os.org/c/haiku/+/8937

Questions:

  • I didn't find an equivalent to AcpiFindRootPointer from ACPICA (this searches the ACPI entry point in low memory when booting from BIOS). Does uACPI takes care of this on its own or do I have to provide it? In osdev examples, there is no way to tell uACPI where the tables are. In our case, this initialization is done in multiple steps, with the bootloader getting the info from the firmware, and then passing it down to the kernel where ACPI is finally initialized (the kernel doesn't communicate directly with the EFI firmware for example). See src/add-ons/kernel/bus_managers/acpi/arch/x86/arch_init.cpp:150 and maybe src/system/kernel/arch/generic/acpi_irq_routing_table.cpp:797
  • I don't find an equivalent to AcpiUpdateAllGpes and AcpiSetGpe. The interface for events seems to be a bit different. See src/add-ons/kernel/bus_managers/acpi/BusManager.cpp:338 and :366.
  • I didn't find an API similar to AcpiGetNextObject. The only way to iterate objects is having uACPI call a callback for each object (producer-driven). I may be able to change our code to work this way, but I think a consumer-driven API (similar to a iterator) would be easier for us.
  • Our current ACPI module exposes directly to other kernel modules the ability to read and write kernel registers (src/add-ons/kernel/bus_managers/acpi/BusManager.cpp:818 and :825). This is a private API in uACPI, am I safe to use it anyways? This is then used by our cpuidl driver (src/add-ons/kernel/drivers/power/x86_cpuidle/acpi_cpuidle.cpp) to tweak some bus master and bus arbitration registers during suspend and resume (ACPI_BITREG_BUS_MASTER_STATUS, ACPI_BITREG_BUS_MASTER_RLD and ACPI_BITREG_ARB_DISABLE) apparently to avoid issues with interrupted DMA transfers on some old machines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions