HalpPowerWriteResetCommand

VOID __stdcall HalpPowerWriteResetCommand(UINT64 ProcessorNumber, INT64 *ProcessorsStarted){
  int v3; 
  UINT64 v4; 
  v3 = ProcessorNumber;
  if( HalpRebootHandler )
    HalpRebootHandler();
  if( !v3 )
  {
    if( HalpMiscIsLegacyPcType() )
    {
      __outbyte(0x70u, 0xFu);
      __outbyte(0x71u, 0);
      KeStallExecutionProcessor(0x64u);
    }
    if( !HalFirmwareTypeEfi )
    {
      v4 = HalpMap(0i64, MmCached, 1u);
      if( v4 )
        *(_WORD *)(v4 + 1138) = 4660;
    }
    if( (HalpPlatformFlags & 4) != 0 )
    {
      __outbyte(0x70u, 0x15u);
      KeStallExecutionProcessor(1u);
    }
    if( HalpHvUsedForReboot )
      __writemsr(0x40000003u, 1ui64);
    if( byte_140C48F40 )
    {
      HalpAcpiPmRegisterWrite(8, 0, (__int64)qword_140C49E00, 1u, 0i64);
      KeStallExecutionProcessor(0x1F4u);
    }
    if( (HalpPlatformFlags & 2) != 0 )
    {
      __outbyte(0x64u, 0xFEu);
      KeStallExecutionProcessor(0x1388u);
    }
    if( HalFirmwareTypeEfi )
    {
      HalEfiResetSystem(1i64);
      HalEfiResetSystem(0i64);
      __debugbreak();
    }
  }
  if( ProcessorsStarted )
    _InterlockedDecrement((volatile signed __int32 *)ProcessorsStarted);
  __halt();
}

Referenced by:

HalReturnToFirmware
HalpInterruptResetAllProcessors
HalpInterruptResetThisProcessor