TianoCore EDK2
master
Loading...
Searching...
No Matches
MmServicesTableLib.c
Go to the documentation of this file.
1
10
#include <
PiMm.h
>
11
#include <
Protocol/MmBase.h
>
12
#include <
Library/MmServicesTableLib.h
>
13
#include <
Library/DebugLib.h
>
14
15
EFI_MM_SYSTEM_TABLE
*gMmst =
NULL
;
16
26
EFI_STATUS
27
EFIAPI
28
MmServicesTableLibConstructor
(
29
IN
EFI_HANDLE
ImageHandle,
30
IN
EFI_SYSTEM_TABLE
*SystemTable
31
)
32
{
33
EFI_STATUS
Status;
34
EFI_MM_BASE_PROTOCOL
*InternalMmBase;
35
36
InternalMmBase =
NULL
;
37
//
38
// Retrieve MM Base Protocol, Do not use gBS from UefiBootServicesTableLib on purpose
39
// to prevent inclusion of gBS, gST, and gImageHandle from SMM Drivers unless the
40
// MM driver explicity declares that dependency.
41
//
42
Status = SystemTable->BootServices->LocateProtocol (
43
&gEfiMmBaseProtocolGuid,
44
NULL
,
45
(VOID **)&InternalMmBase
46
);
47
ASSERT_EFI_ERROR
(Status);
48
ASSERT (InternalMmBase !=
NULL
);
49
50
//
51
// We are in MM, retrieve the pointer to MM System Table
52
//
53
InternalMmBase->GetMmstLocation (InternalMmBase, &gMmst);
54
ASSERT (gMmst !=
NULL
);
55
56
return
EFI_SUCCESS
;
57
}
NULL
#define NULL
Definition:
Base.h:319
IN
#define IN
Definition:
Base.h:279
DebugLib.h
ASSERT_EFI_ERROR
#define ASSERT_EFI_ERROR(StatusParameter)
Definition:
DebugLib.h:462
MmBase.h
MmServicesTableLibConstructor
EFI_STATUS EFIAPI MmServicesTableLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition:
MmServicesTableLib.c:28
MmServicesTableLib.h
PiMm.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_HANDLE
VOID * EFI_HANDLE
Definition:
UefiBaseType.h:33
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
_EFI_MM_BASE_PROTOCOL
Definition:
MmBase.h:73
_EFI_MM_SYSTEM_TABLE
Definition:
PiMmCis.h:249
EFI_SYSTEM_TABLE
Definition:
UefiSpec.h:2028
MdePkg
Library
MmServicesTableLib
MmServicesTableLib.c
Generated on Fri Nov 15 2024 18:01:17 for TianoCore EDK2 by
1.9.6