MdePkg: export some additional macros from BaseFdtLib

- FDT_TAGSIZE and FDT_MAX_NCELLS
- FdtGetHeader/FdtTotalSize
- FdtForEachSubnode

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
This commit is contained in:
Leif Lindholm 2024-10-01 14:51:47 +01:00 committed by mergify[bot]
parent 0cc9963cc9
commit 9dc9a4bae6

View File

@ -172,6 +172,22 @@ typedef struct {
CHAR8 Data[];
} FDT_PROPERTY;
#ifndef FDT_TAGSIZE
#define FDT_TAGSIZE sizeof(UINT32)
#endif
#ifndef FDT_MAX_NCELLS
#define FDT_MAX_NCELLS 4
#endif
#define FdtGetHeader(Fdt, Field) \
(Fdt32ToCpu (((const FDT_HEADER *)(Fdt))->Field))
#define FdtTotalSize(Fdt) (FdtGetHeader ((Fdt), TotalSize))
#define FdtForEachSubnode(Node, Fdt, Parent) \
for (Node = FdtFirstSubnode (Fdt, Parent); \
Node >= 0; \
Node = FdtNextSubnode (Fdt, Node))
/**
Convert UINT16 data of the FDT blob to little-endian