audk/UefiCpuPkg/Library/SmmCpuFeaturesLib
Michael Kubacki 2002e950ea UefiCpuPkg/SmmCpuFeaturesLib: Cleanup library constructors
There's currently two library instances:
  1. SmmCpuFeaturesLib
  2. SmmCpuFeaturesLibStm

There's two constructor functions:
  1. SmmCpuFeaturesLibConstructor()
  2. SmmCpuFeaturesLibStmConstructor()

SmmCpuFeaturesLibConstructor() is called by
SmmCpuFeaturesLibStmConstructor() since the functionality in that
function is required by both library instances.

The declaration for SmmCpuFeaturesLibConstructor() is embedded in
"SmmStm.c" instead of being declared in a header file. Further,
that constructor function is called by the STM specific constructor.

This change moves the common code to a function called
CpuFeaturesLibInitialization() which is declared in an internal
library header file "CpuFeaturesLib.h". Each constructor simply
calls this function to perform the common functionality.

Additionally, SmmCpuFeaturesLibConstructor() is moved from
SmmCpuFeaturesLibNoStm.c into a instance-specific file allowing
SmmCpuFeaturesLibNoStm.c to contain no STM implementation agnostic
to a particular library instance.

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-4-mikuback@linux.microsoft.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2021-03-08 18:07:32 +00:00
..
Ia32 UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
X64 UefiCpuPkg/Smm: Fix various typos 2020-02-10 22:30:07 +00:00
CpuFeaturesLib.h UefiCpuPkg/SmmCpuFeaturesLib: Cleanup library constructors 2021-03-08 18:07:32 +00:00
SmmCpuFeaturesLib.c UefiCpuPkg/SmmCpuFeaturesLib: Cleanup library constructors 2021-03-08 18:07:32 +00:00
SmmCpuFeaturesLib.inf UefiCpuPkg/SmmCpuFeaturesLib: Cleanup library constructors 2021-03-08 18:07:32 +00:00
SmmCpuFeaturesLib.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
SmmCpuFeaturesLibCommon.c UefiCpuPkg/SmmCpuFeaturesLib: Cleanup library constructors 2021-03-08 18:07:32 +00:00
SmmCpuFeaturesLibNoStm.c UefiCpuPkg/SmmCpuFeaturesLib: Move multi-instance function decl to header 2021-03-08 18:07:32 +00:00
SmmCpuFeaturesLibStm.inf UefiCpuPkg/SmmCpuFeaturesLib: Rename SmmCpuFeaturesLib.c 2021-03-08 18:07:32 +00:00
SmmStm.c UefiCpuPkg/SmmCpuFeaturesLib: Cleanup library constructors 2021-03-08 18:07:32 +00:00
SmmStm.h UefiCpuPkg/Smm: Fix various typos 2020-02-10 22:30:07 +00:00