00001 /** @file 00002 This code abstracts the CPU IO Protocol which installed by some platform or chipset-specific 00003 PEIM that abstracts the processor-visible I/O operations. 00004 00005 Copyright (c) 2007, Intel Corporation 00006 All rights reserved. This program and the accompanying materials 00007 are licensed and made available under the terms and conditions of the BSD License 00008 which accompanies this distribution. The full text of the license may be found at 00009 http://opensource.org/licenses/bsd-license.php 00010 00011 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 00012 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 00013 00014 Module Name: CpuIO.h 00015 00016 @par Revision Reference: 00017 CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec 00018 Version 0.9 00019 00020 **/ 00021 00022 #ifndef _CPUIO_H_ 00023 #define _CPUIO_H_ 00024 00025 #include <gpxe/efi/PiDxe.h> 00026 00027 #define EFI_CPU_IO_PROTOCOL_GUID \ 00028 { \ 00029 0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \ 00030 } 00031 00032 typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL; 00033 00034 // 00035 // ******************************************************* 00036 // EFI_CPU_IO_PROTOCOL_WIDTH 00037 // ******************************************************* 00038 // 00039 typedef enum { 00040 EfiCpuIoWidthUint8, 00041 EfiCpuIoWidthUint16, 00042 EfiCpuIoWidthUint32, 00043 EfiCpuIoWidthUint64, 00044 EfiCpuIoWidthFifoUint8, 00045 EfiCpuIoWidthFifoUint16, 00046 EfiCpuIoWidthFifoUint32, 00047 EfiCpuIoWidthFifoUint64, 00048 EfiCpuIoWidthFillUint8, 00049 EfiCpuIoWidthFillUint16, 00050 EfiCpuIoWidthFillUint32, 00051 EfiCpuIoWidthFillUint64, 00052 EfiCpuIoWidthMaximum 00053 } EFI_CPU_IO_PROTOCOL_WIDTH; 00054 00055 // 00056 // ******************************************************* 00057 // EFI_CPU_IO_PROTOCOL_IO_MEM 00058 // ******************************************************* 00059 // 00060 /** 00061 Enables a driver to access memory-mapped registers in the EFI system memory space. 00062 Or, Enables a driver to access registers in the EFI CPU I/O space. 00063 00064 @param This A pointer to the EFI_CPU_IO_PROTOCOL instance. 00065 @param Width Signifies the width of the I/O or Memory operation. 00066 @param Address The base address of the I/O or Memoryoperation. 00067 @param Count The number of I/O or Memory operations to perform. 00068 The number of bytes moved is Width size * Count, starting at Address. 00069 @param Buffer For read operations, the destination buffer to store the results. 00070 For write operations, the source buffer from which to write data. 00071 00072 @retval EFI_SUCCESS The data was read from or written to the EFI system. 00073 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL. 00074 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 00075 Or,The address range specified by Address, Width, and Count is not valid for this EFI system. 00076 00077 **/ 00078 typedef 00079 EFI_STATUS 00080 (EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM)( 00081 IN EFI_CPU_IO_PROTOCOL *This, 00082 IN EFI_CPU_IO_PROTOCOL_WIDTH Width, 00083 IN UINT64 Address, 00084 IN UINTN Count, 00085 IN OUT VOID *Buffer 00086 ); 00087 00088 // 00089 // ******************************************************* 00090 // EFI_CPU_IO_PROTOCOL_ACCESS 00091 // ******************************************************* 00092 // 00093 typedef struct { 00094 EFI_CPU_IO_PROTOCOL_IO_MEM Read; 00095 EFI_CPU_IO_PROTOCOL_IO_MEM Write; 00096 } EFI_CPU_IO_PROTOCOL_ACCESS; 00097 00098 // 00099 // ******************************************************* 00100 // EFI_CPU_IO_PROTOCOL 00101 // ******************************************************* 00102 // 00103 /** 00104 @par Protocol Description: 00105 Provides the basic memory and I/O interfaces that are used to abstract 00106 accesses to devices in a system. 00107 00108 @param Mem.Read 00109 Allows reads from memory-mapped I/O space. 00110 00111 @param Mem.Write 00112 Allows writes to memory-mapped I/O space. 00113 00114 @param Io.Read 00115 Allows reads from I/O space. 00116 00117 @param Io.Write 00118 Allows writes to I/O space. 00119 00120 **/ 00121 struct _EFI_CPU_IO_PROTOCOL { 00122 EFI_CPU_IO_PROTOCOL_ACCESS Mem; 00123 EFI_CPU_IO_PROTOCOL_ACCESS Io; 00124 }; 00125 00126 extern EFI_GUID gEfiCpuIoProtocolGuid; 00127 00128 #endif
1.5.7.1