/*++ @file\r
This is the code that publishes the CPU I/O Protocol.\r
The intent herein is to have a single I/O service that can load\r
- as early as possible, extend into runtime, and be layered upon by \r
+ as early as possible, extend into runtime, and be layered upon by\r
the implementations of architectural protocols and the PCI Root\r
Bridge I/O Protocol.\r
\r
\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2011, Apple Inc. All rights reserved.\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
-#include <FrameworkDxe.h>\r
+#include <PiDxe.h>\r
#include <Protocol/Cpu.h>\r
-#include <Protocol/DataHub.h>\r
-#include <Guid/DataHubRecords.h>\r
#include <Protocol/CpuIo2.h>\r
-#include <Protocol/FrameworkHii.h>\r
\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
\r
Status\r
\r
- EFI_SUCCESS - The data was read from or written to the EFI \r
+ EFI_SUCCESS - The data was read from or written to the EFI\r
System.\r
EFI_INVALID_PARAMETER - Width is invalid for this EFI System.\r
EFI_INVALID_PARAMETER - Buffer is NULL.\r
EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.\r
- EFI_UNSUPPORTED - The address range specified by Address, Width, \r
+ EFI_UNSUPPORTED - The address range specified by Address, Width,\r
and Count is not valid for this EFI System.\r
\r
**/\r
EFI_INVALID_PARAMETER - Width is invalid for this EFI System.\r
EFI_INVALID_PARAMETER - Buffer is NULL.\r
EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.\r
- EFI_UNSUPPORTED - The address range specified by Address, Width, and \r
+ EFI_UNSUPPORTED - The address range specified by Address, Width, and\r
Count is not valid for this EFI System.\r
\r
**/\r
/*++\r
\r
Routine Description:\r
- \r
+\r
This is the service that implements the I/O read\r
\r
Arguments:\r
EFI_INVALID_PARAMETER - Width is invalid for this EFI System.\r
EFI_INVALID_PARAMETER - Buffer is NULL.\r
EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.\r
- EFI_UNSUPPORTED - The address range specified by Address, Width, and \r
+ EFI_UNSUPPORTED - The address range specified by Address, Width, and\r
Count is not valid for this EFI System.\r
**/\r
{\r
\r
Routine Description:\r
\r
- \r
+\r
This is the service that implements the I/O Write\r
\r
Arguments:\r
EFI_INVALID_PARAMETER - Width is invalid for this EFI System.\r
EFI_INVALID_PARAMETER - Buffer is NULL.\r
EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.\r
- EFI_UNSUPPORTED - The address range specified by Address, Width, and \r
+ EFI_UNSUPPORTED - The address range specified by Address, Width, and\r
Count is not valid for this EFI System.\r
\r
**/\r
}\r
\r
Width = Width & 0x03;\r
- if (Address - 1 + (1 << Width) * Count > Limit) {\r
+ if ((Address - 1 + LShiftU64 (Count, Width)) > Limit) {\r
return EFI_UNSUPPORTED;\r
}\r
\r