UefiCpuPkg/SmmCpuFeaturesLib: Move multi-instance function decl to header

FinishSmmCpuFeaturesInitializeProcessor() is a multi-instance
internal library function that is currently not declared in a
header file but embedded in "SmmCpuFeaturesLib.c".

This change cleans up the declaration moving it to a new header
file "CpuFeaturesLib.h" and removing the local declaration in
"SmmCpuFeaturesLib.c".

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-2-mikuback@linux.microsoft.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
[lersek@redhat.com: replace the guard macro "_CPU_FEATURES_LIB_H_" with
 "CPU_FEATURES_LIB_H_", for fixing ECC 8003, per commit 6ffbb3581a]
This commit is contained in:
Michael Kubacki 2021-02-17 13:32:23 -08:00 committed by mergify[bot]
parent 94fa95c874
commit 3e062ea498
6 changed files with 27 additions and 10 deletions

View File

@ -0,0 +1,22 @@
/** @file
Internal library function definitions.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef CPU_FEATURES_LIB_H_
#define CPU_FEATURES_LIB_H_
/**
Internal worker function that is called to complete CPU initialization at the
end of SmmCpuFeaturesInitializeProcessor().
**/
VOID
FinishSmmCpuFeaturesInitializeProcessor (
VOID
);
#endif

View File

@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Register/Intel/Cpuid.h> #include <Register/Intel/Cpuid.h>
#include <Register/Intel/SmramSaveStateMap.h> #include <Register/Intel/SmramSaveStateMap.h>
#include "CpuFeaturesLib.h"
// //
// Machine Specific Registers (MSRs) // Machine Specific Registers (MSRs)
@ -35,16 +36,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define SMM_FEATURES_LIB_IA32_MCA_CAP 0x17D #define SMM_FEATURES_LIB_IA32_MCA_CAP 0x17D
#define SMM_CODE_ACCESS_CHK_BIT BIT58 #define SMM_CODE_ACCESS_CHK_BIT BIT58
/**
Internal worker function that is called to complete CPU initialization at the
end of SmmCpuFeaturesInitializeProcessor().
**/
VOID
FinishSmmCpuFeaturesInitializeProcessor (
VOID
);
// //
// Set default value to assume SMRR is not supported // Set default value to assume SMRR is not supported
// //

View File

@ -17,6 +17,7 @@
CONSTRUCTOR = SmmCpuFeaturesLibConstructor CONSTRUCTOR = SmmCpuFeaturesLibConstructor
[Sources] [Sources]
CpuFeaturesLib.h
SmmCpuFeaturesLib.c SmmCpuFeaturesLib.c
SmmCpuFeaturesLibNoStm.c SmmCpuFeaturesLibNoStm.c

View File

@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <PiSmm.h> #include <PiSmm.h>
#include <Library/SmmCpuFeaturesLib.h> #include <Library/SmmCpuFeaturesLib.h>
#include "CpuFeaturesLib.h"
/** /**
Internal worker function that is called to complete CPU initialization at the Internal worker function that is called to complete CPU initialization at the

View File

@ -18,6 +18,7 @@
CONSTRUCTOR = SmmCpuFeaturesLibStmConstructor CONSTRUCTOR = SmmCpuFeaturesLibStmConstructor
[Sources] [Sources]
CpuFeaturesLib.h
SmmCpuFeaturesLib.c SmmCpuFeaturesLib.c
SmmStm.c SmmStm.c
SmmStm.h SmmStm.h

View File

@ -21,6 +21,7 @@
#include <Protocol/MpService.h> #include <Protocol/MpService.h>
#include "CpuFeaturesLib.h"
#include "SmmStm.h" #include "SmmStm.h"
#define TXT_EVTYPE_BASE 0x400 #define TXT_EVTYPE_BASE 0x400