]> git.proxmox.com Git - mirror_edk2.git/blob - StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
StandaloneMmPkg: Fix check buffer address failed issue from TF-A
[mirror_edk2.git] / StandaloneMmPkg / Drivers / StandaloneMmCpu / StandaloneMmCpu.h
1 /** @file
2 Private header with declarations and definitions specific to the MM Standalone
3 CPU driver
4
5 Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _ARM_TF_CPU_DRIVER_H_
11 #define _ARM_TF_CPU_DRIVER_H_
12
13 #include <Protocol/MmCommunication2.h>
14 #include <Protocol/MmConfiguration.h>
15 #include <Protocol/MmCpu.h>
16 #include <Guid/MpInformation.h>
17
18 //
19 // CPU driver initialization specific declarations
20 //
21 extern EFI_MM_SYSTEM_TABLE *mMmst;
22
23 //
24 // CPU State Save protocol specific declarations
25 //
26 extern EFI_MM_CPU_PROTOCOL mMmCpuState;
27
28 //
29 // MM event handling specific declarations
30 //
31 extern EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext;
32 extern EFI_MMRAM_DESCRIPTOR mNsCommBuffer;
33 extern EFI_MMRAM_DESCRIPTOR mSCommBuffer;
34 extern MP_INFORMATION_HOB_DATA *mMpInformationHobData;
35 extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig;
36
37 /**
38 The PI Standalone MM entry point for the TF-A CPU driver.
39
40 @param [in] EventId The event Id.
41 @param [in] CpuNumber The CPU number.
42 @param [in] NsCommBufferAddr Address of the NS common buffer.
43
44 @retval EFI_SUCCESS Success.
45 @retval EFI_INVALID_PARAMETER A parameter was invalid.
46 @retval EFI_ACCESS_DENIED Access not permitted.
47 @retval EFI_OUT_OF_RESOURCES Out of resources.
48 @retval EFI_UNSUPPORTED Operation not supported.
49 **/
50 EFI_STATUS
51 PiMmStandaloneArmTfCpuDriverEntry (
52 IN UINTN EventId,
53 IN UINTN CpuNumber,
54 IN UINTN NsCommBufferAddr
55 );
56
57 /**
58 This function is the main entry point for an MM handler dispatch
59 or communicate-based callback.
60
61 @param DispatchHandle The unique handle assigned to this handler by
62 MmiHandlerRegister().
63 @param Context Points to an optional handler context which was
64 specified when the handler was registered.
65 @param CommBuffer A pointer to a collection of data in memory that will
66 be conveyed from a non-MM environment into an
67 MM environment.
68 @param CommBufferSize The size of the CommBuffer.
69
70 @return Status Code
71
72 **/
73 EFI_STATUS
74 EFIAPI
75 PiMmCpuTpFwRootMmiHandler (
76 IN EFI_HANDLE DispatchHandle,
77 IN CONST VOID *Context OPTIONAL,
78 IN OUT VOID *CommBuffer OPTIONAL,
79 IN OUT UINTN *CommBufferSize OPTIONAL
80 );
81
82 #endif