Newer
Older
AMI-Aptio-BIOS-Reversed / ServerCommonPkg / Universal / GetSec / Pei / TxtPei / CacheEnable.c
@Ajax Dong Ajax Dong 2 days ago 1 KB Restructure the repo
// Decompiled: 0xffe077aa
// Function: CacheEnable
// Module: TxtPei.efi (TXTPEI)

int __fastcall CacheEnable(unsigned int n0x100000)
{
  int v2; // eax
  int v3; // eax
  unsigned int v4; // esi

  if ( n0x100000 >= 0x100000 ) /*0xffe077ba*/
  {
    v2 = DebugPrintProtocol(); /*0xffe077bc*/
    if ( v2 ) /*0xffe077c3*/
      (*(void (__cdecl **)(const char *, int, const char *))(v2 + 4))( /*0xffe077d0*/
        "e:\\hs\\UefiCpuPkg\\Library\\BaseXApicX2ApicLib\\BaseXApicX2ApicLib.c",
        675,
        "StartupRoutine < 0x100000");
  }
  if ( (n0x100000 & 0xFFF) != 0 ) /*0xffe077dc*/
  {
    v3 = DebugPrintProtocol(); /*0xffe077de*/
    if ( v3 ) /*0xffe077e5*/
      (*(void (__cdecl **)(const char *, int, const char *))(v3 + 4))( /*0xffe077f2*/
        "e:\\hs\\UefiCpuPkg\\Library\\BaseXApicX2ApicLib\\BaseXApicX2ApicLib.c",
        676,
        "(StartupRoutine & 0xfff) == 0");
  }
  ApicWriteIcr(0xC4500u, 0); /*0xffe077ff*/
  IoRead32(0xAu); /*0xffe07807*/
  v4 = (n0x100000 & 0xFF000 | 0xC4600FFF) >> 12; /*0xffe0781a*/
  ApicWriteIcr(v4, 0); /*0xffe0781f*/
  IoRead32(0xC8u); /*0xffe07829*/
  return ApicWriteIcr(v4, 0); /*0xffe07837*/
}