base: re-sync ACPI userspace with upstream master

Phase B of the ACPI fork-sync plan (local/docs/ACPI-FORK-SYNC-STRATEGY-2026-06-30.md).
Pairs with the kernel fork-sync commit 4f2a043.

Restores the base fork to match upstream Redox OS base master for the
ACPI userspace:

- Cargo.toml (workspace):
  * Add acpi = { git = "...redox-os/acpi.git", branch = "redox-6.x" }
    workspace dependency. The jackpot51/acpi GitHub fork was
    deprecated in favor of the gitlab.redox-os.org fork that
    tracks the redox-6.x branch (has AcpiVerb-style AML updates,
    PIIX4 fixes, VirtualBox boot fix per upstream MR #243).
  * Switch redox_syscall from crates.io 0.8.1 to a git ref of
    gitlab.redox-os.org/redox-os/syscall.git, with [patch.crates-io]
    redirecting crates.io consumers to the gitlab fork. The
    crates.io 0.8.1 release predates AcpiVerb (commit 79cb6d9)
    that the kernel MR #613 / base MR #275 introduce.

- drivers/acpid/Cargo.toml: acpi.workspace = true.

- drivers/amlserde/Cargo.toml: acpi.workspace = true.

- drivers/hwd/Cargo.toml: add redox_syscall.workspace = true
  dependency. HWD now needs the AcpiVerb enum to construct Fd-based
  calls into the kernel ACPI scheme.

- drivers/amlserde/src/lib.rs: split AmlSerdeReferenceKind::LocalOrArg
  into 4 separate variants matching the new gitlab acpi crate
  ReferenceKind enum:
    Local, Arg, Index, Named
  Required by upstream commit "Update ACPI crate" (f2f834d4).

- drivers/acpid/src/main.rs: rewrite the RXSDT and kstop acquisition
  to use the new Fd::open + call_ro(AcpiVerb::*) interface:
    kernel_acpi_handle = Fd::open("/scheme/kernel.acpi", O_CLOEXEC, 0)
    rxsdt = kernel_acpi_handle.call_ro(buf, READ, &[ReadRxsdt])
    shutdown_pipe = kernel_acpi_handle.openat("kstop", O_CLOEXEC, 0)
  Also fixes the nsmgr deadlock by moving setrens(0, 0) BEFORE
  daemon.ready() (upstream commit 9dd6901d).

- drivers/hwd/src/backend/acpi.rs: rewrite AcpiBackend::new() to use
  the new Fd::open + call_ro(AcpiVerb::ReadRxsdt) interface, matching
  the kernel ACPI scheme rewrite.

Verified by: CI=1 ./local/scripts/build-redbear.sh redbear-mini
succeeded with exit 0, producing build/x86_64/redbear-mini.iso
(512 MB) at 2026-06-30 04:54.
This commit is contained in:
Red Bear OS
2026-06-30 04:56:51 +03:00
parent de9d1f495f
commit ae57fe3226
8 changed files with 54 additions and 23 deletions
Generated
+3 -3
View File
@@ -21,7 +21,7 @@ dependencies = [
[[package]]
name = "acpi"
version = "6.1.1"
source = "git+https://github.com/jackpot51/acpi.git#3dc8a2d98a7a164cbf87e7a86855c4d3bed4de75"
source = "git+https://gitlab.redox-os.org/redox-os/acpi.git?branch=redox-6.x#90cbe88e13468c7cc80a68c801a3dd2ea8f51d02"
dependencies = [
"bit_field",
"bitflags 2.13.0",
@@ -1041,6 +1041,7 @@ dependencies = [
"fdt 0.1.5",
"libredox",
"log",
"redox_syscall 0.8.1",
"ron",
]
@@ -2001,8 +2002,7 @@ dependencies = [
[[package]]
name = "redox_syscall"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b44b894f2a6e36457d665d1e08c3866add6ed5e70050c1b4ba8a8ddedb02ce7"
source = "git+https://gitlab.redox-os.org/redox-os/syscall.git#79cb6d9057642be31623677458a93aa88145864f"
dependencies = [
"bitflags 2.13.0",
]