/** @file\r
Produces the CPU I/O PPI.\r
\r
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
\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
&gEfiPeiCpuIoPpiInstalledGuid,\r
NULL\r
};\r
- \r
+\r
//\r
// Lookup table for increment values based on transfer widths\r
//\r
@retval EFI_SUCCESS The parameters for this request pass the checks.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.\r
@retval EFI_INVALID_PARAMETER Buffer is NULL.\r
- @retval EFI_UNSUPPORTED The address range specified by Address, Width, \r
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width,\r
and Count is not valid for this EFI system.\r
- \r
+\r
**/\r
EFI_STATUS\r
CpuIoCheckParameter (\r
if (!MmioOperation && (Width == EfiPeiCpuIoWidthUint64)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
- // Check to see if any address associated with this transfer exceeds the maximum \r
+ // Check to see if any address associated with this transfer exceeds the maximum\r
// allowed address. The maximum address implied by the parameters passed in is\r
// Address + Size * Count. If the following condition is met, then the transfer\r
// is not supported.\r
//\r
// Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1\r
//\r
- // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count \r
+ // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count\r
// can also be the maximum integer value supported by the CPU, this range\r
// check must be adjusted to avoid all overflow conditions.\r
- // \r
- // The following form of the range check is equivalent but assumes that \r
+ //\r
+ // The following form of the range check is equivalent but assumes that\r
// MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1).\r
//\r
Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS);\r
if (Address > Limit) {\r
return EFI_UNSUPPORTED;\r
}\r
- } else { \r
+ } else {\r
MaxCount = RShiftU64 (Limit, Width);\r
if (MaxCount < (Count - 1)) {\r
return EFI_UNSUPPORTED;\r
return EFI_UNSUPPORTED;\r
}\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.\r
@retval EFI_INVALID_PARAMETER Buffer is NULL.\r
- @retval EFI_UNSUPPORTED The address range specified by Address, Width, \r
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width,\r
and Count is not valid for this EFI system.\r
\r
**/\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.\r
@retval EFI_INVALID_PARAMETER Buffer is NULL.\r
- @retval EFI_UNSUPPORTED The address range specified by Address, Width, \r
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width,\r
and Count is not valid for this EFI system.\r
\r
**/\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.\r
@retval EFI_INVALID_PARAMETER Buffer is NULL.\r
- @retval EFI_UNSUPPORTED The address range specified by Address, Width, \r
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width,\r
and Count is not valid for this EFI system.\r
\r
**/\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.\r
@retval EFI_INVALID_PARAMETER Buffer is NULL.\r
- @retval EFI_UNSUPPORTED The address range specified by Address, Width, \r
+ @retval EFI_UNSUPPORTED The address range specified by Address, Width,\r
and Count is not valid for this EFI system.\r
\r
**/\r
}\r
}\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
8-bit I/O read operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
16-bit I/O read operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
32-bit I/O read operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
64-bit I/O read operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
8-bit I/O write operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
16-bit I/O write operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
32-bit I/O write operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
64-bit I/O write operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
8-bit memory read operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
16-bit memory read operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
32-bit memory read operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
64-bit memory read operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
8-bit memory write operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
16-bit memory write operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
32-bit memory write operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
/**\r
64-bit memory write operations.\r
\r
- @param[in] PeiServices An indirect pointer to the PEI Services Table published \r
+ @param[in] PeiServices An indirect pointer to the PEI Services Table published\r
by the PEI Foundation.\r
@param[in] This Pointer to local data for the interface.\r
@param[in] Address The physical address of the access.\r
This function is the Entry point of the CPU I/O PEIM which installs CpuIoPpi.\r
\r
@param[in] FileHandle Pointer to image file handle.\r
- @param[in] PeiServices Pointer to PEI Services Table \r
+ @param[in] PeiServices Pointer to PEI Services Table\r
\r
@retval EFI_SUCCESS CPU I/O PPI successfully installed\r
\r
// Register so it will be automatically shadowed to memory\r
//\r
Status = PeiServicesRegisterForShadow (FileHandle);\r
- \r
+\r
//\r
// Make CpuIo pointer in PeiService table point to gCpuIoPpi\r
//\r
(*((EFI_PEI_SERVICES **)PeiServices))->CpuIo = &gCpuIoPpi;\r
- \r
+\r
if (Status == EFI_ALREADY_STARTED) {\r
//\r
// Shadow completed and running from memory\r
Status = PeiServicesInstallPpi (&gPpiList);\r
ASSERT_EFI_ERROR (Status);\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r