]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/MpInitLib: Remove global variable X2ApicEnable
authorRay Ni <ray.ni@intel.com>
Wed, 23 Oct 2019 06:54:57 +0000 (14:54 +0800)
committerRay Ni <ray.ni@intel.com>
Tue, 5 Nov 2019 02:03:44 +0000 (10:03 +0800)
commitfe3ca5fd2518e63338c74df05f508fa81baab2d7
treefecd3197eb04bb1337b9e5e00402f017e842c681
parent54d1e76f4e17255080f083b155cee8c6678d8175
UefiCpuPkg/MpInitLib: Remove global variable X2ApicEnable

MpInitLib sets X2ApicEnable in two places.
1. CollectProcessorCount()
   This function is called when MpInitLibInitialize() hasn't been
   called before.
   It sets X2ApicEnable and later in the same function it configures
   all CPUs to operate in X2 APIC mode.
2. MpInitLibInitialize()
   The X2ApicEnable setting happens when this function is called in
   second time. But after that setting, no code consumes that flag.

With the above analysis and with the purpose of simplifying the code,
the X2ApicEnable in #1 is changed to local variable and the #2 can be
changed to remove the setting of X2ApicEnable.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
UefiCpuPkg/Library/MpInitLib/MpLib.c
UefiCpuPkg/Library/MpInitLib/MpLib.h