HalpPowerWriteResetCommand

VOID __stdcall HalpPowerWriteResetCommand(UINT64 ProcessorNumber, INT64 *ProcessorsStarted){
  int v3; 
  UINT64 v4; 
  UINT64 Protection; 

  v3 = ProcessorNumber;
  if( *(&WheapErrorSourceTable + 46) )
    (*(&WheapErrorSourceTable + 46))();
  if( !v3 )
  {
    if( HalpMiscIsLegacyPcType() )
    {
      __outbyte(0x70u, 0xFu);
      __outbyte(0x71u, 0);
      KeStallExecutionProcessor(0x64u);
    }
    if( !byte_140C49D08 )
    {
      LODWORD(Protection) = 4;
      v4 = HalpMap(0i64, MmCached, MmCached, 0, Protection);
      if( v4 )
        *(_WORD *)(v4 + 1138) = 4660;
    }
    if( (HalpPlatformFlags & 4) != 0 )
    {
      __outbyte(0x70u, 0x15u);
      KeStallExecutionProcessor(1u);
    }
    if( byte_140C4A0F8 )
      __writemsr(0x40000003u, 1ui64);
    if( *(&CmpDummyThreadEvent + 5376) )
    {
      HalpAcpiPmRegisterWrite(PM_RESET_REGISTER, 0i64, &Fadt.reset_val, 1ui64, 0i64);
      KeStallExecutionProcessor(0x1F4u);
    }
    if( (HalpPlatformFlags & 2) != 0 )
    {
      __outbyte(0x64u, 0xFEu);
      KeStallExecutionProcessor(0x1388u);
    }
    if( byte_140C49D08 )
    {
      HalEfiResetSystem(1i64);
      HalEfiResetSystem(0i64);
      __debugbreak();
    }
  }
  if( ProcessorsStarted )
    _InterlockedDecrement((volatile signed __int32 *)ProcessorsStarted);
  __halt();
}

Referenced by:

HalReturnToFirmware
HalpInterruptResetAllProcessors
HalpInterruptResetThisProcessor