audk/ArmPkg/Include/Library/ArmTransferListLib.h
levi.yun fbeab84945 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>
2025-01-17 14:55:42 +00:00

110 lines
2.7 KiB
C

/** @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_