summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@linaro.org>2021-08-09 17:19:46 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-08-11 11:32:32 +0000
commita776bbabd9e8f370feb089cdc016324b1d6a37c7 (patch)
tree82d9c8d82fc63a28272bfa251ec1449366d74c3e /StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
parentb7f0226a462fb35fadce4412a5929ed060333dd0 (diff)
downloadedk2-a776bbabd9e8f370feb089cdc016324b1d6a37c7.tar.gz
edk2-a776bbabd9e8f370feb089cdc016324b1d6a37c7.tar.bz2
edk2-a776bbabd9e8f370feb089cdc016324b1d6a37c7.zip
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>
Diffstat (limited to 'StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h')
-rw-r--r--StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
new file mode 100644
index 0000000000..2c96439c15
--- /dev/null
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
@@ -0,0 +1,81 @@
+/** @file
+ Private header with declarations and definitions specific to the MM Standalone
+ CPU driver
+
+ Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _ARM_TF_CPU_DRIVER_H_
+#define _ARM_TF_CPU_DRIVER_H_
+
+#include <Protocol/MmCommunication2.h>
+#include <Protocol/MmConfiguration.h>
+#include <Protocol/MmCpu.h>
+#include <Guid/MpInformation.h>
+
+//
+// CPU driver initialization specific declarations
+//
+extern EFI_MM_SYSTEM_TABLE *mMmst;
+
+//
+// CPU State Save protocol specific declarations
+//
+extern EFI_MM_CPU_PROTOCOL mMmCpuState;
+
+//
+// MM event handling specific declarations
+//
+extern EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext;
+extern EFI_MMRAM_DESCRIPTOR mNsCommBuffer;
+extern MP_INFORMATION_HOB_DATA *mMpInformationHobData;
+extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig;
+
+/**
+ The PI Standalone MM entry point for the TF-A CPU driver.
+
+ @param [in] EventId The event Id.
+ @param [in] CpuNumber The CPU number.
+ @param [in] NsCommBufferAddr Address of the NS common buffer.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER A parameter was invalid.
+ @retval EFI_ACCESS_DENIED Access not permitted.
+ @retval EFI_OUT_OF_RESOURCES Out of resources.
+ @retval EFI_UNSUPPORTED Operation not supported.
+**/
+EFI_STATUS
+PiMmStandaloneArmTfCpuDriverEntry (
+ IN UINTN EventId,
+ IN UINTN CpuNumber,
+ IN UINTN NsCommBufferAddr
+ );
+
+/**
+ This function is the main entry point for an MM handler dispatch
+ or communicate-based callback.
+
+ @param DispatchHandle The unique handle assigned to this handler by
+ MmiHandlerRegister().
+ @param Context Points to an optional handler context which was
+ specified when the handler was registered.
+ @param CommBuffer A pointer to a collection of data in memory that will
+ be conveyed from a non-MM environment into an
+ MM environment.
+ @param CommBufferSize The size of the CommBuffer.
+
+ @return Status Code
+
+**/
+EFI_STATUS
+EFIAPI
+PiMmCpuTpFwRootMmiHandler (
+ IN EFI_HANDLE DispatchHandle,
+ IN CONST VOID *Context, OPTIONAL
+ IN OUT VOID *CommBuffer, OPTIONAL
+ IN OUT UINTN *CommBufferSize OPTIONAL
+ );
+
+#endif