]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Library / PiSmmCoreSmmServicesTableLib / PiSmmCoreSmmServicesTableLib.c
1 /** @file
2 SMM Core SMM Services Table Library.
3
4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <PiSmm.h>
10 #include <Library/SmmServicesTableLib.h>
11 #include <Library/DebugLib.h>
12
13 EFI_SMM_SYSTEM_TABLE2 *gSmst = NULL;
14 extern EFI_SMM_SYSTEM_TABLE2 gSmmCoreSmst;
15
16 /**
17 The constructor function caches the pointer of SMM Services Table.
18
19 @param ImageHandle The firmware allocated handle for the EFI image.
20 @param SystemTable A pointer to the EFI System Table.
21
22 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
23
24 **/
25 EFI_STATUS
26 EFIAPI
27 SmmCoreSmmServicesTableLibConstructor (
28 IN EFI_HANDLE ImageHandle,
29 IN EFI_SYSTEM_TABLE *SystemTable
30 )
31 {
32 gSmst = &gSmmCoreSmst;
33 return EFI_SUCCESS;
34 }
35
36 /**
37 This function allows the caller to determine if the driver is executing in
38 System Management Mode(SMM).
39
40 This function returns TRUE if the driver is executing in SMM and FALSE if the
41 driver is not executing in SMM.
42
43 @retval TRUE The driver is executing in System Management Mode (SMM).
44 @retval FALSE The driver is not executing in System Management Mode (SMM).
45
46 **/
47 BOOLEAN
48 EFIAPI
49 InSmm (
50 VOID
51 )
52 {
53 return TRUE;
54 }