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