]>
Commit | Line | Data |
---|---|---|
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 | |
b80fbe85 | 24 | #include <PiDxe.h>\r |
25 | \r | |
79964ac8 | 26 | #define EFI_CPU_IO_PROTOCOL_GUID \\r |
27 | { \\r | |
28 | 0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \\r | |
29 | }\r | |
30 | \r | |
31 | typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL;\r | |
32 | \r | |
33 | //\r | |
34 | // *******************************************************\r | |
35 | // EFI_CPU_IO_PROTOCOL_WIDTH\r | |
36 | // *******************************************************\r | |
37 | //\r | |
38 | typedef enum {\r | |
39 | EfiCpuIoWidthUint8,\r | |
40 | EfiCpuIoWidthUint16,\r | |
41 | EfiCpuIoWidthUint32,\r | |
42 | EfiCpuIoWidthUint64,\r | |
43 | EfiCpuIoWidthFifoUint8,\r | |
44 | EfiCpuIoWidthFifoUint16,\r | |
45 | EfiCpuIoWidthFifoUint32,\r | |
46 | EfiCpuIoWidthFifoUint64,\r | |
47 | EfiCpuIoWidthFillUint8,\r | |
48 | EfiCpuIoWidthFillUint16,\r | |
49 | EfiCpuIoWidthFillUint32,\r | |
50 | EfiCpuIoWidthFillUint64,\r | |
51 | EfiCpuIoWidthMaximum\r | |
52 | } EFI_CPU_IO_PROTOCOL_WIDTH;\r | |
53 | \r | |
54 | //\r | |
55 | // *******************************************************\r | |
56 | // EFI_CPU_IO_PROTOCOL_IO_MEM\r | |
57 | // *******************************************************\r | |
58 | //\r | |
59 | /**\r | |
60 | Enables a driver to access memory-mapped registers in the EFI system memory space.\r | |
61 | Or, Enables a driver to access registers in the EFI CPU I/O space.\r | |
62 | \r | |
63 | @param This A pointer to the EFI_CPU_IO_PROTOCOL instance.\r | |
64 | @param Width Signifies the width of the I/O or Memory operation.\r | |
65 | @param Address The base address of the I/O or Memoryoperation.\r | |
66 | @param Count The number of I/O or Memory operations to perform.\r | |
67 | The number of bytes moved is Width size * Count, starting at Address.\r | |
68 | @param Buffer For read operations, the destination buffer to store the results.\r | |
69 | For write operations, the source buffer from which to write data.\r | |
70 | \r | |
71 | @retval EFI_SUCCESS The data was read from or written to the EFI system.\r | |
72 | @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r | |
73 | @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.\r | |
74 | Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r | |
75 | \r | |
76 | **/\r | |
77 | typedef\r | |
78 | EFI_STATUS\r | |
79 | (EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM) (\r | |
80 | IN EFI_CPU_IO_PROTOCOL *This,\r | |
81 | IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r | |
82 | IN UINT64 Address,\r | |
83 | IN UINTN Count,\r | |
84 | IN OUT VOID *Buffer\r | |
85 | );\r | |
86 | \r | |
87 | //\r | |
88 | // *******************************************************\r | |
89 | // EFI_CPU_IO_PROTOCOL_ACCESS\r | |
90 | // *******************************************************\r | |
91 | //\r | |
92 | typedef struct {\r | |
93 | EFI_CPU_IO_PROTOCOL_IO_MEM Read;\r | |
94 | EFI_CPU_IO_PROTOCOL_IO_MEM Write;\r | |
95 | } EFI_CPU_IO_PROTOCOL_ACCESS;\r | |
96 | \r | |
97 | //\r | |
98 | // *******************************************************\r | |
99 | // EFI_CPU_IO_PROTOCOL\r | |
100 | // *******************************************************\r | |
101 | //\r | |
102 | /**\r | |
103 | @par Protocol Description:\r | |
104 | Provides the basic memory and I/O interfaces that are used to abstract\r | |
105 | accesses to devices in a system.\r | |
106 | \r | |
107 | @param Mem.Read\r | |
108 | Allows reads from memory-mapped I/O space.\r | |
109 | \r | |
110 | @param Mem.Write\r | |
111 | Allows writes to memory-mapped I/O space.\r | |
112 | \r | |
113 | @param Io.Read\r | |
114 | Allows reads from I/O space.\r | |
115 | \r | |
116 | @param Io.Write\r | |
117 | Allows writes to I/O space.\r | |
118 | \r | |
119 | **/\r | |
120 | struct _EFI_CPU_IO_PROTOCOL {\r | |
121 | EFI_CPU_IO_PROTOCOL_ACCESS Mem;\r | |
122 | EFI_CPU_IO_PROTOCOL_ACCESS Io;\r | |
123 | };\r | |
124 | \r | |
125 | extern EFI_GUID gEfiCpuIoProtocolGuid;\r | |
126 | \r | |
127 | #endif\r |