Newer
Older
AMI-Aptio-BIOS-Reversed / AmiModulePkg / GenericSio / SioDxeInit / SioDxeInit.h
/** @file
  SioDxeInit.h
**/

#ifndef __SIODXEINIT_H__
#define __SIODXEINIT_H__

#include "../uefi_headers/Uefi.h"

extern EFI_SYSTEM_TABLE        *gST;
extern EFI_BOOT_SERVICES       *gBS;
extern EFI_RUNTIME_SERVICES    *gRT;
extern EFI_HANDLE               gImageHandle;
extern EFI_DXE_SERVICES        *gDS;
extern VOID                    *mHobList;
extern MM_PCI_USRA_PROTOCOL    *mPciUsra;
extern PCD_PROTOCOL            *mPcd;
extern EFI_HANDLE               mDriverHandle;
extern SIO_DXE_INIT_PROTOCOL    mSioDxeInitProtocol;
extern UINT32                   mPchSkuType;
extern VOID                    *mDebugLib;

EFI_STATUS
EFIAPI
SioDeviceInit (
  IN SIO_DXE_INIT_PROTOCOL  *This,
  IN UINT16                  DeviceType,
  IN UINT16                  IoBase,
  IN UINT8                   IrqNumber,
  IN UINT8                   DmaChannel
  );

VOID
EFIAPI
EnableInterrupts (
  VOID
  );

VOID
EFIAPI
DisableInterrupts (
  VOID
  );

UINTN
EFIAPI
ReadEflags (
  VOID
  );

BOOLEAN
EFIAPI
IsInterruptsEnabled (
  VOID
  );

UINT16
EFIAPI
IoRead16 (
  IN UINT16  Port
  );

UINT16
EFIAPI
IoWrite16 (
  IN UINT16  Port,
  IN UINT16  Value
  );

UINT16
EFIAPI
IoRead16Alt (
  IN UINT16  Port
  );

UINT16
EFIAPI
IoWrite16Alt (
  IN UINT16  Port,
  IN UINT16  Value
  );

UINT32
EFIAPI
IoRead32 (
  IN UINT16  Port
  );

UINT32
EFIAPI
IoWrite32 (
  IN UINT16  Port,
  IN UINT32  Value
  );

UINT32
EFIAPI
PciRead32 (
  IN UINT64  PciAddress
  );

VOID
EFIAPI
PciWrite32 (
  IN UINT64  PciAddress,
  IN UINT32  Value
  );

UINT16
EFIAPI
PciRead16 (
  IN UINT64  PciAddress
  );

VOID
EFIAPI
PciWrite16 (
  IN UINT64  PciAddress,
  IN UINT16  Value
  );

VOID *
EFIAPI
InternalCopyMem (
  OUT VOID       *Destination,
  IN  CONST VOID *Source,
  IN  UINTN      Length
  );

VOID
EFIAPI
PchPcrWriteReg (
  IN UINT16  PcrAddress,
  IN UINT8   Size,
  IN UINT32  Value
  );

VOID
EFIAPI
PchDetectSku (
  VOID
  );

VOID *
EFIAPI
GetDebugLib (
  VOID
  );

VOID
EFIAPI
DebugPrint (
  IN UINTN        ErrorLevel,
  IN CONST CHAR8  *Format,
  ...
  );

VOID
EFIAPI
DebugAssert (
  IN CONST CHAR8  *FileName,
  IN UINTN        LineNumber,
  IN CONST CHAR8  *AssertString
  );

EFI_STATUS
EFIAPI
GetConfigTable (
  IN  EFI_GUID  *TableGuid,
  OUT VOID      **Table
  );

UINT64
EFIAPI
ReadUnaligned64 (
  IN  CONST VOID  *Buffer
  );

BOOLEAN
EFIAPI
CompareGuid (
  IN EFI_GUID  *Guid1,
  IN EFI_GUID  *Guid2
  );

VOID *
EFIAPI
GetHobList (
  VOID
  );

PCD_PROTOCOL *
EFIAPI
GetPcdProtocol (
  VOID
  );

UINT64
EFIAPI
SioMmioBase (
  VOID
  );

UINT32
EFIAPI
DebugGetLevel (
  VOID
  );

EFI_STATUS
EFIAPI
ConfigureLpcIoRange (
  IN UINT16  IoBase,
  IN UINT16  Size,
  IN UINT8   DeviceType
  );

EFI_STATUS
EFIAPI
SetLpcRegisterRaw (
  IN UINT64  PciCf8Address,
  IN UINT16  Register,
  IN UINT8   Size
  );

EFI_STATUS
EFIAPI
ConfigureLpcDecode (
  IN VOID    *SioProtocol,
  IN UINT16  IoConfig,
  IN UINT8   SubType,
  IN UINT8   DeviceType
  );

EFI_STATUS
EFIAPI
SioDxeInitPre (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  );

EFI_STATUS
EFIAPI
ModuleEntryPoint (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  );

EFI_STATUS
EFIAPI
SioDeviceRead (
  IN  SIO_DXE_INIT_PROTOCOL *This,
  IN  UINT16                DeviceType,
  OUT VOID                  *Config
  );

EFI_STATUS
EFIAPI
SioDeviceWrite (
  IN SIO_DXE_INIT_PROTOCOL  *This,
  IN UINT16                 DeviceType,
  IN VOID                   *Config
  );

EFI_STATUS
EFIAPI
SioDeviceRegister (
  IN SIO_DXE_INIT_PROTOCOL  *This,
  IN UINT16                 DeviceType
  );

EFI_STATUS
EFIAPI
SioDriverBindingStart (
  IN EFI_DRIVER_BINDING_PROTOCOL  *This,
  IN EFI_HANDLE                   ControllerHandle,
  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath
  );

#endif