summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibDeviceTree
AgeCommit message (Collapse)Author
2023-02-24LibDeviceTree: Use unchecked_append() in path parsingMacDue
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-24Revert "LibDeviceTree: Propagate try_append() errors while parsing paths"Linus Groh
This reverts commit f064f5f36e6c4ec9d96122815ed359d6290f8de2. 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-24LibDeviceTree: Propagate try_append() errors while parsing pathsMacDue
2023-02-19LibDeviceTree: Add a slow, allocation-free property fetch APIAndrew Kaster
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-19LibDeviceTree: Add walk_device_tree and use it to dump structured dataAndrew Kaster
We can use this simple parser and its callbacks to implement more complex parsing in later commits.
2023-02-19LibDeviceTree: Refactor dump() to return ErrorOr, and use ReadonlyBytesAndrew Kaster
ReadonlyBytes is much nicer to use than a u8 const* + size_t.
2023-02-19LibDeviceTree: Print the StringsBlock size properly when bounds checkingAndrew Kaster
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-06Everywhere: Remove redundant inequality comparison operatorsDaniel Bertalan
C++20 can automatically synthesize `operator!=` from `operator==`, so there is no point in writing such functions by hand if all they do is call through to `operator==`. This fixes a compile error with compilers that implement P2468 (Clang 16 currently). This paper restores the C++17 behavior that if both `T::operator==(U)` and `T::operator!=(U)` exist, `U == T` won't be rewritten in reverse to call `T::operator==(U)`. Removing `!=` operators makes the rewriting possible again. See https://reviews.llvm.org/D134529#3853062
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-11-01Everywhere: Explicitly link all binaries against the LibC targetTim Schumacher
Even though the toolchain implicitly links against -lc, it does not know where it should get LibC from except for the sysroot. In the case of Clang this causes it to pick up the LibC stub instead, which might be slightly outdated and feature missing symbols. This is currently not an issue that manifests because we pass through the dependency on LibC and other libraries by accident, which causes CMake to link against the LibC target (instead of just the library), and thus points the linker at the build output directory. Since we are looking to fix that in the upcoming commits, let's make sure that everything will still be able to find the proper LibC first.
2021-10-21Libraries: Add LibDeviceTree for manipulating OpenFirmware Device TreesAndrew Kaster
Starting with header validation and a dump() method that can be used to debug future parsing work.