X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=UefiCpuPkg%2FCpuIo2Smm%2FCpuIo2Smm.c;h=7b1ad37515ce0452c20e48b90f15d1099c1e12c6;hb=0466aac877e5c0666c4db6c072196f3e4bff9020;hp=30ef9ec8a8c5ee97af6bf30f38918d0927a6266b;hpb=bc230a23ed53574bb6b2da061e24b7a59448f4c5;p=mirror_edk2.git diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c index 30ef9ec8a8..7b1ad37515 100644 --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c @@ -1,8 +1,8 @@ /** @file Produces the SMM CPU I/O Protocol. -Copyright (c) 2009 - 2010, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2009 - 2012, Intel Corporation. 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 @@ -12,60 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include - -#include - -#include -#include -#include -#include -#include - -#define MAX_IO_PORT_ADDRESS 0xFFFF - -// -// Function Prototypes -// -EFI_STATUS -EFIAPI -CpuMemoryServiceRead ( - IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, - IN EFI_SMM_IO_WIDTH Width, - IN UINT64 Address, - IN UINTN Count, - OUT VOID *Buffer - ); - -EFI_STATUS -EFIAPI -CpuMemoryServiceWrite ( - IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, - IN EFI_SMM_IO_WIDTH Width, - IN UINT64 Address, - IN UINTN Count, - IN VOID *Buffer - ); - -EFI_STATUS -EFIAPI -CpuIoServiceRead ( - IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, - IN EFI_SMM_IO_WIDTH Width, - IN UINT64 Address, - IN UINTN Count, - OUT VOID *Buffer - ); - -EFI_STATUS -EFIAPI -CpuIoServiceWrite ( - IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, - IN EFI_SMM_IO_WIDTH Width, - IN UINT64 Address, - IN UINTN Count, - IN VOID *Buffer - ); +#include "CpuIo2Smm.h" // // Handle for the SMM CPU I/O Protocol @@ -104,7 +51,7 @@ UINT8 mStride[] = { @param[in] Address The base address of the I/O operations. The caller is responsible for aligning the Address if required. @param[in] Count The number of I/O operations to perform. - @param[out] Buffer For read operations, the destination buffer to store + @param[in] Buffer For read operations, the destination buffer to store the results. For write operations, the source buffer from which to write data. @@ -135,7 +82,7 @@ CpuIoCheckParameter ( // // Check to see if Width is in the valid range // - if (Width < 0 || Width > SMM_IO_UINT64) { + if ((UINT32)Width > SMM_IO_UINT64) { return EFI_INVALID_PARAMETER; } @@ -156,9 +103,9 @@ CpuIoCheckParameter ( // // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count // can also be the maximum integer value supported by the CPU, this range - // check must be adjusted to avoid all oveflow conditions. + // check must be adjusted to avoid all overflow conditions. // - // The follwing form of the range check is equivalent but assumes that + // The following form of the range check is equivalent but assumes that // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1). // Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS); @@ -443,7 +390,7 @@ SmmCpuIo2Initialize ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) - { +{ EFI_STATUS Status; //