kernel: flatten the device/discovery code, merge power into acpi, rename fdt
Follow-up cleanup of the just-moved kernel device code: - power.zig -> acpi.zig. Its reboot() is built entirely on the FADT reset register (acpi.power_information) plus the legacy 0xCF9/8042 fallbacks — it is ACPI reboot, so it becomes acpi.reboot (the "P" in ACPI). platform.reboot still delegates; soft-off/S5 stays the ring-3 acpi service's job as before. - device-tree.zig -> fdt.zig. It is a discovery *backend* (the ARM/FDT parser, a sibling of acpi.zig), not part of the model — renaming it to its actual subject kills the confusing device-tree / device-model DeviceTree name clash and makes acpi.zig + fdt.zig read as the two parallel backends. - Flatten: device-model.zig, acpi.zig, fdt.zig, platform.zig move out of the system/kernel/devices/ subdir up into system/kernel/, joining devices-broker.zig (already flat). The kernel dir is a flat pile by convention (only architecture/ is a subdir), so the subdir — and its poor "devices" name — is gone. Pure restructure; "platform" module name unchanged, all cross-file deps are relative siblings that moved together. zig build + test green; smoke, discovery, acpi-parse, acpi-ps2, acpi-report, power-button, orderly-shutdown, reboot pass.
This commit is contained in:
@@ -278,7 +278,7 @@ pub fn build(b: *std.Build) void {
|
||||
});
|
||||
// The devices sub-project's public interface (the flat wire types), exposed as
|
||||
// its own module like vfs-protocol — importable by user space, unlike the
|
||||
// kernel-internal device model it also feeds (system/kernel/devices/device-model.zig).
|
||||
// kernel-internal device model it also feeds (system/kernel/device-model.zig).
|
||||
const device_abi_module = b.addModule("device-abi", .{
|
||||
.root_source_file = b.path("library/device/model/device-abi.zig"),
|
||||
});
|
||||
@@ -351,9 +351,9 @@ pub fn build(b: *std.Build) void {
|
||||
// "platform" and asks it to enumerate hardware into a backend-neutral device
|
||||
// tree, never naming ACPI (or, later, device-tree) — the same discipline the
|
||||
// architecture module applies to CPU code. The backend is selected at runtime from
|
||||
// the boot handoff (see system/kernel/devices/platform.zig).
|
||||
// the boot handoff (see system/kernel/platform.zig).
|
||||
const platform_module = b.addModule("platform", .{
|
||||
.root_source_file = b.path("system/kernel/devices/platform.zig"),
|
||||
.root_source_file = b.path("system/kernel/platform.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "boot-handoff", .module = boot_handoff_module }, // BootInformation (carries the ACPI RSDP), physicalToVirtual
|
||||
.{ .name = "abi", .module = abi_module }, // acpi.zig works in page_size units
|
||||
|
||||
Reference in New Issue
Block a user