TianoCore EDK2 master
|
#include <PiMm.h>
#include <PiPei.h>
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MpInformation.h>
#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
#include <Library/ArmMmuLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/SerialPortLib.h>
#include <IndustryStandard/ArmStdSmc.h>
Go to the source code of this file.
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 | LocateStandaloneMmCorePeCoffData (IN EFI_FIRMWARE_VOLUME_HEADER *BfvAddress, IN OUT VOID **TeData, IN OUT UINTN *TeDataSize) |
STATIC EFI_STATUS | GetPeCoffSectionInformation (IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, OUT EFI_PHYSICAL_ADDRESS *ImageBase, OUT UINT32 *SectionHeaderOffset, OUT UINT16 *NumberOfSections) |
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) |
Locate, get and update PE/COFF permissions during Standalone MM Foundation Entry point on ARM platforms.
Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SetPermissions.c.
STATIC EFI_STATUS GetPeCoffSectionInformation | ( | IN OUT PE_COFF_LOADER_IMAGE_CONTEXT * | ImageContext, |
OUT EFI_PHYSICAL_ADDRESS * | ImageBase, | ||
OUT UINT32 * | SectionHeaderOffset, | ||
OUT UINT16 * | NumberOfSections | ||
) |
Returns the PC COFF section information.
[in,out] | ImageContext | Pointer to PE/COFF image context |
[out] | ImageBase | Base of image in memory |
[out] | SectionHeaderOffset | Offset of PE/COFF image section header |
[out] | NumberOfSections | Number of Sections |
Definition at line 232 of file SetPermissions.c.
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.
[in] | TeData | Pointer to PE/COFF image data |
[in,out] | ImageContext | Pointer to PE/COFF image context |
[out] | ImageBase | Pointer to ImageBase variable |
[in,out] | SectionHeaderOffset | Offset of PE/COFF image section header |
[in,out] | NumberOfSections | Number of Sections |
Definition at line 347 of file SetPermissions.c.
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.
[in] | BfvAddress | Base Address of Boot Firmware Volume |
[in,out] | TeData | Pointer to address for allocating memory for PE/COFF image data |
[in,out] | TeDataSize | Pointer to size of PE/COFF image data |
Definition at line 179 of file SetPermissions.c.
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.
[in] | ImageContext | Pointer to PE/COFF image context |
[in] | ImageBase | Base of image in memory |
[in] | SectionHeaderOffset | Offset of PE/COFF image section header |
[in] | NumberOfSections | Number of Sections |
[in] | TextUpdater | Function to change code permissions |
[in] | ReadOnlyUpdater | Function to change RO permissions |
[in] | ReadWriteUpdater | Function to change RW permissions |
Definition at line 44 of file SetPermissions.c.