2 Internal include file for the CPU I/O 2 Protocol implementation.
4 Copyright (c) 2009, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include <Protocol/CpuIo2.h>
20 #include <Library/DebugLib.h>
21 #include <Library/IoLib.h>
22 #include <Library/UefiDriverEntryPoint.h>
23 #include <Library/UefiBootServicesTableLib.h>
25 #define IA32_MAX_IO_ADDRESS 0xFFFF
30 UINT16
volatile *Ui16
;
31 UINT32
volatile *Ui32
;
32 UINT64
volatile *Ui64
;
37 Enables a driver to read memory-mapped registers in the PI System memory space.
39 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance.
40 @param[in] Width Signifies the width of the memory operation.
41 @param[in] Address The base address of the memory operation.
42 @param[in] Count The number of memory operations to perform. The number of bytes moved
43 is Width size * Count, starting at Address.
44 @param[out] Buffer The destination buffer to store the results.
46 @retval EFI_SUCCESS The data was read from or written to the EFI system.
47 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. Or Buffer is NULL.
48 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.
49 Or,The address range specified by Address, Width, and Count is not valid for this EFI system.
54 CpuMemoryServiceRead (
55 IN EFI_CPU_IO2_PROTOCOL
*This
,
56 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
63 Enables a driver to write memory-mapped registers in the PI System memory space.
65 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance.
66 @param[in] Width Signifies the width of the memory operation.
67 @param[in] Address The base address of the memory operation.
68 @param[in] Count The number of memory operations to perform. The number of bytes moved
69 is Width size * Count, starting at Address.
70 @param[in] Buffer The source buffer from which to write data.
72 @retval EFI_SUCCESS The data was read from or written to the EFI system.
73 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. Or Buffer is NULL.
74 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.
75 Or,The address range specified by Address, Width, and Count is not valid for this EFI system.
80 CpuMemoryServiceWrite (
81 IN EFI_CPU_IO2_PROTOCOL
*This
,
82 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
89 Enables a driver to read registers in the PI CPU I/O space.
91 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance.
92 @param[in] Width Signifies the width of the I/O operation.
93 @param[in] UserAddress The base address of the I/O operation. The caller is responsible
94 for aligning the Address if required.
95 @param[in] Count The number of I/O operations to perform. The number of bytes moved
96 is Width size * Count, starting at Address.
97 @param[out] UserBuffer The destination buffer to store the results.
99 @retval EFI_SUCCESS The data was read from or written to the EFI system.
100 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. Or Buffer is NULL.
101 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.
102 Or,The address range specified by Address, Width, and Count is not valid for this EFI system.
108 IN EFI_CPU_IO2_PROTOCOL
*This
,
109 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
110 IN UINT64 UserAddress
,
116 Enables a driver to write registers in the PI CPU I/O space.
118 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance.
119 @param[in] Width Signifies the width of the I/O operation.
120 @param[in] UserAddress The base address of the I/O operation. The caller is responsible
121 for aligning the Address if required.
122 @param[in] Count The number of I/O operations to perform. The number of bytes moved
123 is Width size * Count, starting at Address.
124 @param[in] UserBuffer The source buffer from which to write data.
126 @retval EFI_SUCCESS The data was read from or written to the EFI system.
127 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. Or Buffer is NULL.
128 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.
129 Or,The address range specified by Address, Width, and Count is not valid for this EFI system.
135 IN EFI_CPU_IO2_PROTOCOL
*This
,
136 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
137 IN UINT64 UserAddress
,