mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/SmmCpuFeaturesLib: Abstract PcdCpuMaxLogicalProcessorNumber
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3218 Adds a new function called GetCpuMaxLogicalProcessorNumber() to return the number of maximum CPU logical processors (currently gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber). This allows the the mechanism used to retrieve the CPU maximum logical processor number to be abstracted from the logic that needs the value. 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> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210217213227.1277-5-mikuback@linux.microsoft.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
parent
2002e950ea
commit
e542e05d4f
|
@ -31,4 +31,18 @@ FinishSmmCpuFeaturesInitializeProcessor (
|
|||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
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
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
SmmCpuFeaturesLib.c
|
||||
SmmCpuFeaturesLibCommon.c
|
||||
SmmCpuFeaturesLibNoStm.c
|
||||
TraditionalMmCpuFeaturesLib.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
|
|
|
@ -157,7 +157,7 @@ CpuFeaturesLibInitialization (
|
|||
//
|
||||
// Allocate array for state of SMRR enable on all CPUs
|
||||
//
|
||||
mSmrrEnabled = (BOOLEAN *)AllocatePool (sizeof (BOOLEAN) * PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
|
||||
mSmrrEnabled = (BOOLEAN *)AllocatePool (sizeof (BOOLEAN) * GetCpuMaxLogicalProcessorNumber ());
|
||||
ASSERT (mSmrrEnabled != NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
SmmCpuFeaturesLibCommon.c
|
||||
SmmStm.c
|
||||
SmmStm.h
|
||||
TraditionalMmCpuFeaturesLib.c
|
||||
|
||||
[Sources.Ia32]
|
||||
Ia32/SmmStmSupport.c
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/** @file
|
||||
Traditional MM CPU specific programming.
|
||||
|
||||
Copyright (c) Microsoft Corporation.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <Base.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 PcdGet32 (PcdCpuMaxLogicalProcessorNumber);
|
||||
}
|
Loading…
Reference in New Issue