summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-02-17 13:32:23 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-03-08 18:07:32 +0000
commit3e062ea49810fa890b68031a45a113f15bb526c3 (patch)
tree35f4fa8d745c038f7e0d18f78283fbcba4e95a1d
parent94fa95c8746c553324e8b69ea4a74af670075324 (diff)
downloadedk2-3e062ea49810fa890b68031a45a113f15bb526c3.zip
edk2-3e062ea49810fa890b68031a45a113f15bb526c3.tar.gz
edk2-3e062ea49810fa890b68031a45a113f15bb526c3.tar.bz2
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 6ffbb3581ab7]
-rw-r--r--UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h22
-rw-r--r--UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c11
-rw-r--r--UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf1
-rw-r--r--UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c1
-rw-r--r--UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf1
-rw-r--r--UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c1
6 files changed, 27 insertions, 10 deletions
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h b/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h
new file mode 100644
index 0000000..106e070
--- /dev/null
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h
@@ -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
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
index 8fed18c..75bde75 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
@@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/DebugLib.h>
#include <Register/Intel/Cpuid.h>
#include <Register/Intel/SmramSaveStateMap.h>
+#include "CpuFeaturesLib.h"
//
// 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_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
//
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
index dd828ba..a6d8467 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
@@ -17,6 +17,7 @@
CONSTRUCTOR = SmmCpuFeaturesLibConstructor
[Sources]
+ CpuFeaturesLib.h
SmmCpuFeaturesLib.c
SmmCpuFeaturesLibNoStm.c
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c
index 3e63c5e..c562582 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c
@@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <PiSmm.h>
#include <Library/SmmCpuFeaturesLib.h>
+#include "CpuFeaturesLib.h"
/**
Internal worker function that is called to complete CPU initialization at the
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf
index 50b9cc8..89cd252 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf
@@ -18,6 +18,7 @@
CONSTRUCTOR = SmmCpuFeaturesLibStmConstructor
[Sources]
+ CpuFeaturesLib.h
SmmCpuFeaturesLib.c
SmmStm.c
SmmStm.h
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c
index f7f8afa..b5aad41 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c
@@ -21,6 +21,7 @@
#include <Protocol/MpService.h>
+#include "CpuFeaturesLib.h"
#include "SmmStm.h"
#define TXT_EVTYPE_BASE 0x400