/** @file CpuIoPei.h -- Header for CpuIoPei Copyright (c) HR650X BIOS Decompilation Project **/ #ifndef __CPUIOPEI_H__ #define __CPUIOPEI_H__ #include "../uefi_headers/Uefi.h" // // Function Prototypes // EFI_STATUS EFIAPI CmosCheckMode( VOID ); EFI_STATUS EFIAPI GetPeiServicesTable( VOID ); EFI_STATUS EFIAPI GetDebugInstance( VOID ); EFI_STATUS EFIAPI CpuIoPeiEntryPoint( VOID ); EFI_STATUS EFIAPI helper: memset via compiler intrinsic( VOID ); EFI_STATUS EFIAPI *__cdecl SetMem(void *buf, unsigned int count, char value)( VOID ); EFI_STATUS EFIAPI helper: memset32 via compiler intrinsic( VOID ); EFI_STATUS EFIAPI *__cdecl SetMem32(void *buf, unsigned int count, int value)( VOID ); EFI_STATUS EFIAPI helper: memset32 for 2-dword fill pattern( VOID ); EFI_STATUS EFIAPI __cdecl SetMem32Fill(int Buf, int Count, int Fill0, int Fill1)( VOID ); EFI_STATUS EFIAPI helper: memcpy with overlap handling( VOID ); EFI_STATUS EFIAPI *__cdecl CopyMem(char *dst, char *src, unsigned int count)( VOID ); EFI_STATUS EFIAPI overlap: copy dword-aligned first, then remainder( VOID ); EFI_STATUS EFIAPI __cdecl IoReadBufferFx(unsigned __int16 Port, unsigned int Count, unsigned __int8 *Buffer)( VOID ); EFI_STATUS EFIAPI __cdecl IoReadPortWordString(unsigned __int16 Port, unsigned int Count, unsigned __int16 *Buffer)( VOID ); EFI_STATUS EFIAPI __cdecl IoReadPortDwordString(unsigned __int16 Port, unsigned int Count, unsigned int *Buffer)( VOID ); EFI_STATUS EFIAPI __cdecl IoWriteBufferByte(unsigned __int16 Port, unsigned int Count, unsigned __int8 *Buffer)( VOID ); EFI_STATUS EFIAPI __cdecl IoWritePortWordString(unsigned __int16 Port, unsigned int Count, unsigned __int16 *Buffer)( VOID ); EFI_STATUS EFIAPI __cdecl IoWritePortDwordString(unsigned __int16 Port, unsigned int Count, unsigned int *Buffer)( VOID ); EFI_STATUS EFIAPI __fastcall IoReadPortWord(unsigned __int16 Port)( VOID ); EFI_STATUS EFIAPI __int16 __fastcall IoWritePortWord(unsigned __int16 Port, unsigned __int16 Value)( VOID ); EFI_STATUS EFIAPI __int32 __fastcall IoReadPortDword(unsigned __int16 Port)( VOID ); EFI_STATUS EFIAPI int __fastcall IoWritePortDword(unsigned __int16 Port, unsigned int Value)( VOID ); EFI_STATUS EFIAPI Read - Word (aligned)( VOID ); EFI_STATUS EFIAPI __fastcall IoReadMmioWord(unsigned __int16 *Address)( VOID ); EFI_STATUS EFIAPI Write - Word (aligned)( VOID ); EFI_STATUS EFIAPI __fastcall IoWriteMmioWord(_WORD *Address, __int16 Value)( VOID ); EFI_STATUS EFIAPI Read - Qword (aligned)( VOID ); EFI_STATUS EFIAPI __fastcall IoReadMmioQword(void *Address)( VOID ); EFI_STATUS EFIAPI Write - Qword (aligned)( VOID ); EFI_STATUS EFIAPI __cdecl IoWriteMmioQword(void *Address, int Lo32, int Hi32)( VOID ); EFI_STATUS EFIAPI Read - 16-bit( VOID ); EFI_STATUS EFIAPI __thiscall ReadUnaligned16(void *Buffer)( VOID ); EFI_STATUS EFIAPI Write - 16-bit( VOID ); EFI_STATUS EFIAPI __fastcall WriteUnaligned16(_WORD *Buffer, __int16 Value)( VOID ); EFI_STATUS EFIAPI Read - 32-bit( VOID ); EFI_STATUS EFIAPI __thiscall ReadUnaligned32(void *Buffer)( VOID ); EFI_STATUS EFIAPI Write - 32-bit( VOID ); EFI_STATUS EFIAPI __fastcall WriteUnaligned32(_DWORD *Buffer, int Value)( VOID ); EFI_STATUS EFIAPI Read - 64-bit( VOID ); EFI_STATUS EFIAPI __thiscall ReadUnaligned64(void *Buffer)( VOID ); EFI_STATUS EFIAPI Write - 64-bit( VOID ); EFI_STATUS EFIAPI __cdecl WriteUnaligned64(_DWORD *Buffer, int Lo32, int Hi32)( VOID ); EFI_STATUS EFIAPI __cdecl LShiftU64(__int64 Value)( VOID ); EFI_STATUS EFIAPI __int64 __cdecl RShiftU64(unsigned __int64 Value)( VOID ); EFI_STATUS EFIAPI Check Mode: determine debug printing capabilities( VOID ); EFI_STATUS EFIAPI RTC register 0x4A to read the debug mode.( VOID ); EFI_STATUS EFIAPI 0 (no debug), negative error codes, or status.( VOID ); EFI_STATUS EFIAPI CmosCheckMode()( VOID ); EFI_STATUS EFIAPI PEI Services Table Pointer( VOID ); EFI_STATUS EFIAPI via IDT entry at offset -4 from IDT base.( VOID ); EFI_STATUS EFIAPI GetPeiServicesTable()( VOID ); EFI_STATUS EFIAPI IDTR (SIDT instruction)( VOID ); EFI_STATUS EFIAPI *__thiscall ReadIdtr(void *Idtr)( VOID ); EFI_STATUS EFIAPI Debug Instance from PEI Services( VOID ); EFI_STATUS EFIAPI the gEfiPeiDebug2PpiGuid PPI.( VOID ); EFI_STATUS EFIAPI GetDebugInstance()( VOID ); EFI_STATUS EFIAPI Print (conditional on error level via CmosCheckMode)( VOID ); EFI_STATUS EFIAPI __cdecl DebugPrint(int ErrorLevel, const char *Format, ...)( VOID ); EFI_STATUS EFIAPI Assert (via debug instance)( VOID ); EFI_STATUS EFIAPI __fastcall DebugAssert(( VOID ); EFI_STATUS EFIAPI Entry Point( VOID ); EFI_STATUS EFIAPI the CPU I/O PPI (EFI_PEI_CPU_IO_PPI) into the PEI database.( VOID ); EFI_STATUS EFIAPI first invocation: installs via InstallPpi.( VOID ); EFI_STATUS EFIAPI shadow (reload after memory): RegisterForShadow only.( VOID ); EFI_STATUS EFIAPI EFIAPI( VOID ); EFI_STATUS EFIAPI detects if this is first-time or reinstall( VOID ); EFI_STATUS EFIAPI install: install the CPU I/O PPI descriptor( VOID ); #endif /* __CPUIOPEI_H__ */