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 MM_CPU_DRIVER_H_
|
---|
11 | #define MM_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 | typedef
|
---|
19 | EFI_STATUS
|
---|
20 | (*PI_MM_CPU_DRIVER_ENTRYPOINT) (
|
---|
21 | IN UINTN EventId,
|
---|
22 | IN UINTN CpuNumber,
|
---|
23 | IN UINTN NsCommBufferAddr
|
---|
24 | );
|
---|
25 |
|
---|
26 | typedef struct {
|
---|
27 | PI_MM_CPU_DRIVER_ENTRYPOINT *MmCpuDriverEpPtr;
|
---|
28 | } MM_CPU_DRIVER_EP_DESCRIPTOR;
|
---|
29 |
|
---|
30 | //
|
---|
31 | // CPU driver initialization specific declarations
|
---|
32 | //
|
---|
33 | extern EFI_MM_SYSTEM_TABLE *mMmst;
|
---|
34 |
|
---|
35 | //
|
---|
36 | // CPU State Save protocol specific declarations
|
---|
37 | //
|
---|
38 | extern EFI_MM_CPU_PROTOCOL mMmCpuState;
|
---|
39 |
|
---|
40 | //
|
---|
41 | // MM event handling specific declarations
|
---|
42 | //
|
---|
43 | extern EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext;
|
---|
44 | extern EFI_MMRAM_DESCRIPTOR mNsCommBuffer;
|
---|
45 | extern EFI_MMRAM_DESCRIPTOR mSCommBuffer;
|
---|
46 | extern MP_INFORMATION_HOB_DATA *mMpInformationHobData;
|
---|
47 | extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig;
|
---|
48 |
|
---|
49 | /**
|
---|
50 | The PI Standalone MM entry point for the CPU driver.
|
---|
51 |
|
---|
52 | @param [in] EventId The event Id.
|
---|
53 | @param [in] CpuNumber The CPU number.
|
---|
54 | @param [in] NsCommBufferAddr Address of the NS common buffer.
|
---|
55 |
|
---|
56 | @retval EFI_SUCCESS Success.
|
---|
57 | @retval EFI_INVALID_PARAMETER A parameter was invalid.
|
---|
58 | @retval EFI_ACCESS_DENIED Access not permitted.
|
---|
59 | @retval EFI_OUT_OF_RESOURCES Out of resources.
|
---|
60 | @retval EFI_UNSUPPORTED Operation not supported.
|
---|
61 | **/
|
---|
62 | EFI_STATUS
|
---|
63 | PiMmStandaloneMmCpuDriverEntry (
|
---|
64 | IN UINTN EventId,
|
---|
65 | IN UINTN CpuNumber,
|
---|
66 | IN UINTN NsCommBufferAddr
|
---|
67 | );
|
---|
68 |
|
---|
69 | /**
|
---|
70 | This function is the main entry point for an MM handler dispatch
|
---|
71 | or communicate-based callback.
|
---|
72 |
|
---|
73 | @param DispatchHandle The unique handle assigned to this handler by
|
---|
74 | MmiHandlerRegister().
|
---|
75 | @param Context Points to an optional handler context which was
|
---|
76 | specified when the handler was registered.
|
---|
77 | @param CommBuffer A pointer to a collection of data in memory that will
|
---|
78 | be conveyed from a non-MM environment into an
|
---|
79 | MM environment.
|
---|
80 | @param CommBufferSize The size of the CommBuffer.
|
---|
81 |
|
---|
82 | @return Status Code
|
---|
83 |
|
---|
84 | **/
|
---|
85 | EFI_STATUS
|
---|
86 | EFIAPI
|
---|
87 | PiMmCpuTpFwRootMmiHandler (
|
---|
88 | IN EFI_HANDLE DispatchHandle,
|
---|
89 | IN CONST VOID *Context OPTIONAL,
|
---|
90 | IN OUT VOID *CommBuffer OPTIONAL,
|
---|
91 | IN OUT UINTN *CommBufferSize OPTIONAL
|
---|
92 | );
|
---|
93 |
|
---|
94 | #endif /* MM_CPU_DRIVER_H_ */
|
---|