/** @file AhciSmm.h -- Header for AhciSmm Copyright (c) HR650X BIOS Decompilation Project **/ #ifndef __AHCISMM_H__ #define __AHCISMM_H__ #include "../uefi_headers/Uefi.h" // // Recovered module globals from AhciSmm.md / README.md // extern EFI_HANDLE gImageHandle; // 0x2E80 extern EFI_SYSTEM_TABLE *gST; // 0x2E70 extern EFI_BOOT_SERVICES *gBS; // 0x2E78 extern EFI_RUNTIME_SERVICES *gRT; // 0x2E88 extern EFI_SMM_SYSTEM_TABLE2 *gSmst; // 0x2E90 extern VOID *mPcd; // 0x2EA0 extern VOID *gSmmCpuIo2Protocol; // 0x2EB0 extern UINT8 mSmmMode; // 0x2EB8 extern VOID *gSmmServicesTableBase2; // 0x2EE8 extern VOID *gSmmChildProtocol; // 0x2EC0 extern VOID *gDxeProtocol; // 0x2ED8 extern VOID *gSmiHandlerProtocol; // 0x2ED0 extern VOID *gDxeSmiHandlerProtocol; // 0x2EF0 extern UINT8 gSmmProtocolReady; // 0x2EC8 extern VOID *gBuf; // 0x2E68 extern UINT64 gAhciSavedPxClb; // 0x3010 extern UINT64 gAhciSavedPxFb; // 0x3018 extern UINTN gAhciReturnStatus; // 0x3008 extern UINT8 gPortCompletionInProgress; // 0x2E60 extern UINT8 gSoftResetInProgress; // 0x2E61 extern UINT32 gSmiCallbackHandle; // 0x3020 extern VOID *gAhciCommandTable; // 0x3028 extern VOID *gAhciReceiveArea; // 0x3030 extern VOID *gAhciCommandList; // 0x3038 // // Function Prototypes // /// /// _ModuleEntryPoint -- canonical module entry point /// EFI_STATUS EFIAPI _ModuleEntryPoint( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ); /// /// ModuleEntryPoint -- compatibility alias for entry point /// EFI_STATUS EFIAPI ModuleEntryPoint( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ); /// /// AhciSmmPreInit -- boot/runtime services initialization and context setup /// EFI_STATUS EFIAPI AhciSmmPreInit( VOID ); EFI_STATUS EFIAPI AhciSmmRegisterSmiHandlers( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ); // // Obvious name-to-address aliases (docs-derived) // #define qword_2E80 gImageHandle #define qword_2E70 gST #define qword_2E78 gBS #define qword_2E88 gRT #define qword_2E90 gSmst #define qword_2EA0 mPcd #define qword_2EB0 gSmmCpuIo2Protocol #define byte_2EB8 mSmmMode #define qword_2EE8 gSmmServicesTableBase2 #define qword_2EC0 gSmmChildProtocol #define qword_2ED8 gDxeProtocol #define qword_2ED0 gSmiHandlerProtocol #define qword_2EF0 gDxeSmiHandlerProtocol #define byte_2EC8 gSmmProtocolReady #define qword_2E68 gBuf #define qword_3010 gAhciSavedPxClb #define qword_3018 gAhciSavedPxFb #define qword_3008 gAhciReturnStatus #define byte_2E60 gPortCompletionInProgress #define byte_2E61 gSoftResetInProgress #define dword_3020 gSmiCallbackHandle #define qword_3028 gAhciCommandTable #define qword_3030 gAhciReceiveArea #define qword_3038 gAhciCommandList #define qword_3070 pAhciPortInitHandler #define qword_3078 pAhciDmaCommandHandler #define qword_3080 pAhciPioDataInHandler #define qword_3088 pAhciSoftwareResetHandler #define qword_3090 pAhciNonDataCommandHandler #define qword_3098 pAhciFisReceiveHandler #define qword_30A0 pAhciSoftResetHandler // Function-pointer aliases for SMI function dispatch. typedef EFI_STATUS (EFIAPI *AHCI_SMM_HANDLER)( IN VOID *Context, IN VOID *CommBuffer OPTIONAL, IN UINTN CommBufferSize, OUT VOID *Message OPTIONAL ); extern AHCI_SMM_HANDLER pAhciPortInitHandler; // 0x3070 extern AHCI_SMM_HANDLER pAhciDmaCommandHandler; // 0x3078 extern AHCI_SMM_HANDLER pAhciPioDataInHandler; // 0x3080 extern AHCI_SMM_HANDLER pAhciSoftwareResetHandler; // 0x3088 (AhciAtapiSoftwareResetHandler) extern AHCI_SMM_HANDLER pAhciNonDataCommandHandler; // 0x3090 (AhciAtaNonDataCommandHandler) extern AHCI_SMM_HANDLER pAhciFisReceiveHandler; // 0x3098 (AhciFisReceiveCompletionHandler) extern AHCI_SMM_HANDLER pAhciSoftResetHandler; // 0x30A0 (AhciPortSoftResetThunk) #endif /* __AHCISMM_H__ */