1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 19:14:58 +00:00
Commit graph

7 commits

Author SHA1 Message Date
Hediadyoin1
21a21c6a11 LibDeviceTree: Add a simple DeviceTree class
This makes it easier to work with device tree nodes and properties, then
writing simple state machines to parse the device tree.
This also makes the old slow traversal methods use the
DeviceTreeProperty helper class, and adds a simple test.
2024-02-24 16:43:44 -07:00
Hendiadyoin1
d6bb5579ad LibDeviceTree: Make the dump more akin to the original fdtdump
This also makes it possible to compile the library in the Kernel
2024-02-24 16:43:44 -07:00
MacDue
f8bdb584f8 LibDeviceTree: Use unchecked_append() in path parsing
try_append() checks if the vector should increase capacity and if
so grows the vector. unchecked_append() verifies the vector already
has enough capacity, and will never grow the vector.
2023-02-24 23:56:37 +01:00
Linus Groh
69f0339bac Revert "LibDeviceTree: Propagate try_append() errors while parsing paths"
This reverts commit f064f5f36e.

As Andrew points out, this append is not actually fallible in practice,
since the loop is terminated once the vector size reaches its inline
capacity.

https://github.com/SerenityOS/serenity/pull/17606#discussion_r1117662246
2023-02-24 23:40:23 +01:00
MacDue
f064f5f36e LibDeviceTree: Propagate try_append() errors while parsing paths 2023-02-24 22:18:25 +01:00
Andrew Kaster
613cfb31b1 LibDeviceTree: Add a slow, allocation-free property fetch API
Using the walk_device_tree helper, we can walk the device tree from the
beginning looking for a specific property node. It's still missing the
ability to get property lists, string lists, and property-specific data.
2023-02-19 13:49:07 +01:00
Andrew Kaster
e9e279bb77 LibDeviceTree: Add walk_device_tree and use it to dump structured data
We can use this simple parser and its callbacks to implement more
complex parsing in later commits.
2023-02-19 13:49:07 +01:00