Newer
Older
AMI-Aptio-BIOS-Reversed / EarlyVideoPei / PciRegReadModify.c
@Ajax Dong Ajax Dong 2 days ago 552 bytes Init
BOOL __thiscall PciRegReadModify(int *this)
{
  int v2; // ecx
  int v3; // ecx
  int v4; // esi
  int v5; // eax
  int v6; // edx

  PciRegWrite(*this, 510525552, 0);
  PciRegWrite(v2, 510525552, 193);
  v4 = 0;
  while ( 1 )
  {
    v5 = PciRegRead(v3, 510525552) & 0x3000;
    if ( (v5 & 0x2000) != 0 )
      break;
    if ( (unsigned int)++v4 > 0x4C4B40 )
    {
      PciRegWrite(v3, v6, 0);
      return 0;
    }
    if ( v5 )
    {
      PciRegWrite(v3, v6, 0);
      return (unsigned __int16)PciRegWriteViaBar(this) != 0;
    }
  }
  return 0;
}