acpi: add DSDT device type#1165
Conversation
Allow `DsdtGenerator` to specify the type of device it is generating code for. The DSDT can then organize devices types in a stable order, regardless of the component name and position in the device map.
| &PciRootBridge { config: &self.config }, | ||
| &DsdtGeneratorAml { | ||
| scope: DsdtScope::SystemBus, | ||
| device_type: None, |
There was a problem hiding this comment.
the main thought i've got here is: while i think this gives Propolis good control over how to lay out items in the tables (and so, broadly, i'm a fan!) if we have a device on SystemBus and forget to add a stanza to emit the AML here, it'll probably be really confusing and frustrating to debug.
i'm imagining that maybe we could have a bit on devices to report if we've printed their AML, though to_aml_bytes takes &self, so we'd either change that or otherwise do interior mutability. then finally we could have an impl Drop for DsdtConfig that checks our work (and warns or panics or something if there are devices we've forgotten about).
There was a problem hiding this comment.
Yeah, that's a good point. Is 8d38895 more or less what you had in mind?
Allow
DsdtGeneratorto specify the type of device it is generating code for. The DSDT can then organize devices types in a stable order, regardless of the component name and position in the device map.