mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
Libraries: Add LibDeviceTree for manipulating OpenFirmware Device Trees
Starting with header validation and a dump() method that can be used to debug future parsing work.
This commit is contained in:
parent
4ffee78146
commit
644928314a
Notes:
sideshowbarker
2024-07-18 02:04:02 +09:00
Author: https://github.com/ADKaster
Commit: 644928314a
Pull-request: https://github.com/SerenityOS/serenity/pull/10526
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/bgianfo ✅
Reviewed-by: https://github.com/linusg
5 changed files with 214 additions and 0 deletions
22
Userland/Libraries/LibDeviceTree/Validation.h
Normal file
22
Userland/Libraries/LibDeviceTree/Validation.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibDeviceTree/FlattenedDeviceTree.h>
|
||||
|
||||
namespace DeviceTree {
|
||||
|
||||
enum class Verbose {
|
||||
No,
|
||||
Yes
|
||||
};
|
||||
|
||||
bool validate_flattened_device_tree(FlattenedDeviceTreeHeader const& header, u8 const* blob_start, size_t blob_size, Verbose = Verbose::No);
|
||||
|
||||
bool dump(FlattenedDeviceTreeHeader const& header, u8 const* blob_start, size_t blob_size);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue