/* Initialize the state information for the CPU Architectural Protocol. */
EFI_STATUS EFIAPI InitializeCpu(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
/* Initialize the state information for the CPU Architectural Protocol. */
EFI_STATUS EFIAPI InitializeCpu(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
{
  EFI_STATUS  Status;
  EFI_EVENT   IdleLoopEvent;
  InitializePageTableLib ();
  InitializeFloatingPointUnits ();
  DisableInterrupts ();
  InitGlobalDescriptorTable ();
  InitInterruptDescriptorTable ();
  Status = gBS->InstallMultipleProtocolInterfaces (
                  &mCpuHandle,
                  &gEfiCpuArchProtocolGuid,
                  &gCpu,
                  NULL
                  );
  ASSERT_EFI_ERROR (Status);
  RefreshGcdMemoryAttributes ();
  AddLocalApicMemorySpace (ImageHandle);
  Status = gBS->CreateEventEx (
                  EVT_NOTIFY_SIGNAL,
                  TPL_NOTIFY,
                  IdleLoopEventCallback,
                  NULL,
                  &gIdleLoopEventGuid,
                  &IdleLoopEvent
                  );
  ASSERT_EFI_ERROR (Status);
  InitializeMpSupport ();
  return Status;
}