Newer
Older
AMI-Aptio-BIOS-Reversed / CpuIoPei / CpuIoPei.md
@Ajax Dong Ajax Dong 2 days ago 4 KB Init

CpuIoPei

Function Table

Address Name Description
CmosCheckMode
GetPeiServicesTable
GetDebugInstance
CpuIoPeiEntryPoint
Library helper: memset via compiler intrinsic
void __cdecl SetMem(void buf, unsigned int count, char value)
Library helper: memset32 via compiler intrinsic
void __cdecl SetMem32(void buf, unsigned int count, int value)
Library helper: memset32 for 2-dword fill pattern
int __cdecl SetMem32Fill(int Buf, int Count, int Fill0, int Fill1)
Library helper: memcpy with overlap handling
char __cdecl CopyMem(char dst, char *src, unsigned int count)
No overlap: copy dword-aligned first, then remainder
__int64 cdecl IoReadBufferFx(unsigned int16 Port, unsigned int Count, unsigned __int8 *Buffer)
__int64 cdecl IoReadPortWordString(unsigned int16 Port, unsigned int Count, unsigned __int16 *Buffer)
__int64 cdecl IoReadPortDwordString(unsigned int16 Port, unsigned int Count, unsigned int *Buffer)
__int64 cdecl IoWriteBufferByte(unsigned int16 Port, unsigned int Count, unsigned __int8 *Buffer)
__int64 cdecl IoWritePortWordString(unsigned int16 Port, unsigned int Count, unsigned __int16 *Buffer)
__int64 cdecl IoWritePortDwordString(unsigned int16 Port, unsigned int Count, unsigned int *Buffer)
int fastcall IoReadPortWord(unsigned int16 Port)
unsigned int16 fastcall IoWritePortWord(unsigned int16 Port, unsigned int16 Value)
unsigned int32 fastcall IoReadPortDword(unsigned __int16 Port)
unsigned int fastcall IoWritePortDword(unsigned int16 Port, unsigned int Value)
MMIO Read - Word (aligned)
int fastcall IoReadMmioWord(unsigned int16 *Address)
MMIO Write - Word (aligned)
__int16 fastcall IoWriteMmioWord(_WORD *Address, int16 Value)
MMIO Read - Qword (aligned)
__int64 __fastcall IoReadMmioQword(void *Address)
MMIO Write - Qword (aligned)
int __cdecl IoWriteMmioQword(void *Address, int Lo32, int Hi32)
Unaligned Read - 16-bit
__int16 __thiscall ReadUnaligned16(void *Buffer)
Unaligned Write - 16-bit
__int16 fastcall WriteUnaligned16(_WORD *Buffer, int16 Value)
Unaligned Read - 32-bit
int __thiscall ReadUnaligned32(void *Buffer)
Unaligned Write - 32-bit
int __fastcall WriteUnaligned32(_DWORD *Buffer, int Value)
Unaligned Read - 64-bit
__int64 __thiscall ReadUnaligned64(void *Buffer)
Unaligned Write - 64-bit
int __cdecl WriteUnaligned64(_DWORD *Buffer, int Lo32, int Hi32)
__int64 cdecl LShiftU64(int64 Value)
unsigned int64 cdecl RShiftU64(unsigned __int64 Value)
CMOS Check Mode: determine debug printing capabilities
Selects RTC register 0x4A to read the debug mode.
Returns 0 (no debug), negative error codes, or status.
int CmosCheckMode()
Get PEI Services Table Pointer
Retrieves via IDT entry at offset -4 from IDT base.
int GetPeiServicesTable()
Read IDTR (SIDT instruction)
void __thiscall ReadIdtr(void Idtr)
Get Debug Instance from PEI Services
Locates the gEfiPeiDebug2PpiGuid PPI.
int GetDebugInstance()
Debug Print (conditional on error level via CmosCheckMode)
int __cdecl DebugPrint(int ErrorLevel, const char *Format, ...)
Debug Assert (via debug instance)
int __fastcall DebugAssert(
CpuIoPei Entry Point
Installs the CPU I/O PPI (EFI_PEI_CPU_IO_PPI) into the PEI database.
On first invocation: installs via InstallPpi.
On shadow (reload after memory): RegisterForShadow only.
EFI_STATUS EFIAPI
RegisterForShadow detects if this is first-time or reinstall
First install: install the CPU I/O PPI descriptor

Generated by HR650X BIOS Decompilation Project