namespace IO.Bus; struct Resource { Mem.Region region; ResourceSpace rspace; char[] description; }; // Whether the alloc() and/or dev_alloc() methods are accepted by a given // ResourceSpace is defined by the particular subtype. interface ResourceSpace : Mem.Allocator { guid: "2515CEC8-F7E0-11D9-9DF4-000A95BB581A"; dev_alloc(ulong start inout, ulong len, Mem.Allocator.AllocFlags flags, Device dev, Mem.AllocHandle handle out); get_resources(Resource[] res out); get_parent(Resource parent out); get_bus(Bus bus out); get_devices(Device[] devs out); get_description(char[] desc out); }; interface Device { guid: "1F19CCF2-F7E0-11D9-98CE-000A95BB581A"; get_resources(Resource[] res out); get_parent(Bus bus out); get_description(char[] desc out); }; interface Bus : Device { guid: "196CC482-F7E0-11D9-9AED-000A95BB581A"; get_devices(Device[] devs out); get_resource_spaces(ResourceSpace[] resource_spaces out); // Try to auto-enumerate new devices. If the bus is not capable // of auto-enumeration, do nothing. It is up to the specific bus // type as to whether any action is taken for prevously-enumerated // devices that are no longer detected. scan(); };