mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
MdePkg/BaseFdtLib: Add FdtNodeOffsetByCompatible()
This adds FdtNodeOffsetByCompatible() to support finding the offset of the first node with a given 'compatible' value after an offset. Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
This commit is contained in:
parent
99e4c8ea93
commit
90d0ec17e7
@ -432,4 +432,21 @@ FdtNodeDepth (
|
||||
IN INT32 NodeOffset
|
||||
);
|
||||
|
||||
/**
|
||||
Find nodes with a given 'compatible' value.
|
||||
|
||||
@param[in] Fdt The pointer to FDT blob.
|
||||
@param[in] StartOffset Only find nodes after this offset.
|
||||
@param[in] Compatible The string to match against.
|
||||
|
||||
@retval The offset of the first node after StartOffset.
|
||||
**/
|
||||
INT32
|
||||
EFIAPI
|
||||
FdtNodeOffsetByCompatible (
|
||||
IN CONST VOID *Fdt,
|
||||
IN INT32 StartOffset,
|
||||
IN CONST CHAR8 *Compatible
|
||||
);
|
||||
|
||||
#endif /* FDT_LIB_H_ */
|
||||
|
@ -442,3 +442,23 @@ FdtNodeDepth (
|
||||
{
|
||||
return fdt_node_depth (Fdt, NodeOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
Find nodes with a given 'compatible' value.
|
||||
|
||||
@param[in] Fdt The pointer to FDT blob.
|
||||
@param[in] StartOffset Only find nodes after this offset.
|
||||
@param[in] Compatible The string to match against.
|
||||
|
||||
@retval The offset of the first node after StartOffset.
|
||||
**/
|
||||
INT32
|
||||
EFIAPI
|
||||
FdtNodeOffsetByCompatible (
|
||||
IN CONST VOID *Fdt,
|
||||
IN INT32 StartOffset,
|
||||
IN CONST CHAR8 *Compatible
|
||||
)
|
||||
{
|
||||
return fdt_node_offset_by_compatible (Fdt, StartOffset, Compatible);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user