mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/SmmCpuFeaturesLib: Add Standalone MM support
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3218 Adds an INF for StandaloneMmCpuFeaturesLib, which supports building the SmmCpuFeaturesLib code for Standalone MM. Minimal code changes are made to allow reuse of existing code for Standalone MM. The original INF file names are left intact (continue to use SMM terminology) to retain backward compatibility with platforms that use those INFs. Similarly, the pre-existing C file names are unchanged to be consistent with the INF file names. Note that all references in library source files to PiSmm.h have been changed to PiMm.h for consistency. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Message-Id: <20210217213227.1277-6-mikuback@linux.microsoft.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
e542e05d4f
commit
edd46cd407
|
@ -6,7 +6,7 @@
|
|||
|
||||
**/
|
||||
|
||||
#include <PiSmm.h>
|
||||
#include <PiMm.h>
|
||||
#include <Library/DebugLib.h>
|
||||
|
||||
#include "SmmStm.h"
|
||||
|
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||
|
||||
**/
|
||||
|
||||
#include <PiSmm.h>
|
||||
#include <PiMm.h>
|
||||
#include "CpuFeaturesLib.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||
|
||||
**/
|
||||
|
||||
#include <PiSmm.h>
|
||||
#include <PiMm.h>
|
||||
#include <Library/SmmCpuFeaturesLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/MtrrLib.h>
|
||||
|
|
|
@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||
|
||||
**/
|
||||
|
||||
#include <PiSmm.h>
|
||||
#include <PiMm.h>
|
||||
#include <Library/SmmCpuFeaturesLib.h>
|
||||
#include "CpuFeaturesLib.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
**/
|
||||
|
||||
#include <PiSmm.h>
|
||||
#include <PiMm.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
/** @file
|
||||
Standalone MM CPU specific programming.
|
||||
|
||||
Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) Microsoft Corporation.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <PiMm.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include "CpuFeaturesLib.h"
|
||||
|
||||
/**
|
||||
Gets the maximum number of logical processors from the PCD PcdCpuMaxLogicalProcessorNumber.
|
||||
|
||||
This access is abstracted from the PCD services to enforce that the PCD be
|
||||
FixedAtBuild in the Standalone MM build of this driver.
|
||||
|
||||
@return The value of PcdCpuMaxLogicalProcessorNumber.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
GetCpuMaxLogicalProcessorNumber (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return FixedPcdGet32 (PcdCpuMaxLogicalProcessorNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
The Standalone MM library constructor.
|
||||
|
||||
@param[in] ImageHandle Image handle of this driver.
|
||||
@param[in] SystemTable A Pointer to the EFI System Table.
|
||||
|
||||
@retval EFI_SUCCESS This constructor always returns success.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
StandaloneMmCpuFeaturesLibConstructor (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_MM_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
CpuFeaturesLibInitialization ();
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
## @file
|
||||
# Standalone MM CPU specific programming.
|
||||
#
|
||||
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) Microsoft Corporation.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = StandaloneMmCpuFeaturesLib
|
||||
MODULE_UNI_FILE = SmmCpuFeaturesLib.uni
|
||||
FILE_GUID = BB554A2D-F5DF-41D3-8C62-46476A2B2B18
|
||||
MODULE_TYPE = MM_STANDALONE
|
||||
VERSION_STRING = 1.0
|
||||
PI_SPECIFICATION_VERSION = 0x00010032
|
||||
LIBRARY_CLASS = SmmCpuFeaturesLib
|
||||
CONSTRUCTOR = StandaloneMmCpuFeaturesLibConstructor
|
||||
|
||||
[Sources]
|
||||
CpuFeaturesLib.h
|
||||
StandaloneMmCpuFeaturesLib.c
|
||||
SmmCpuFeaturesLibCommon.c
|
||||
SmmCpuFeaturesLibNoStm.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
UefiCpuPkg/UefiCpuPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseLib
|
||||
DebugLib
|
||||
MemoryAllocationLib
|
||||
PcdLib
|
||||
|
||||
[FixedPcd]
|
||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber ## SOMETIMES_CONSUMES
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
**/
|
||||
|
||||
#include <PiSmm.h>
|
||||
#include <PiMm.h>
|
||||
#include <Library/DebugLib.h>
|
||||
|
||||
#include "SmmStm.h"
|
||||
|
|
|
@ -154,6 +154,7 @@
|
|||
UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf
|
||||
UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
|
||||
UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf
|
||||
UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.inf
|
||||
UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
|
||||
UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf
|
||||
UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf
|
||||
|
|
Loading…
Reference in New Issue