X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=UefiCpuPkg%2FCpuIo2Smm%2FCpuIo2Smm.c;h=20b8350fe4a4e189a80dd64b05bd8de65af8cc73;hp=8df68217bc9619aa1eb14473d97dfe052490458f;hb=147fd35c3e389ecd025dbfd243312bf5b22da7c9;hpb=311004b2389692e33526e5fcce0b4f17b3417759 diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c index 8df68217bc..20b8350fe4 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 - 2017, 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; } @@ -179,7 +126,7 @@ CpuIoCheckParameter ( // // Check to see if Address is aligned // - if ((Address & (UINT64)(mStride[Width] - 1)) != 0) { + if ((Address & ((UINT64)mStride[Width] - 1)) != 0) { return EFI_UNSUPPORTED; } @@ -443,7 +390,7 @@ SmmCpuIo2Initialize ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) - { +{ EFI_STATUS Status; //