--*/\r
\r
#include "CpuIo.h"\r
-#include "CpuIoAccess.h"\r
\r
#define IA32_MAX_IO_ADDRESS 0xFFFF\r
\r
}\r
};\r
\r
-STATIC\r
EFI_STATUS\r
CpuIoMemRW (\r
IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
UINTN DestinationStride;\r
UINTN SourceStride;\r
\r
- Width = Width & 0x03;\r
+ Width = (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03);\r
Stride = (UINTN)1 << Width;\r
DestinationStride = DestinationStrideFlag ? Stride : 0;\r
SourceStride = SourceStrideFlag ? Stride : 0;\r
PTR Destination;\r
EFI_STATUS Status;\r
\r
- Status = CpuIoCheckParameter (Width, Address, Count, Buffer, EFI_MAX_ADDRESS);\r
+ Status = CpuIoCheckParameter (Width, Address, Count, Buffer, MAX_ADDRESS);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
PTR Destination;\r
EFI_STATUS Status;\r
\r
- Status = CpuIoCheckParameter (Width, Address, Count, Buffer, EFI_MAX_ADDRESS);\r
+ Status = CpuIoCheckParameter (Width, Address, Count, Buffer, MAX_ADDRESS);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
OutStride = 0;\r
}\r
\r
- Width = Width & 0x03;\r
+ Width = (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03);\r
\r
//\r
// Loop for each iteration and move the data\r
switch (Width) {\r
case EfiCpuIoWidthUint8:\r
for (; Count > 0; Count--, Buffer.buf += OutStride, Address += InStride) {\r
- *Buffer.ui8 = CpuIoRead8 ((UINT16) Address);\r
+ *Buffer.ui8 = IoRead8 ((UINTN) Address);\r
}\r
break;\r
\r
case EfiCpuIoWidthUint16:\r
for (; Count > 0; Count--, Buffer.buf += OutStride, Address += InStride) {\r
- *Buffer.ui16 = CpuIoRead16 ((UINT16) Address);\r
+ *Buffer.ui16 = IoRead16 ((UINTN) Address);\r
}\r
break;\r
\r
case EfiCpuIoWidthUint32:\r
for (; Count > 0; Count--, Buffer.buf += OutStride, Address += InStride) {\r
- *Buffer.ui32 = CpuIoRead32 ((UINT16) Address);\r
+ *Buffer.ui32 = IoRead32 ((UINTN) Address);\r
}\r
break;\r
\r
OutStride = 0;\r
}\r
\r
- Width = Width & 0x03;\r
+ Width = (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03);\r
\r
//\r
// Loop for each iteration and move the data\r
switch (Width) {\r
case EfiCpuIoWidthUint8:\r
for (; Count > 0; Count--, Buffer.buf += OutStride, Address += InStride) {\r
- CpuIoWrite8 ((UINT16) Address, *Buffer.ui8);\r
+ IoWrite8 ((UINTN) Address, *Buffer.ui8);\r
}\r
break;\r
\r
case EfiCpuIoWidthUint16:\r
for (; Count > 0; Count--, Buffer.buf += OutStride, Address += InStride) {\r
- CpuIoWrite16 ((UINT16) Address, *Buffer.ui16);\r
+ IoWrite16 ((UINTN) Address, *Buffer.ui16);\r
}\r
break;\r
\r
case EfiCpuIoWidthUint32:\r
for (; Count > 0; Count--, Buffer.buf += OutStride, Address += InStride) {\r
- CpuIoWrite32 ((UINT16) Address, *Buffer.ui32);\r
+ IoWrite32 ((UINTN) Address, *Buffer.ui32);\r
}\r
break;\r
\r
Count = 1;\r
}\r
\r
- Width = Width & 0x03;\r
+ Width = (EFI_CPU_IO_PROTOCOL_WIDTH) (Width & 0x03);\r
if (Address - 1 + ((UINTN)1 << Width) * Count > Limit) {\r
return EFI_UNSUPPORTED;\r
}\r