summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Lindholm <quic_llindhol@quicinc.com>2024-09-30 14:32:20 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-02 05:58:31 +0300
commitbf7dbf6380a5ae349bc833cd1d7378c3a78b718b (patch)
tree6999ba64da03d4b805ad9bc0145eabbd4fb92df0
parent4f4673846fc9d6fc1c10a6c025da4739d872a6a0 (diff)
downloadedk2-bf7dbf6380a5ae349bc833cd1d7378c3a78b718b.tar.xz
MdePkg,UefiPayloadPkg: improve BaseFdtLib memreserve helper style
FdtNumRsv and FdtGetMemRsv were added for the benefit of UefiPayloadPkg, but their naming matches neither upstream libfdt nor tianocore coding style rules. And there was scope for improvement of the doxygen descriptions as well. These functions currently have only one in-tree user, UefiPayloadPkg FdtParserLib. So rename them more conformant FdtGetNumberOfReserveMapEntries and FdtGetReserveMapEntry and update the description comment blocks, at the same time as updating the existing user. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
-rw-r--r--MdePkg/Include/Library/FdtLib.h18
-rw-r--r--MdePkg/Library/BaseFdtLib/FdtLib.c20
-rw-r--r--UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c4
3 files changed, 21 insertions, 21 deletions
diff --git a/MdePkg/Include/Library/FdtLib.h b/MdePkg/Include/Library/FdtLib.h
index ffff40d8fe..17f7159da2 100644
--- a/MdePkg/Include/Library/FdtLib.h
+++ b/MdePkg/Include/Library/FdtLib.h
@@ -248,33 +248,33 @@ FdtSubnodeOffsetNameLen (
);
/**
- Returns number of reserved ranges.
+ Returns the number of memory reserve map entries.
@param[in] Fdt The pointer to FDT blob.
- @return The number of reserved ranges.
+ @return The number of entries in the reserve map.
**/
INTN
EFIAPI
-FdtNumRsv (
+FdtGetNumberOfReserveMapEntries (
IN CONST VOID *Fdt
);
/**
- Returns reserved ranges.
+ Returns a memory reserve map entry.
@param[in] *Fdt The pointer to FDT blob.
- @param[in] Index Reserved entry index in the table.
- @param[out] Addr Address returned
- @param[out] *Size Pointer to size of the address range
+ @param[in] Index Index of reserve map entry.
+ @param[out] Addr Pointer to 64-bit variable to hold the start address
+ @param[out] *Size Pointer to 64-bit variable to hold size of reservation
- @return Returns reserved range.
+ @return 0 on success, or negative error code.
**/
INTN
EFIAPI
-FdtGetMemRsv (
+FdtGetReserveMapEntry (
IN CONST VOID *Fdt,
IN INTN Index,
OUT UINT64 *Addr,
diff --git a/MdePkg/Library/BaseFdtLib/FdtLib.c b/MdePkg/Library/BaseFdtLib/FdtLib.c
index 5ff06111b7..7d26959c7c 100644
--- a/MdePkg/Library/BaseFdtLib/FdtLib.c
+++ b/MdePkg/Library/BaseFdtLib/FdtLib.c
@@ -207,16 +207,16 @@ FdtNextSubnode (
}
/**
- Returns number of reserved mem nodes
+ Returns the number of memory reserve map entries.
- @param[in] Fdt The pointer to FDT blob.
+ @param[in] Fdt The pointer to FDT blob.
- @return total reserved mem nodes
+ @return The number of entries in the reserve map.
**/
INTN
EFIAPI
-FdtNumRsv (
+FdtGetNumberOfReserveMapEntries (
IN CONST VOID *Fdt
)
{
@@ -224,19 +224,19 @@ FdtNumRsv (
}
/**
- Returns reserved ranges.
+ Returns a memory reserve map entry.
@param[in] *Fdt The pointer to FDT blob.
- @param[in] Index Reserved entry index in the table.
- @param[out] Addr Address returned
- @param[out] *Size Pointer to size of the address range
+ @param[in] Index Index of reserve map entry.
+ @param[out] Addr Pointer to 64-bit variable to hold the start address
+ @param[out] *Size Pointer to 64-bit variable to hold size of reservation
- @return Returns reserved range.
+ @return 0 on success, or negative error code.
**/
INTN
EFIAPI
-FdtGetMemRsv (
+FdtGetReserveMapEntry (
IN CONST VOID *Fdt,
IN INTN Index,
OUT EFI_PHYSICAL_ADDRESS *Addr,
diff --git a/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c b/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c
index 09b7372b9a..9bece35e5c 100644
--- a/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c
+++ b/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c
@@ -889,10 +889,10 @@ ParseDtb (
}
}
- NumRsv = FdtNumRsv (Fdt);
+ NumRsv = FdtGetNumberOfReserveMapEntries (Fdt);
/* Look for an existing entry and add it to the efi mem map. */
for (index = 0; index < NumRsv; index++) {
- if (FdtGetMemRsv (Fdt, index, &Addr, &Size) != 0) {
+ if (FdtGetReserveMapEntry (Fdt, index, &Addr, &Size) != 0) {
continue;
}