acpi: discovery is handed its node like every other driver
The last claimant. The kernel seeds the acpi-tables node, so it sits in the same boot snapshot the manager already scans to find the PCI host bridge — there was never a bootstrap problem, only a lookup nobody had written. The manager claims it and names it in the spawn; the service stops claiming. Every driver in the system now receives its hardware rather than taking it. Two failures on the way, both mine. addDriver puts the device id in argv[1], and the acpi service read argv[1] as a self-verify device-count floor — so handed device 7 it decided it was in test mode, printed "acpi-parse: ok", and never reported a device. The test argument is now floor:N, which a bare id cannot be mistaken for. And acpi-parse spawns the service directly rather than through the manager, so nothing handed it the node. That test now claims and transfers it exactly as the manager does, which is the right shape: the test plays the manager's role instead of the service reaching for hardware. device_claim now has two callers left: the manager, which is the acquirer and should have it, and the display service's GOP path. That is recorded as question 10 — the framebuffer is not a device, so the answer is likely that it leaves the device table rather than being exempted from its rules. Suite 118/118.
This commit is contained in:
+11
-1
@@ -3098,7 +3098,17 @@ fn acpiParseTest(boot_information: *const BootInformation) void {
|
||||
while (i < rd.count) : (i += 1) {
|
||||
const item = rd.entry(i) orelse continue;
|
||||
if (!eql(initial_ramdisk.basename(item.name), "discovery")) continue;
|
||||
_ = process.spawnProcessSupervised(item.blob, 4, &.{ item.name, "1" }, scheduler.currentId(), null) catch 0;
|
||||
// Hand it the acpi-tables node the way the manager would: claim it here, then
|
||||
// move it to the child. Discovery no longer claims for itself.
|
||||
var scratch: [64]device_abi.DeviceDescriptor = undefined;
|
||||
const seen_devices = devices_broker.enumerate(&scratch);
|
||||
const tables: ?u64 = for (scratch[0..@min(seen_devices, scratch.len)]) |d| {
|
||||
if (d.class == @intFromEnum(device_abi.DeviceClass.acpi_tables)) break d.id;
|
||||
} else null;
|
||||
const me_parse = scheduler.currentId();
|
||||
if (tables) |node| _ = claimOk(node, me_parse);
|
||||
const child = process.spawnProcessSupervised(item.blob, 4, &.{ item.name, "floor:1" }, me_parse, null) catch 0;
|
||||
if (tables) |node| devices_broker.transfer(node, me_parse, child) catch {};
|
||||
spawned = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user