]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/CpuIo.h
Add more comments for IntelFramework's header files.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / CpuIo.h
CommitLineData
79964ac8 1/** @file\r
8411f1c0 2 This code abstracts the CPU IO Protocol which installed by some platform or chipset-specific \r
3 PEIM that abstracts the processor-visible I/O operations.\r
79964ac8 4\r
5 Copyright (c) 2007, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14 Module Name: CpuIO.h\r
15\r
16 @par Revision Reference:\r
17 CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec\r
18 Version 0.9\r
19\r
20**/\r
21\r
22#ifndef _CPUIO_H_\r
23#define _CPUIO_H_\r
24\r
b80fbe85 25#include <PiDxe.h>\r
26\r
79964ac8 27#define EFI_CPU_IO_PROTOCOL_GUID \\r
28 { \\r
29 0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \\r
30 }\r
31\r
32typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL;\r
33\r
34//\r
35// *******************************************************\r
36// EFI_CPU_IO_PROTOCOL_WIDTH\r
37// *******************************************************\r
38//\r
39typedef enum {\r
40 EfiCpuIoWidthUint8,\r
41 EfiCpuIoWidthUint16,\r
42 EfiCpuIoWidthUint32,\r
43 EfiCpuIoWidthUint64,\r
44 EfiCpuIoWidthFifoUint8,\r
45 EfiCpuIoWidthFifoUint16,\r
46 EfiCpuIoWidthFifoUint32,\r
47 EfiCpuIoWidthFifoUint64,\r
48 EfiCpuIoWidthFillUint8,\r
49 EfiCpuIoWidthFillUint16,\r
50 EfiCpuIoWidthFillUint32,\r
51 EfiCpuIoWidthFillUint64,\r
52 EfiCpuIoWidthMaximum\r
53} EFI_CPU_IO_PROTOCOL_WIDTH;\r
54\r
55//\r
56// *******************************************************\r
57// EFI_CPU_IO_PROTOCOL_IO_MEM\r
58// *******************************************************\r
59//\r
60/**\r
61 Enables a driver to access memory-mapped registers in the EFI system memory space.\r
62 Or, Enables a driver to access registers in the EFI CPU I/O space.\r
63\r
64 @param This A pointer to the EFI_CPU_IO_PROTOCOL instance.\r
65 @param Width Signifies the width of the I/O or Memory operation.\r
66 @param Address The base address of the I/O or Memoryoperation.\r
67 @param Count The number of I/O or Memory operations to perform.\r
68 The number of bytes moved is Width size * Count, starting at Address.\r
69 @param Buffer For read operations, the destination buffer to store the results.\r
70 For write operations, the source buffer from which to write data.\r
71\r
72 @retval EFI_SUCCESS The data was read from or written to the EFI system.\r
73 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r
74 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.\r
75 Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r
76\r
77**/\r
78typedef\r
79EFI_STATUS\r
80(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM) (\r
81 IN EFI_CPU_IO_PROTOCOL *This,\r
82 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
83 IN UINT64 Address,\r
84 IN UINTN Count,\r
85 IN OUT VOID *Buffer\r
86 );\r
87\r
88//\r
89// *******************************************************\r
90// EFI_CPU_IO_PROTOCOL_ACCESS\r
91// *******************************************************\r
92//\r
93typedef struct {\r
94 EFI_CPU_IO_PROTOCOL_IO_MEM Read;\r
95 EFI_CPU_IO_PROTOCOL_IO_MEM Write;\r
96} EFI_CPU_IO_PROTOCOL_ACCESS;\r
97\r
98//\r
99// *******************************************************\r
100// EFI_CPU_IO_PROTOCOL\r
101// *******************************************************\r
102//\r
103/**\r
104 @par Protocol Description:\r
105 Provides the basic memory and I/O interfaces that are used to abstract\r
106 accesses to devices in a system.\r
107\r
108 @param Mem.Read\r
109 Allows reads from memory-mapped I/O space.\r
110\r
111 @param Mem.Write\r
112 Allows writes to memory-mapped I/O space.\r
113\r
114 @param Io.Read\r
115 Allows reads from I/O space.\r
116\r
117 @param Io.Write\r
118 Allows writes to I/O space.\r
119\r
120**/\r
121struct _EFI_CPU_IO_PROTOCOL {\r
122 EFI_CPU_IO_PROTOCOL_ACCESS Mem;\r
123 EFI_CPU_IO_PROTOCOL_ACCESS Io;\r
124};\r
125\r
126extern EFI_GUID gEfiCpuIoProtocolGuid;\r
127\r
128#endif\r