summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Include/Library
diff options
context:
space:
mode:
authorlevi.yun <yeoreum.yun@arm.com>2024-02-21 16:09:38 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-01-17 14:55:42 +0000
commitfbeab84945b0100310713a584f8fecbf4621c11e (patch)
tree7622bf415f972e1b05ca8bd11b78b755288295da /ArmPkg/Include/Library
parent6087382c62686130a6cb8bd397afe23bad9c4e67 (diff)
downloadedk2-fbeab84945b0100310713a584f8fecbf4621c11e.tar.gz
ArmPkg/Library: Introduce ArmTransferListLib
ArmTransferList is used to pass boot information according to firmware handoff protocol specification [0]. When initializing StandaloneMm, it gets boot information from the PHIT HOB in the TransferList. [0] https://github.com/FirmwareHandoff/firmware_handoff Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
Diffstat (limited to 'ArmPkg/Include/Library')
-rw-r--r--ArmPkg/Include/Library/ArmTransferListLib.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/ArmPkg/Include/Library/ArmTransferListLib.h b/ArmPkg/Include/Library/ArmTransferListLib.h
new file mode 100644
index 0000000000..033821a181
--- /dev/null
+++ b/ArmPkg/Include/Library/ArmTransferListLib.h
@@ -0,0 +1,109 @@
+/** @file
+ Library that implements the helper functions to parse and pack a Transfer
+ List as specified by the A-profile Firmware Handoff Specification.
+
+ Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Reference(s):
+ - https://github.com/FirmwareHandoff/firmware_handoff
+
+ @par Glossary:
+ - TL - Transfer list
+ - TE - Transfer entry
+ - HOB - Hand off block.
+**/
+
+#ifndef ARM_TRANSFER_LIST_LIB_
+#define ARM_TRANSFER_LIST_LIB_
+
+#include <Base.h>
+#include <Uefi.h>
+#include <IndustryStandard/ArmTransferList.h>
+#include <Pi/PiBootMode.h>
+#include <Pi/PiHob.h>
+
+/**
+ Return the first Transfer Entry Node in the Transfer List.
+
+ @param [in] Tlh TransferListHeader
+
+ @return Pointer to the Transfer Entry Node if successful otherwise NULL
+
+**/
+TRANSFER_ENTRY_HEADER *
+EFIAPI
+TlGetFirstEntry (
+ IN TRANSFER_LIST_HEADER *Tlh
+ );
+
+/**
+ Return the next Transfer Entry Node in the Transfer List from
+ last Transfer Entry Node.
+
+ @param [in] Tlh TransferListHeader
+ @param [in] CurrentTe Pointer to the Current Transfer Entry.
+ If this is NULL, the first Transfer Entry is returned.
+
+ @return Pointer to the next Transfer Entry Node if successful otherwise NULL
+
+**/
+TRANSFER_ENTRY_HEADER *
+EFIAPI
+TlGetNextEntry (
+ IN TRANSFER_LIST_HEADER *Tlh,
+ IN TRANSFER_ENTRY_HEADER *CurrentTe
+ );
+
+/**
+ Return the first Transfer Entry Node in the Transfer List
+ matched with given tag-id.
+
+ @param [in] Tlh TransferListHeader
+ @param [in] TagId Tag id
+
+ @return Pointer to the Transfer Entry Node if successful otherwise NULL
+
+**/
+TRANSFER_ENTRY_HEADER *
+EFIAPI
+TlFindFirstEntry (
+ IN TRANSFER_LIST_HEADER *Tlh,
+ IN UINT16 TagId
+ );
+
+/**
+ Return the Next Transfer Entry Node in the Transfer List
+ matched with given tag-id from last Transfer Entry Node.
+
+ @param [in] Tlh TransferListHeader
+ @param [in] CurrentTe Pointer to the Current Transfer Entry.
+ If this is NULL, the first Transfer Entry is returned.
+ @param [in] TagId Tag id
+
+ @return Pointer to the Transfer Entry Node if successful otherwise NULL
+
+**/
+TRANSFER_ENTRY_HEADER *
+EFIAPI
+TlFindNextEntry (
+ IN TRANSFER_LIST_HEADER *Tlh,
+ IN TRANSFER_ENTRY_HEADER *CurrentTe,
+ IN UINT16 TagId
+ );
+
+/**
+ Return the data in Transfer Entry.
+
+ @param [in] Te TransferEntryHeader
+
+ @return Pointer to the Data of Transfer Entry Node if successful otherwise NULL
+
+**/
+VOID *
+EFIAPI
+TlGetEntryData (
+ IN TRANSFER_ENTRY_HEADER *Te
+ );
+
+#endif // ARM_TRANSFER_LIST_LIB_