]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/MmBase.h
a84c587b48259d8eff85de445da8917d125530f5
[mirror_edk2.git] / MdePkg / Include / Protocol / MmBase.h
1 /** @file
2 EFI MM Base Protocol as defined in the PI 1.5 specification.
3
4 This protocol is utilized by all MM drivers to locate the MM infrastructure services and determine
5 whether the driver is being invoked inside MMRAM or outside of MMRAM.
6
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #ifndef _MM_BASE_H_
19 #define _MM_BASE_H_
20
21 #include <Pi/PiMmCis.h>
22
23 #define EFI_MM_BASE_PROTOCOL_GUID \
24 { \
25 0xf4ccbfb7, 0xf6e0, 0x47fd, {0x9d, 0xd4, 0x10, 0xa8, 0xf1, 0x50, 0xc1, 0x91 } \
26 }
27
28 typedef struct _EFI_MM_BASE_PROTOCOL EFI_MM_BASE_PROTOCOL;
29
30 /**
31 Service to indicate whether the driver is currently executing in the MM Initialization phase.
32
33 This service is used to indicate whether the driver is currently executing in the MM Initialization
34 phase. For MM drivers, this will return TRUE in InMmram while inside the driver's entry point and
35 otherwise FALSE. For combination MM/DXE drivers, this will return FALSE in the DXE launch. For the
36 MM launch, it behaves as an MM driver.
37
38 @param[in] This The EFI_MM_BASE_PROTOCOL instance.
39 @param[out] InMmram Pointer to a Boolean which, on return, indicates that the driver is
40 currently executing inside of MMRAM (TRUE) or outside of MMRAM (FALSE).
41
42 @retval EFI_SUCCESS The call returned successfully.
43 @retval EFI_INVALID_PARAMETER InMmram was NULL.
44 **/
45 typedef
46 EFI_STATUS
47 (EFIAPI *EFI_MM_INSIDE_OUT)(
48 IN CONST EFI_MM_BASE_PROTOCOL *This,
49 OUT BOOLEAN *InMmram
50 )
51 ;
52
53 /**
54 Returns the location of the Management Mode Service Table (MMST).
55
56 This function returns the location of the Management Mode Service Table (MMST). The use of the
57 API is such that a driver can discover the location of the MMST in its entry point and then cache it in
58 some driver global variable so that the MMST can be invoked in subsequent handlers.
59
60 @param[in] This The EFI_MM_BASE_PROTOCOL instance.
61 @param[in,out] Mmst On return, points to a pointer to the Management Mode Service Table (MMST).
62
63 @retval EFI_SUCCESS The operation was successful.
64 @retval EFI_INVALID_PARAMETER Mmst was invalid.
65 @retval EFI_UNSUPPORTED Not in MM.
66 **/
67 typedef
68 EFI_STATUS
69 (EFIAPI *EFI_MM_GET_MMST_LOCATION)(
70 IN CONST EFI_MM_BASE_PROTOCOL *This,
71 IN OUT EFI_MM_SYSTEM_TABLE **Mmst
72 )
73 ;
74
75 ///
76 /// EFI MM Base Protocol is utilized by all MM drivers to locate the MM infrastructure
77 /// services and determine whether the driver is being invoked inside MMRAM or outside of MMRAM.
78 ///
79 struct _EFI_MM_BASE_PROTOCOL {
80 EFI_MM_INSIDE_OUT InMm;
81 EFI_MM_GET_MMST_LOCATION GetMmstLocation;
82 };
83
84 extern EFI_GUID gEfiMmBaseProtocolGuid;
85
86 #endif
87