/* If BaseAddress is not aligned on a 4KB boundary, then ASSERT(). */
VOID EFIAPI SetLocalApicBaseAddress(IN UINTN BaseAddress)
/* If BaseAddress is not aligned on a 4KB boundary, then ASSERT(). */
VOID EFIAPI SetLocalApicBaseAddress(IN UINTN BaseAddress)
{
  MSR_IA32_APIC_BASE_REGISTER  ApicBaseMsr;
  ASSERT ((BaseAddress & (SIZE_4KB - 1)) == 0);
  if (!LocalApicBaseAddressMsrSupported ()) {
    return;
  }
  ApicBaseMsr.Uint64 = LocalApicReadMsrReg64 (MSR_IA32_APIC_BASE);
  ApicBaseMsr.Bits.ApicBase   = (UINT32)(BaseAddress >> 12);
  ApicBaseMsr.Bits.ApicBaseHi = (UINT32)(RShiftU64 ((UINT64)BaseAddress, 32));
  LocalApicWriteMsrReg64 (MSR_IA32_APIC_BASE, ApicBaseMsr.Uint64);
}