Went with a hybrid approach now. parse_dev is still there, but for the most part part it stores pointers into the dsdt table and parsing happens later as needed.
sneak preview @ https://git.kraxel.org/cgit/seabios/log/?h=dsdt
Thanks. FWIW, I think the code would be simpler if it first parsed the tree into an internal structure, and then searched for _STA, _HID, etc.
I don't think so. When just storing everything the data structures needed become more complicated, we'll need a tree then and can't work with a simple linked list for the devices found.
But, yes, we don't need to actually decode anything while parsing the tree (except for the namestrings). We can simply store pointers into the aml and decode things later when extracting information.
I'll send the full patch series in a moment.