StandaloneMmPkg: build for 32bit arm machines
This change allows to build StandaloneMmPkg components for 32bit Arm StandaloneMm firmware. This change mainly moves AArch64/ source files to Arm/ side directory for several components: StandaloneMmCpu, StandaloneMmCoreEntryPoint and StandaloneMmMemLib. The source file is built for both 32b and 64b Arm targets. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
committed by
mergify[bot]
parent
b7f0226a46
commit
a776bbabd9
@@ -0,0 +1,77 @@
|
||||
/** @file
|
||||
Internal ARCH Specific file of MM memory check library.
|
||||
|
||||
MM memory check library implementation. This library consumes MM_ACCESS_PROTOCOL
|
||||
to get MMRAM information. In order to use this library instance, the platform should produce
|
||||
all MMRAM range via MM_ACCESS_PROTOCOL, including the range for firmware (like MM Core
|
||||
and MM driver) and/or specific dedicated hardware.
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
//
|
||||
// Maximum support address used to check input buffer
|
||||
//
|
||||
extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;
|
||||
|
||||
#ifdef MDE_CPU_AARCH64
|
||||
#define ARM_PHYSICAL_ADDRESS_BITS 36
|
||||
#endif
|
||||
#ifdef MDE_CPU_ARM
|
||||
#define ARM_PHYSICAL_ADDRESS_BITS 32
|
||||
#endif
|
||||
|
||||
/**
|
||||
Calculate and save the maximum support address.
|
||||
|
||||
**/
|
||||
VOID
|
||||
MmMemLibInternalCalculateMaximumSupportAddress (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT8 PhysicalAddressBits;
|
||||
|
||||
PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS;
|
||||
|
||||
//
|
||||
// Save the maximum support address in one global variable
|
||||
//
|
||||
mMmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1);
|
||||
DEBUG ((DEBUG_INFO, "mMmMemLibInternalMaximumSupportAddress = 0x%lx\n", mMmMemLibInternalMaximumSupportAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
Initialize cached Mmram Ranges from HOB.
|
||||
|
||||
@retval EFI_UNSUPPORTED The routine is unable to extract MMRAM information.
|
||||
@retval EFI_SUCCESS MmRanges are populated successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
MmMemLibInternalPopulateMmramRanges (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
// Not implemented for AARCH64.
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Deinitialize cached Mmram Ranges.
|
||||
|
||||
**/
|
||||
VOID
|
||||
MmMemLibInternalFreeMmramRanges (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
// Not implemented for AARCH64.
|
||||
}
|
||||
|
Reference in New Issue
Block a user