]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkPkg/Include/Protocol/CpuIo.h
Update for NetworkPkg.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / CpuIo.h
index 38f910ea94a71a4e7ecdf1815046d63147774b5f..ec75da09fdbcf0f491184d0405d9d9df443a8dcc 100644 (file)
 /** @file\r
-  This code abstracts the CPU IO Protocol\r
-\r
-  Copyright (c) 2007, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  CpuIO.h\r
+  This code abstracts the CPU IO Protocol which installed by some platform or chipset-specific \r
+  PEIM that abstracts the processor-visible I/O operations. \r
+  \r
+  Note: This is a runtime protocol and can be used by runtime drivers after ExitBootServices().\r
+  It is different from the PI 1.2 CPU I/O 2 Protocol, which is a boot services only protocol\r
+  and may not be used by runtime drivers after ExitBootServices().\r
+\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.                                          \r
+    \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
   @par Revision Reference:\r
   CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec\r
-  Version 0.9\r
+  Version 0.9.\r
 \r
 **/\r
 \r
 #ifndef _CPUIO_H_\r
 #define _CPUIO_H_\r
 \r
+#include <Protocol/CpuIo2.h>\r
+\r
 #define EFI_CPU_IO_PROTOCOL_GUID \\r
   { \\r
     0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \\r
   }\r
 \r
-typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL;\r
-\r
-//\r
-// *******************************************************\r
-// EFI_CPU_IO_PROTOCOL_WIDTH\r
-// *******************************************************\r
 //\r
-typedef enum {\r
-  EfiCpuIoWidthUint8,\r
-  EfiCpuIoWidthUint16,\r
-  EfiCpuIoWidthUint32,\r
-  EfiCpuIoWidthUint64,\r
-  EfiCpuIoWidthFifoUint8,\r
-  EfiCpuIoWidthFifoUint16,\r
-  EfiCpuIoWidthFifoUint32,\r
-  EfiCpuIoWidthFifoUint64,\r
-  EfiCpuIoWidthFillUint8,\r
-  EfiCpuIoWidthFillUint16,\r
-  EfiCpuIoWidthFillUint32,\r
-  EfiCpuIoWidthFillUint64,\r
-  EfiCpuIoWidthMaximum\r
-} EFI_CPU_IO_PROTOCOL_WIDTH;\r
-\r
-//\r
-// *******************************************************\r
-// EFI_CPU_IO_PROTOCOL_IO_MEM\r
-// *******************************************************\r
-//\r
-/**\r
-  Enables a driver to access memory-mapped registers in the EFI system memory space.\r
-  Or, Enables a driver to access registers in the EFI CPU I/O space.\r
-\r
-  @param  This                  A pointer to the EFI_CPU_IO_PROTOCOL instance.\r
-  @param  Width                 Signifies the width of the I/O or Memory operation.\r
-  @param  Address               The base address of the I/O or Memoryoperation.\r
-  @param  Count                 The number of I/O or Memory operations to perform.\r
-                                The number of bytes moved is Width size * Count, starting at Address.\r
-  @param  Buffer                For read operations, the destination buffer to store the results.\r
-                                For write operations, the source buffer from which to write data.\r
-\r
-  @retval EFI_SUCCESS           The data was read from or written to the EFI system.\r
-  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r
-  @retval EFI_UNSUPPORTED       The Buffer is not aligned for the given Width.\r
-                                Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM) (\r
-  IN EFI_CPU_IO_PROTOCOL                *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  );\r
-\r
-//\r
-// *******************************************************\r
-// EFI_CPU_IO_PROTOCOL_ACCESS\r
-// *******************************************************\r
-//\r
-typedef struct {\r
-  EFI_CPU_IO_PROTOCOL_IO_MEM  Read;\r
-  EFI_CPU_IO_PROTOCOL_IO_MEM  Write;\r
-} EFI_CPU_IO_PROTOCOL_ACCESS;\r
-\r
-//\r
-// *******************************************************\r
-// EFI_CPU_IO_PROTOCOL\r
-// *******************************************************\r
-//\r
-/**\r
-  @par Protocol Description:\r
-  Provides the basic memory and I/O interfaces that are used to abstract\r
-  accesses to devices in a system.\r
-\r
-  @param Mem.Read\r
-  Allows reads from memory-mapped I/O space.\r
-\r
-  @param Mem.Write\r
-  Allows writes to memory-mapped I/O space.\r
-\r
-  @param Io.Read\r
-  Allows reads from I/O space.\r
-\r
-  @param Io.Write\r
-  Allows writes to I/O space.\r
-\r
-**/\r
-struct _EFI_CPU_IO_PROTOCOL {\r
-  EFI_CPU_IO_PROTOCOL_ACCESS  Mem;\r
-  EFI_CPU_IO_PROTOCOL_ACCESS  Io;\r
-};\r
+// Framework CPU IO protocol structure is the same as CPU IO 2 protocol defined in PI 1.2 spec. \r
+// However, there is a significant different between the Framework CPU I/O\r
+// Protocol and the PI 1.2 CPU I/O 2 Protocol.  The Framework one is a runtime\r
+// protocol, which means it can be used by runtime drivers after ExitBootServices().\r
+// The PI one is not runtime safe, so it is a boot services only protocol and may\r
+// not be used by runtime drivers after ExitBootServices().\r
+// \r
+typedef EFI_CPU_IO2_PROTOCOL EFI_CPU_IO_PROTOCOL;\r
 \r
 extern EFI_GUID gEfiCpuIoProtocolGuid;\r
 \r