X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=EmulatorPkg%2FCpuRuntimeDxe%2FCpuIo.c;h=37905f892afd5c66fd5a9c5681c180a60c45a355;hb=3dfe9247cef656a40407a46af5e2e4e04757a646;hp=6f63375f4f0f85474657a014dc376b295203f7db;hpb=bb89ec1a7ec2f8d35033df9e47b3604925da3bd3;p=mirror_edk2.git
diff --git a/EmulatorPkg/CpuRuntimeDxe/CpuIo.c b/EmulatorPkg/CpuRuntimeDxe/CpuIo.c
index 6f63375f4f..37905f892a 100644
--- a/EmulatorPkg/CpuRuntimeDxe/CpuIo.c
+++ b/EmulatorPkg/CpuRuntimeDxe/CpuIo.c
@@ -1,29 +1,26 @@
/*++ @file
This is the code that publishes the CPU I/O Protocol.
The intent herein is to have a single I/O service that can load
- as early as possible, extend into runtime, and be layered upon by
+ as early as possible, extend into runtime, and be layered upon by
the implementations of architectural protocols and the PCI Root
Bridge I/O Protocol.
-Copyright (c) 2006, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
Portions copyright (c) 2011, Apple Inc. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include
+#include
#include
-#include
-#include
#include
-#include
#include
#include
@@ -74,12 +71,12 @@ Returns:
Status
- EFI_SUCCESS - The data was read from or written to the EFI
+ EFI_SUCCESS - The data was read from or written to the EFI
System.
EFI_INVALID_PARAMETER - Width is invalid for this EFI System.
EFI_INVALID_PARAMETER - Buffer is NULL.
EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.
- EFI_UNSUPPORTED - The address range specified by Address, Width,
+ EFI_UNSUPPORTED - The address range specified by Address, Width,
and Count is not valid for this EFI System.
**/
@@ -132,7 +129,7 @@ Returns:
EFI_INVALID_PARAMETER - Width is invalid for this EFI System.
EFI_INVALID_PARAMETER - Buffer is NULL.
EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.
- EFI_UNSUPPORTED - The address range specified by Address, Width, and
+ EFI_UNSUPPORTED - The address range specified by Address, Width, and
Count is not valid for this EFI System.
**/
@@ -166,7 +163,7 @@ CpuIoServiceRead (
/*++
Routine Description:
-
+
This is the service that implements the I/O read
Arguments:
@@ -184,7 +181,7 @@ Returns:
EFI_INVALID_PARAMETER - Width is invalid for this EFI System.
EFI_INVALID_PARAMETER - Buffer is NULL.
EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.
- EFI_UNSUPPORTED - The address range specified by Address, Width, and
+ EFI_UNSUPPORTED - The address range specified by Address, Width, and
Count is not valid for this EFI System.
**/
{
@@ -225,7 +222,7 @@ CpuIoServiceWrite (
Routine Description:
-
+
This is the service that implements the I/O Write
Arguments:
@@ -245,7 +242,7 @@ Returns:
EFI_INVALID_PARAMETER - Width is invalid for this EFI System.
EFI_INVALID_PARAMETER - Buffer is NULL.
EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.
- EFI_UNSUPPORTED - The address range specified by Address, Width, and
+ EFI_UNSUPPORTED - The address range specified by Address, Width, and
Count is not valid for this EFI System.
**/
@@ -318,7 +315,7 @@ CpuIoCheckAddressRange (
}
Width = Width & 0x03;
- if (Address - 1 + (1 << Width) * Count > Limit) {
+ if ((Address - 1 + LShiftU64 (Count, Width)) > Limit) {
return EFI_UNSUPPORTED;
}