TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmStandaloneMmCoreEntryPoint.h File Reference

Go to the source code of this file.

Data Structures

struct  ServiceTableEntry
 
struct  MISC_MM_COMMUNICATE_BUFFER
 
struct  EFI_PARAM_HEADER
 

Macros

#define CPU_INFO_FLAG_PRIMARY_CPU   0x00000001
 
#define MMRAM_DESC_IDX_IMAGE   0
 
#define MMRAM_DESC_IDX_SECURE_SHARED_BUFFER   1
 
#define MMRAM_DESC_IDX_NORMAL_SHARED_BUFFER   2
 
#define MMRAM_DESC_IDX_HEAP   3
 
#define MMRAM_DESC_MIN_COUNT   4
 

Typedefs

typedef struct ServiceTableEntry SERVICE_TABLE_ENTRY
 
typedef RETURN_STATUS(* REGION_PERMISSION_UPDATE_FUNC) (IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
 

Functions

EFI_STATUS EFIAPI UpdateMmFoundationPeCoffPermissions (IN CONST PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, IN EFI_PHYSICAL_ADDRESS ImageBase, IN UINT32 SectionHeaderOffset, IN CONST UINT16 NumberOfSections, IN REGION_PERMISSION_UPDATE_FUNC TextUpdater, IN REGION_PERMISSION_UPDATE_FUNC ReadOnlyUpdater, IN REGION_PERMISSION_UPDATE_FUNC ReadWriteUpdater)
 
EFI_STATUS EFIAPI GetStandaloneMmCorePeCoffSections (IN VOID *TeData, IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, OUT EFI_PHYSICAL_ADDRESS *ImageBase, IN OUT UINT32 *SectionHeaderOffset, IN OUT UINT16 *NumberOfSections)
 
EFI_STATUS EFIAPI LocateStandaloneMmCorePeCoffData (IN EFI_FIRMWARE_VOLUME_HEADER *BfvAddress, IN OUT VOID **TeData, IN OUT UINTN *TeDataSize)
 
VOID EFIAPI CEntryPoint (IN UINTN Arg0, IN UINTN Arg1, IN UINTN Arg2, IN UINTN Arg3)
 
VOID EFIAPI ProcessLibraryConstructorList (IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *MmSystemTable)
 
VOID EFIAPI ProcessModuleEntryPointList (IN VOID *HobStart)
 

Detailed Description

Entry point to the Standalone MM Foundation when initialized during the SEC phase on ARM platforms

Copyright (c) 2017 - 2024, Arm Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Glossary:
  • SPM_MM - An implementation where the Secure Partition Manager resides at EL3 with management services running from an isolated Secure Partitions at S-EL0, and the communication protocol is the Management Mode(MM) interface.
  • FF-A - Firmware Framework for Arm A-profile
  • TL - Transfer List
Reference(s):

Definition in file ArmStandaloneMmCoreEntryPoint.h.

Macro Definition Documentation

◆ CPU_INFO_FLAG_PRIMARY_CPU

#define CPU_INFO_FLAG_PRIMARY_CPU   0x00000001

Definition at line 34 of file ArmStandaloneMmCoreEntryPoint.h.

◆ MMRAM_DESC_IDX_HEAP

#define MMRAM_DESC_IDX_HEAP   3

Definition at line 43 of file ArmStandaloneMmCoreEntryPoint.h.

◆ MMRAM_DESC_IDX_IMAGE

#define MMRAM_DESC_IDX_IMAGE   0

Definition at line 40 of file ArmStandaloneMmCoreEntryPoint.h.

◆ MMRAM_DESC_IDX_NORMAL_SHARED_BUFFER

#define MMRAM_DESC_IDX_NORMAL_SHARED_BUFFER   2

Definition at line 42 of file ArmStandaloneMmCoreEntryPoint.h.

◆ MMRAM_DESC_IDX_SECURE_SHARED_BUFFER

#define MMRAM_DESC_IDX_SECURE_SHARED_BUFFER   1

Definition at line 41 of file ArmStandaloneMmCoreEntryPoint.h.

◆ MMRAM_DESC_MIN_COUNT

#define MMRAM_DESC_MIN_COUNT   4

Definition at line 44 of file ArmStandaloneMmCoreEntryPoint.h.

Typedef Documentation

◆ REGION_PERMISSION_UPDATE_FUNC

typedef RETURN_STATUS(* REGION_PERMISSION_UPDATE_FUNC) (IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)

Definition at line 78 of file ArmStandaloneMmCoreEntryPoint.h.

◆ SERVICE_TABLE_ENTRY

Service table entry to return service type matched with service guid

Function Documentation

◆ CEntryPoint()

VOID EFIAPI CEntryPoint ( IN UINTN  Arg0,
IN UINTN  Arg1,
IN UINTN  Arg2,
IN UINTN  Arg3 
)

The handoff between the SPMC to StandaloneMM depends on the communication interface between the SPMC and StandaloneMM. When SpmMM is used, the handoff is implemented using the Firmware Handoff protocol. When FF-A is used the FF-A boot protocol is used.

Parameters
[in]Arg0In case of FF-A, address of FF-A boot information In case of SPM_MM, this parameter must be zero
[in]Arg1In case of FF-A, this parameter must be zero In case of SPM_MM, Signature and register convention version
[in]Arg2Must be zero
[in]Arg3In case of FF-A, this parameter must be zero In case of SPM_MM, address of transfer list

Definition at line 1109 of file ArmStandaloneMmCoreEntryPoint.c.

◆ GetStandaloneMmCorePeCoffSections()

EFI_STATUS EFIAPI GetStandaloneMmCorePeCoffSections ( IN VOID TeData,
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT ImageContext,
OUT EFI_PHYSICAL_ADDRESS ImageBase,
IN OUT UINT32 *  SectionHeaderOffset,
IN OUT UINT16 *  NumberOfSections 
)

Privileged firmware assigns RO & Executable attributes to all memory occupied by the Boot Firmware Volume. This function locates the section information of the Standalone MM Core module to be able to change permissions of the individual sections later in the boot process.

Parameters
[in]TeDataPointer to PE/COFF image data
[in,out]ImageContextPointer to PE/COFF image context
[out]ImageBasePointer to ImageBase variable
[in,out]SectionHeaderOffsetOffset of PE/COFF image section header
[in,out]NumberOfSectionsNumber of Sections

Definition at line 347 of file SetPermissions.c.

◆ LocateStandaloneMmCorePeCoffData()

EFI_STATUS EFIAPI LocateStandaloneMmCorePeCoffData ( IN EFI_FIRMWARE_VOLUME_HEADER BfvAddress,
IN OUT VOID **  TeData,
IN OUT UINTN TeDataSize 
)

Privileged firmware assigns RO & Executable attributes to all memory occupied by the Boot Firmware Volume. This function locates the Standalone MM Core module PE/COFF image in the BFV and returns this information.

Parameters
[in]BfvAddressBase Address of Boot Firmware Volume
[in,out]TeDataPointer to address for allocating memory for PE/COFF image data
[in,out]TeDataSizePointer to size of PE/COFF image data

Definition at line 179 of file SetPermissions.c.

◆ ProcessLibraryConstructorList()

VOID EFIAPI ProcessLibraryConstructorList ( IN EFI_HANDLE  ImageHandle,
IN EFI_MM_SYSTEM_TABLE MmSystemTable 
)

Auto generated function that calls the library constructors for all of the module's dependent libraries.

This function must be called by CEntryPoint(). This function calls the set of library constructors for the set of library instances that a module depends on. This includes library instances that a module depends on directly and library instances that a module depends on indirectly through other libraries. This function is auto generated by build tools and those build tools are responsible for collecting the set of library instances, determine which ones have constructors, and calling the library constructors in the proper order based upon each of the library instances own dependencies.

Parameters
ImageHandleThe image handle of the DXE Core.
SystemTableA pointer to the EFI System Table.

◆ ProcessModuleEntryPointList()

VOID EFIAPI ProcessModuleEntryPointList ( IN VOID HobStart)

Auto generated function that calls a set of module entry points.

This function must be called by CEntryPoint(). This function calls the set of module entry points. This function is auto generated by build tools and those build tools are responsible for collecting the module entry points and calling them in a specified order.

Parameters
HobStartPointer to the beginning of the HOB List passed in from the PEI Phase.

◆ UpdateMmFoundationPeCoffPermissions()

EFI_STATUS EFIAPI UpdateMmFoundationPeCoffPermissions ( IN CONST PE_COFF_LOADER_IMAGE_CONTEXT ImageContext,
IN EFI_PHYSICAL_ADDRESS  ImageBase,
IN UINT32  SectionHeaderOffset,
IN CONST UINT16  NumberOfSections,
IN REGION_PERMISSION_UPDATE_FUNC  TextUpdater,
IN REGION_PERMISSION_UPDATE_FUNC  ReadOnlyUpdater,
IN REGION_PERMISSION_UPDATE_FUNC  ReadWriteUpdater 
)

Privileged firmware assigns RO & Executable attributes to all memory occupied by the Boot Firmware Volume. This function sets the correct permissions of sections in the Standalone MM Core module to be able to access RO and RW data and make further progress in the boot process.

Parameters
[in]ImageContextPointer to PE/COFF image context
[in]ImageBaseBase of image in memory
[in]SectionHeaderOffsetOffset of PE/COFF image section header
[in]NumberOfSectionsNumber of Sections
[in]TextUpdaterFunction to change code permissions
[in]ReadOnlyUpdaterFunction to change RO permissions
[in]ReadWriteUpdaterFunction to change RW permissions

Definition at line 44 of file SetPermissions.c.