Skip to content

Commit

Permalink
MdePkg: export FdtAddressCells/FdtSizeCells from BaseFdtLib
Browse files Browse the repository at this point in the history
Signed-off-by: Leif Lindholm <[email protected]>
  • Loading branch information
leiflindholm authored and mergify[bot] committed Oct 2, 2024
1 parent 9ba11ee commit 5bad560
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
30 changes: 30 additions & 0 deletions MdePkg/Include/Library/FdtLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,36 @@ FdtNodeOffsetByCompatible (
IN CONST CHAR8 *Compatible
);

/**
Retrieve address size for a bus represented in the tree
@param[in] Fdt The pointer to FDT blob.
@param[in] NodeOffset Offset of node to check.
@return Number of cells in the bus address, or negative error.
**/
INT32
EFIAPI
FdtAddressCells (
IN CONST VOID *Fdt,
IN INT32 NodeOffset
);

/**
Retrieve address range size for a bus represented in the tree
@param[in] Fdt The pointer to FDT blob.
@param[in] NodeOffset Offset of node to check.
@return Number of cells in the bus size, or negative error.
**/
INT32
EFIAPI
FdtSizeCells (
IN CONST VOID *Fdt,
IN INT32 NodeOffset
);

/* Debug functions. */
CONST
CHAR8
Expand Down
36 changes: 36 additions & 0 deletions MdePkg/Library/BaseFdtLib/FdtLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,42 @@ FdtNodeOffsetByCompatible (
return fdt_node_offset_by_compatible (Fdt, StartOffset, Compatible);
}

/**
Retrieve address size for a bus represented in the tree
@param[in] Fdt The pointer to FDT blob.
@param[in] NodeOffset Offset of node to check.
@return Number of cells in the bus address, or negative error.
**/
INT32
EFIAPI
FdtAddressCells (
IN CONST VOID *Fdt,
IN INT32 NodeOffset
)
{
return fdt_address_cells (Fdt, NodeOffset);
}

/**
Retrieve address range size for a bus represented in the tree
@param[in] Fdt The pointer to FDT blob.
@param[in] NodeOffset Offset of node to check.
@return Number of cells in the bus size, or negative error.
**/
INT32
EFIAPI
FdtSizeCells (
IN CONST VOID *Fdt,
IN INT32 NodeOffset
)
{
return fdt_size_cells (Fdt, NodeOffset);
}

/* Debug functions. */
CONST
CHAR8
Expand Down

0 comments on commit 5bad560

Please sign in to comment.