From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- Include/Protocol/DeviceIo.h | 169 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 Include/Protocol/DeviceIo.h (limited to 'Include/Protocol/DeviceIo.h') diff --git a/Include/Protocol/DeviceIo.h b/Include/Protocol/DeviceIo.h new file mode 100644 index 0000000..e1d42e8 --- /dev/null +++ b/Include/Protocol/DeviceIo.h @@ -0,0 +1,169 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DeviceIo.h 4 3/13/06 1:40a Felixp $ +// +// $Revision: 4 $ +// +// $Date: 3/13/06 1:40a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DeviceIo.h $ +// +// 4 3/13/06 1:40a Felixp +// +// 3 8/15/05 9:03a Andriyn +// +// 2 3/04/05 10:33a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 8/26/04 3:56p Markw +// +//***************************************************************************** +// +// +// Name: DeviceIo_h +// +// Description: This file is an include file used to define the Protocol for the +// DeviceIo Protocol. +// +// +//***************************************************************************** + +#ifndef __DEVICE_IO_PROTOCOL_H__ +#define __DEVICE_IO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include + +// af6ac311-84c3-11d2-8e3c-00a0c969723b } +#define DEVICE_IO_PROTOCOL \ + {0xaf6ac311,0x84c3,0x11d2,0x8e,0x3c,0x00,0xa0,0xc9,0x69,0x72,0x3b} + +typedef struct _EFI_DEVICE_IO_INTERFACE EFI_DEVICE_IO_INTERFACE; + +//******************************************************* +// EFI_IO_WIDTH +//******************************************************* +typedef enum { + IO_UINT8 = 0, + IO_UINT16 = 1, + IO_UINT32 = 2, + IO_UINT64 = 3 +} EFI_IO_WIDTH; + +//******************************************************* +// EFI_IO_OPERATION_TYPE +//******************************************************* +typedef enum { + EfiBusMasterRead, + EfiBusMasterWrite, + EfiBusMasterCommonBuffer +} EFI_IO_OPERATION_TYPE; + + +//******************************************************* +// EFI_DEVICE_IO +//******************************************************* +typedef EFI_STATUS (EFIAPI *EFI_DEVICE_IO) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN EFI_IO_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer +); +//******************************************************* +// EFI_IO_ACCESS +//******************************************************* +typedef struct { + EFI_DEVICE_IO Read; + EFI_DEVICE_IO Write; +} EFI_IO_ACCESS; + +typedef EFI_STATUS (EFIAPI *EFI_PCI_DEVICE_PATH) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN UINT64 PciAddress, + IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_MAP) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN EFI_IO_OPERATION_TYPE Operation, + IN EFI_PHYSICAL_ADDRESS *HostAddress, + IN OUT UINTN *NumberOfBytes, + OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, + OUT VOID **Mapping +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_UNMAP) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN VOID *Mapping +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_ALLOCATE_BUFFER) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + IN OUT EFI_PHYSICAL_ADDRESS *HostAddress +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_FLUSH) ( + IN EFI_DEVICE_IO_INTERFACE *This +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_FREE_BUFFER) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN UINTN Pages, + IN EFI_PHYSICAL_ADDRESS HostAddress +); + +struct _EFI_DEVICE_IO_INTERFACE { + EFI_IO_ACCESS Mem; + EFI_IO_ACCESS Io; + EFI_IO_ACCESS Pci; + EFI_IO_MAP Map; + EFI_PCI_DEVICE_PATH PciDevicePath; + EFI_IO_UNMAP Unmap; + EFI_IO_ALLOCATE_BUFFER AllocateBuffer; + EFI_IO_FLUSH Flush; + EFI_IO_FREE_BUFFER FreeBuffer; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** -- cgit v1.2.3