mirror of
				https://git.proxmox.com/git/mirror_edk2
				synced 2025-11-04 02:19:12 +00:00 
			
		
		
		
	UefiCpuPkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
		
							parent
							
								
									77695f4da3
								
							
						
					
					
						commit
						7367cc6c24
					
				@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  UEFI Application to display CPUID leaf information.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -1020,7 +1020,7 @@ CpuidEnumerationOfIntelSgxResourcesSubLeaf (
 | 
			
		||||
  CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_ECX  Ecx;
 | 
			
		||||
  CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX  Edx;
 | 
			
		||||
  UINT32                                               SubLeaf;
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
  SubLeaf = CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF;
 | 
			
		||||
  do {
 | 
			
		||||
    AsmCpuidEx (
 | 
			
		||||
@ -1068,7 +1068,7 @@ CpuidEnumerationOfIntelSgx (
 | 
			
		||||
    //
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  CpuidEnumerationOfIntelSgxCapabilities0SubLeaf ();
 | 
			
		||||
  CpuidEnumerationOfIntelSgxCapabilities1SubLeaf ();
 | 
			
		||||
  CpuidEnumerationOfIntelSgxResourcesSubLeaf ();
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  CPU DXE Module to produce CPU ARCH Protocol.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -1107,7 +1107,7 @@ FreeMemorySpaceMap:
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Add and allocate CPU local APIC memory mapped space. 
 | 
			
		||||
  Add and allocate CPU local APIC memory mapped space.
 | 
			
		||||
 | 
			
		||||
  @param[in]ImageHandle     Image handle this driver.
 | 
			
		||||
 | 
			
		||||
@ -1125,7 +1125,7 @@ AddLocalApicMemorySpace (
 | 
			
		||||
  ASSERT_EFI_ERROR (Status);
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Try to allocate APIC memory mapped space, does not check return 
 | 
			
		||||
  // Try to allocate APIC memory mapped space, does not check return
 | 
			
		||||
  // status because it may be allocated by other driver, or DXE Core if
 | 
			
		||||
  // this range is built into Memory Allocation HOB.
 | 
			
		||||
  //
 | 
			
		||||
@ -1164,7 +1164,7 @@ InitializeCpu (
 | 
			
		||||
{
 | 
			
		||||
  EFI_STATUS  Status;
 | 
			
		||||
  EFI_EVENT   IdleLoopEvent;
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  InitializePageTableLib();
 | 
			
		||||
 | 
			
		||||
  InitializeFloatingPointUnits ();
 | 
			
		||||
 | 
			
		||||
@ -3,13 +3,13 @@
 | 
			
		||||
//
 | 
			
		||||
// CPU driver installs CPU Architecture Protocol and CPU MP Protocol.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// 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.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
// /** @file
 | 
			
		||||
// CpuDxe Localized Strings and Content
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// This program and the accompanying materials
 | 
			
		||||
// are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
@ -13,8 +13,8 @@
 | 
			
		||||
//
 | 
			
		||||
// **/
 | 
			
		||||
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME 
 | 
			
		||||
#language en-US 
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME
 | 
			
		||||
#language en-US
 | 
			
		||||
"CPU Architectural and CPU Multi-processor DXE Driver"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  CPU Features DXE driver to initialize CPU features.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -107,8 +107,8 @@ CpuFeaturesDxeInitialize (
 | 
			
		||||
 | 
			
		||||
  if (GetFirstGuidHob (&gEdkiiCpuFeaturesInitDoneGuid) != NULL) {
 | 
			
		||||
    //
 | 
			
		||||
    // Try to find HOB first. This HOB exist means CPU features have 
 | 
			
		||||
    // been initialized by CpuFeaturesPei driver, just install 
 | 
			
		||||
    // Try to find HOB first. This HOB exist means CPU features have
 | 
			
		||||
    // been initialized by CpuFeaturesPei driver, just install
 | 
			
		||||
    // gEdkiiCpuFeaturesInitDoneGuid.
 | 
			
		||||
    //
 | 
			
		||||
    Handle = NULL;
 | 
			
		||||
 | 
			
		||||
@ -1,16 +1,16 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Produces the CPU I/O 2 Protocol.
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
@ -74,16 +74,16 @@ UINT8 mOutStride[] = {
 | 
			
		||||
/**
 | 
			
		||||
  Check parameters to a CPU I/O 2 Protocol service request.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in] MmioOperation  TRUE for an MMIO operation, FALSE for I/O Port operation.
 | 
			
		||||
  @param[in] Width          Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in] Address        The base address of the I/O operation. 
 | 
			
		||||
  @param[in] Count          The number of I/O operations to perform. The number of  
 | 
			
		||||
  @param[in] Address        The base address of the I/O operation.
 | 
			
		||||
  @param[in] Count          The number of I/O operations to perform. The number of
 | 
			
		||||
                            bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[in] Buffer         For read operations, the destination buffer to store the results.
 | 
			
		||||
                            For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -92,7 +92,7 @@ UINT8 mOutStride[] = {
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -137,7 +137,7 @@ CpuIoCheckParameter (
 | 
			
		||||
  if (!MmioOperation && (Width == EfiCpuIoWidthUint64)) {
 | 
			
		||||
    return EFI_INVALID_PARAMETER;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Check to see if Address is aligned
 | 
			
		||||
  //
 | 
			
		||||
@ -146,18 +146,18 @@ CpuIoCheckParameter (
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Check to see if any address associated with this transfer exceeds the maximum 
 | 
			
		||||
  // Check to see if any address associated with this transfer exceeds the maximum
 | 
			
		||||
  // allowed address.  The maximum address implied by the parameters passed in is
 | 
			
		||||
  // Address + Size * Count.  If the following condition is met, then the transfer
 | 
			
		||||
  // is not supported.
 | 
			
		||||
  //
 | 
			
		||||
  //    Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1
 | 
			
		||||
  //
 | 
			
		||||
  // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 
 | 
			
		||||
  // 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.
 | 
			
		||||
  //   
 | 
			
		||||
  // The following 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);
 | 
			
		||||
@ -165,7 +165,7 @@ CpuIoCheckParameter (
 | 
			
		||||
    if (Address > Limit) {
 | 
			
		||||
      return EFI_UNSUPPORTED;
 | 
			
		||||
    }
 | 
			
		||||
  } else {  
 | 
			
		||||
  } else {
 | 
			
		||||
    MaxCount = RShiftU64 (Limit, Width);
 | 
			
		||||
    if (MaxCount < (Count - 1)) {
 | 
			
		||||
      return EFI_UNSUPPORTED;
 | 
			
		||||
@ -189,30 +189,30 @@ CpuIoCheckParameter (
 | 
			
		||||
/**
 | 
			
		||||
  Reads memory-mapped registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
 | 
			
		||||
  each of the Count operations that is performed.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times on the same Address.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times from the first element of Buffer.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation. 
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of 
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation.
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of
 | 
			
		||||
                       bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[out] Buffer   For read operations, the destination buffer to store the results.
 | 
			
		||||
                       For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -221,7 +221,7 @@ CpuIoCheckParameter (
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -269,30 +269,30 @@ CpuMemoryServiceRead (
 | 
			
		||||
/**
 | 
			
		||||
  Writes memory-mapped registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
 | 
			
		||||
  each of the Count operations that is performed.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times on the same Address.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times from the first element of Buffer.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation. 
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of 
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation.
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of
 | 
			
		||||
                       bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[in]  Buffer   For read operations, the destination buffer to store the results.
 | 
			
		||||
                       For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -301,7 +301,7 @@ CpuMemoryServiceRead (
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -349,30 +349,30 @@ CpuMemoryServiceWrite (
 | 
			
		||||
/**
 | 
			
		||||
  Reads I/O registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
 | 
			
		||||
  each of the Count operations that is performed.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times on the same Address.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times from the first element of Buffer.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation. 
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of 
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation.
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of
 | 
			
		||||
                       bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[out] Buffer   For read operations, the destination buffer to store the results.
 | 
			
		||||
                       For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -381,7 +381,7 @@ CpuMemoryServiceWrite (
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -453,30 +453,30 @@ CpuIoServiceRead (
 | 
			
		||||
/**
 | 
			
		||||
  Write I/O registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
 | 
			
		||||
  each of the Count operations that is performed.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times on the same Address.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times from the first element of Buffer.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation. 
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of 
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation.
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of
 | 
			
		||||
                       bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[in]  Buffer   For read operations, the destination buffer to store the results.
 | 
			
		||||
                       For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -485,9 +485,9 @@ CpuIoServiceRead (
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
                                 
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
EFI_STATUS
 | 
			
		||||
EFIAPI
 | 
			
		||||
@ -553,16 +553,16 @@ CpuIoServiceWrite (
 | 
			
		||||
      IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  return EFI_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  The user Entry Point for module CpuIo2Dxe. The user code starts with this function.
 | 
			
		||||
 | 
			
		||||
  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  
 | 
			
		||||
  @param[in] ImageHandle    The firmware allocated handle for the EFI image.
 | 
			
		||||
  @param[in] SystemTable    A pointer to the EFI System Table.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS       The entry point is executed successfully.
 | 
			
		||||
  @retval other             Some error occurs when executing this entry point.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,14 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Internal include file for the CPU I/O 2 Protocol.
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
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.             
 | 
			
		||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
@ -29,30 +29,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
/**
 | 
			
		||||
  Reads memory-mapped registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
 | 
			
		||||
  each of the Count operations that is performed.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times on the same Address.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times from the first element of Buffer.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation. 
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of 
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation.
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of
 | 
			
		||||
                       bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[out] Buffer   For read operations, the destination buffer to store the results.
 | 
			
		||||
                       For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -61,7 +61,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -78,30 +78,30 @@ CpuMemoryServiceRead (
 | 
			
		||||
/**
 | 
			
		||||
  Writes memory-mapped registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
 | 
			
		||||
  each of the Count operations that is performed.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times on the same Address.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times from the first element of Buffer.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation. 
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of 
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation.
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of
 | 
			
		||||
                       bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[in]  Buffer   For read operations, the destination buffer to store the results.
 | 
			
		||||
                       For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -110,7 +110,7 @@ CpuMemoryServiceRead (
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -127,30 +127,30 @@ CpuMemoryServiceWrite (
 | 
			
		||||
/**
 | 
			
		||||
  Reads I/O registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
 | 
			
		||||
  each of the Count operations that is performed.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times on the same Address.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times from the first element of Buffer.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation. 
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of 
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation.
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of
 | 
			
		||||
                       bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[out] Buffer   For read operations, the destination buffer to store the results.
 | 
			
		||||
                       For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -159,7 +159,7 @@ CpuMemoryServiceWrite (
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -176,30 +176,30 @@ CpuIoServiceRead (
 | 
			
		||||
/**
 | 
			
		||||
  Write I/O registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible 
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a 
 | 
			
		||||
  platform might require. For example on some platforms, width requests of 
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 
 | 
			
		||||
  The I/O operations are carried out exactly as requested. The caller is responsible
 | 
			
		||||
  for satisfying any alignment and I/O width restrictions that a PI System on a
 | 
			
		||||
  platform might require. For example on some platforms, width requests of
 | 
			
		||||
  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
 | 
			
		||||
  be handled by the driver.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
 | 
			
		||||
  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
 | 
			
		||||
  each of the Count operations that is performed.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
 | 
			
		||||
  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times on the same Address.
 | 
			
		||||
  
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or 
 | 
			
		||||
 | 
			
		||||
  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
 | 
			
		||||
  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
 | 
			
		||||
  incremented for each of the Count operations that is performed. The read or
 | 
			
		||||
  write operation is performed Count times from the first element of Buffer.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O or Memory operation.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation. 
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of 
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operation.
 | 
			
		||||
  @param[in]  Count    The number of I/O operations to perform. The number of
 | 
			
		||||
                       bytes moved is Width size * Count, starting at Address.
 | 
			
		||||
  @param[in]  Buffer   For read operations, the destination buffer to store the results.
 | 
			
		||||
                       For write operations, the source buffer from which to write data.
 | 
			
		||||
@ -208,9 +208,9 @@ CpuIoServiceRead (
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this PI system.
 | 
			
		||||
                                 
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
EFI_STATUS
 | 
			
		||||
EFIAPI
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
## @file
 | 
			
		||||
#  Produces the CPU I/O 2 Protocol by using the services of the I/O Library.
 | 
			
		||||
#
 | 
			
		||||
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
# Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
 | 
			
		||||
#
 | 
			
		||||
# This program and the accompanying materials
 | 
			
		||||
@ -20,7 +20,7 @@
 | 
			
		||||
  MODULE_UNI_FILE                = CpuIo2Dxe.uni
 | 
			
		||||
  FILE_GUID                      = A19B1FE7-C1BC-49F8-875F-54A5D542443F
 | 
			
		||||
  MODULE_TYPE                    = DXE_DRIVER
 | 
			
		||||
  VERSION_STRING                 = 1.0  
 | 
			
		||||
  VERSION_STRING                 = 1.0
 | 
			
		||||
  ENTRY_POINT                    = CpuIo2Initialize
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
@ -3,13 +3,13 @@
 | 
			
		||||
//
 | 
			
		||||
// Produces the CPU I/O 2 Protocol by using the services of the I/O Library.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// 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.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
// /** @file
 | 
			
		||||
// CpuIo2Dxe Localized Strings and Content
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// This program and the accompanying materials
 | 
			
		||||
// are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
@ -13,8 +13,8 @@
 | 
			
		||||
//
 | 
			
		||||
// **/
 | 
			
		||||
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME 
 | 
			
		||||
#language en-US 
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME
 | 
			
		||||
#language en-US
 | 
			
		||||
"CPU I/O v2 DXE Driver"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,14 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Produces the SMM CPU I/O Protocol.
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
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.             
 | 
			
		||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
@ -48,17 +48,17 @@ UINT8 mStride[] = {
 | 
			
		||||
 | 
			
		||||
  @param[in]  MmioOperation  TRUE for an MMIO operation, FALSE for I/O Port operation.
 | 
			
		||||
  @param[in]  Width          Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address        The base address of the I/O operations.  The caller is 
 | 
			
		||||
                             responsible for aligning the Address if required. 
 | 
			
		||||
  @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[in]  Buffer         For read operations, the destination buffer to store 
 | 
			
		||||
                             the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[in]  Buffer         For read operations, the destination buffer to store
 | 
			
		||||
                             the results.  For write operations, the source buffer
 | 
			
		||||
                             from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
                                 
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
EFI_STATUS
 | 
			
		||||
CpuIoCheckParameter (
 | 
			
		||||
@ -92,20 +92,20 @@ CpuIoCheckParameter (
 | 
			
		||||
  if (!MmioOperation && (Width == SMM_IO_UINT64)) {
 | 
			
		||||
    return EFI_INVALID_PARAMETER;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Check to see if any address associated with this transfer exceeds the maximum 
 | 
			
		||||
  // Check to see if any address associated with this transfer exceeds the maximum
 | 
			
		||||
  // allowed address.  The maximum address implied by the parameters passed in is
 | 
			
		||||
  // Address + Size * Count.  If the following condition is met, then the transfer
 | 
			
		||||
  // is not supported.
 | 
			
		||||
  //
 | 
			
		||||
  //    Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1
 | 
			
		||||
  //
 | 
			
		||||
  // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 
 | 
			
		||||
  // 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 overflow conditions.
 | 
			
		||||
  //   
 | 
			
		||||
  // The following 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);
 | 
			
		||||
@ -113,7 +113,7 @@ CpuIoCheckParameter (
 | 
			
		||||
    if (Address > Limit) {
 | 
			
		||||
      return EFI_UNSUPPORTED;
 | 
			
		||||
    }
 | 
			
		||||
  } else {  
 | 
			
		||||
  } else {
 | 
			
		||||
    MaxCount = RShiftU64 (Limit, Width);
 | 
			
		||||
    if (MaxCount < (Count - 1)) {
 | 
			
		||||
      return EFI_UNSUPPORTED;
 | 
			
		||||
@ -122,7 +122,7 @@ CpuIoCheckParameter (
 | 
			
		||||
      return EFI_UNSUPPORTED;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Check to see if Address is aligned
 | 
			
		||||
  //
 | 
			
		||||
@ -136,23 +136,23 @@ CpuIoCheckParameter (
 | 
			
		||||
/**
 | 
			
		||||
  Reads memory-mapped registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is 
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device, 
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device,
 | 
			
		||||
  platform, or type of I/O might require.
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operations.  The caller is 
 | 
			
		||||
                       responsible for aligning the Address if required. 
 | 
			
		||||
  @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 
 | 
			
		||||
                       the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[out] Buffer   For read operations, the destination buffer to store
 | 
			
		||||
                       the results.  For write operations, the source buffer
 | 
			
		||||
                       from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a 
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
 | 
			
		||||
                                 lack of resources
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -196,23 +196,23 @@ CpuMemoryServiceRead (
 | 
			
		||||
/**
 | 
			
		||||
  Writes memory-mapped registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is 
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device, 
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device,
 | 
			
		||||
  platform, or type of I/O might require.
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operations.  The caller is 
 | 
			
		||||
                       responsible for aligning the Address if required. 
 | 
			
		||||
  @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[in]  Buffer   For read operations, the destination buffer to store 
 | 
			
		||||
                       the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[in]  Buffer   For read operations, the destination buffer to store
 | 
			
		||||
                       the results.  For write operations, the source buffer
 | 
			
		||||
                       from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a 
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
 | 
			
		||||
                                 lack of resources
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -256,23 +256,23 @@ CpuMemoryServiceWrite (
 | 
			
		||||
/**
 | 
			
		||||
  Reads I/O registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is 
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device, 
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device,
 | 
			
		||||
  platform, or type of I/O might require.
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operations.  The caller is 
 | 
			
		||||
                       responsible for aligning the Address if required. 
 | 
			
		||||
  @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 
 | 
			
		||||
                       the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[out] Buffer   For read operations, the destination buffer to store
 | 
			
		||||
                       the results.  For write operations, the source buffer
 | 
			
		||||
                       from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a 
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
 | 
			
		||||
                                 lack of resources
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -315,23 +315,23 @@ CpuIoServiceRead (
 | 
			
		||||
/**
 | 
			
		||||
  Write I/O registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is 
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device, 
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device,
 | 
			
		||||
  platform, or type of I/O might require.
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operations.  The caller is 
 | 
			
		||||
                       responsible for aligning the Address if required. 
 | 
			
		||||
  @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[in]  Buffer   For read operations, the destination buffer to store 
 | 
			
		||||
                       the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[in]  Buffer   For read operations, the destination buffer to store
 | 
			
		||||
                       the results.  For write operations, the source buffer
 | 
			
		||||
                       from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a 
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
 | 
			
		||||
                                 lack of resources
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -370,7 +370,7 @@ CpuIoServiceWrite (
 | 
			
		||||
      IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  return EFI_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -408,6 +408,6 @@ SmmCpuIo2Initialize (
 | 
			
		||||
                    &mSmmCpuIo2
 | 
			
		||||
                    );
 | 
			
		||||
  ASSERT_EFI_ERROR (Status);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  return Status;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,14 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Internal include file for the SMM CPU I/O Protocol.
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
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.             
 | 
			
		||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
@ -30,23 +30,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
/**
 | 
			
		||||
  Reads memory-mapped registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is 
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device, 
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device,
 | 
			
		||||
  platform, or type of I/O might require.
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operations.  The caller is 
 | 
			
		||||
                       responsible for aligning the Address if required. 
 | 
			
		||||
  @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 
 | 
			
		||||
                       the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[out] Buffer   For read operations, the destination buffer to store
 | 
			
		||||
                       the results.  For write operations, the source buffer
 | 
			
		||||
                       from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a 
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
 | 
			
		||||
                                 lack of resources
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -63,23 +63,23 @@ CpuMemoryServiceRead (
 | 
			
		||||
/**
 | 
			
		||||
  Writes memory-mapped registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is 
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device, 
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device,
 | 
			
		||||
  platform, or type of I/O might require.
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operations.  The caller is 
 | 
			
		||||
                       responsible for aligning the Address if required. 
 | 
			
		||||
  @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[in]  Buffer   For read operations, the destination buffer to store 
 | 
			
		||||
                       the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[in]  Buffer   For read operations, the destination buffer to store
 | 
			
		||||
                       the results.  For write operations, the source buffer
 | 
			
		||||
                       from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a 
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
 | 
			
		||||
                                 lack of resources
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -96,23 +96,23 @@ CpuMemoryServiceWrite (
 | 
			
		||||
/**
 | 
			
		||||
  Reads I/O registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is 
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device, 
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device,
 | 
			
		||||
  platform, or type of I/O might require.
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operations.  The caller is 
 | 
			
		||||
                       responsible for aligning the Address if required. 
 | 
			
		||||
  @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 
 | 
			
		||||
                       the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[out] Buffer   For read operations, the destination buffer to store
 | 
			
		||||
                       the results.  For write operations, the source buffer
 | 
			
		||||
                       from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a 
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
 | 
			
		||||
                                 lack of resources
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -129,23 +129,23 @@ CpuIoServiceRead (
 | 
			
		||||
/**
 | 
			
		||||
  Write I/O registers.
 | 
			
		||||
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is 
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device, 
 | 
			
		||||
  The I/O operations are carried out exactly as requested.  The caller is
 | 
			
		||||
  responsible for any alignment and I/O width issues that the bus, device,
 | 
			
		||||
  platform, or type of I/O might require.
 | 
			
		||||
 | 
			
		||||
  @param[in]  This     The EFI_SMM_CPU_IO2_PROTOCOL instance.
 | 
			
		||||
  @param[in]  Width    Signifies the width of the I/O operations.
 | 
			
		||||
  @param[in]  Address  The base address of the I/O operations.  The caller is 
 | 
			
		||||
                       responsible for aligning the Address if required. 
 | 
			
		||||
  @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[in]  Buffer   For read operations, the destination buffer to store 
 | 
			
		||||
                       the results.  For write operations, the source buffer 
 | 
			
		||||
  @param[in]  Buffer   For read operations, the destination buffer to store
 | 
			
		||||
                       the results.  For write operations, the source buffer
 | 
			
		||||
                       from which to write data.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The data was read from or written to the device.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The Address is not valid for this system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width or Count, or both, were invalid.
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a 
 | 
			
		||||
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
 | 
			
		||||
                                 lack of resources
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
## @file
 | 
			
		||||
#  Produces the SMM CPU I/O 2 Protocol by using the services of the I/O Library.  
 | 
			
		||||
#  Produces the SMM CPU I/O 2 Protocol by using the services of the I/O Library.
 | 
			
		||||
#
 | 
			
		||||
#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  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
 | 
			
		||||
@ -24,13 +24,13 @@
 | 
			
		||||
#
 | 
			
		||||
# The following information is for reference only and not required by the build tools.
 | 
			
		||||
#
 | 
			
		||||
#  VALID_ARCHITECTURES           = IA32 X64 
 | 
			
		||||
#  VALID_ARCHITECTURES           = IA32 X64
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
[Sources]
 | 
			
		||||
  CpuIo2Smm.c
 | 
			
		||||
  CpuIo2Smm.h
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
[Packages]
 | 
			
		||||
  MdePkg/MdePkg.dec
 | 
			
		||||
 | 
			
		||||
@ -41,7 +41,7 @@
 | 
			
		||||
  IoLib
 | 
			
		||||
  SmmServicesTableLib
 | 
			
		||||
  BaseMemoryLib
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
[Protocols]
 | 
			
		||||
  gEfiSmmCpuIo2ProtocolGuid                   ## PRODUCES
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
// /** @file
 | 
			
		||||
// CpuIo2Smm Localized Strings and Content
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// This program and the accompanying materials
 | 
			
		||||
// are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
@ -12,7 +12,7 @@
 | 
			
		||||
//
 | 
			
		||||
// **/
 | 
			
		||||
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME 
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME
 | 
			
		||||
#language en-US
 | 
			
		||||
"CPU I/O v2 SMM Driver"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,16 +1,16 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Produces the CPU I/O PPI.
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
@ -54,7 +54,7 @@ EFI_PEI_PPI_DESCRIPTOR gPpiList = {
 | 
			
		||||
  &gEfiPeiCpuIoPpiInstalledGuid,
 | 
			
		||||
  NULL
 | 
			
		||||
};
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Lookup table for increment values based on transfer widths
 | 
			
		||||
//
 | 
			
		||||
@ -103,9 +103,9 @@ UINT8 mOutStride[] = {
 | 
			
		||||
  @retval EFI_SUCCESS            The parameters for this request pass the checks.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
                                 
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
EFI_STATUS
 | 
			
		||||
CpuIoCheckParameter (
 | 
			
		||||
@ -148,20 +148,20 @@ CpuIoCheckParameter (
 | 
			
		||||
  if (!MmioOperation && (Width == EfiPeiCpuIoWidthUint64)) {
 | 
			
		||||
    return EFI_INVALID_PARAMETER;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Check to see if any address associated with this transfer exceeds the maximum 
 | 
			
		||||
  // Check to see if any address associated with this transfer exceeds the maximum
 | 
			
		||||
  // allowed address.  The maximum address implied by the parameters passed in is
 | 
			
		||||
  // Address + Size * Count.  If the following condition is met, then the transfer
 | 
			
		||||
  // is not supported.
 | 
			
		||||
  //
 | 
			
		||||
  //    Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1
 | 
			
		||||
  //
 | 
			
		||||
  // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 
 | 
			
		||||
  // 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 overflow conditions.
 | 
			
		||||
  //   
 | 
			
		||||
  // The following 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);
 | 
			
		||||
@ -169,7 +169,7 @@ CpuIoCheckParameter (
 | 
			
		||||
    if (Address > Limit) {
 | 
			
		||||
      return EFI_UNSUPPORTED;
 | 
			
		||||
    }
 | 
			
		||||
  } else {  
 | 
			
		||||
  } else {
 | 
			
		||||
    MaxCount = RShiftU64 (Limit, Width);
 | 
			
		||||
    if (MaxCount < (Count - 1)) {
 | 
			
		||||
      return EFI_UNSUPPORTED;
 | 
			
		||||
@ -178,7 +178,7 @@ CpuIoCheckParameter (
 | 
			
		||||
      return EFI_UNSUPPORTED;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  return EFI_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -196,7 +196,7 @@ CpuIoCheckParameter (
 | 
			
		||||
  @retval EFI_SUCCESS            The function completed successfully.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -270,7 +270,7 @@ CpuMemoryServiceRead (
 | 
			
		||||
  @retval EFI_SUCCESS            The function completed successfully.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -344,7 +344,7 @@ CpuMemoryServiceWrite (
 | 
			
		||||
  @retval EFI_SUCCESS            The function completed successfully.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -438,7 +438,7 @@ CpuIoServiceRead (
 | 
			
		||||
  @retval EFI_SUCCESS            The function completed successfully.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -517,14 +517,14 @@ CpuIoServiceWrite (
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  return EFI_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  8-bit I/O read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -545,7 +545,7 @@ CpuIoRead8 (
 | 
			
		||||
/**
 | 
			
		||||
  16-bit I/O read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -567,7 +567,7 @@ CpuIoRead16 (
 | 
			
		||||
/**
 | 
			
		||||
  32-bit I/O read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -589,7 +589,7 @@ CpuIoRead32 (
 | 
			
		||||
/**
 | 
			
		||||
  64-bit I/O read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -611,7 +611,7 @@ CpuIoRead64 (
 | 
			
		||||
/**
 | 
			
		||||
  8-bit I/O write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -633,7 +633,7 @@ CpuIoWrite8 (
 | 
			
		||||
/**
 | 
			
		||||
  16-bit I/O write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -655,7 +655,7 @@ CpuIoWrite16 (
 | 
			
		||||
/**
 | 
			
		||||
  32-bit I/O write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -677,7 +677,7 @@ CpuIoWrite32 (
 | 
			
		||||
/**
 | 
			
		||||
  64-bit I/O write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -699,7 +699,7 @@ CpuIoWrite64 (
 | 
			
		||||
/**
 | 
			
		||||
  8-bit memory read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -721,7 +721,7 @@ CpuMemRead8 (
 | 
			
		||||
/**
 | 
			
		||||
  16-bit memory read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -743,7 +743,7 @@ CpuMemRead16 (
 | 
			
		||||
/**
 | 
			
		||||
  32-bit memory read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -765,7 +765,7 @@ CpuMemRead32 (
 | 
			
		||||
/**
 | 
			
		||||
  64-bit memory read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -787,7 +787,7 @@ CpuMemRead64 (
 | 
			
		||||
/**
 | 
			
		||||
  8-bit memory write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -809,7 +809,7 @@ CpuMemWrite8 (
 | 
			
		||||
/**
 | 
			
		||||
  16-bit memory write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -831,7 +831,7 @@ CpuMemWrite16 (
 | 
			
		||||
/**
 | 
			
		||||
  32-bit memory write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -853,7 +853,7 @@ CpuMemWrite32 (
 | 
			
		||||
/**
 | 
			
		||||
  64-bit memory write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -878,7 +878,7 @@ CpuMemWrite64 (
 | 
			
		||||
  This function is the Entry point of the CPU I/O PEIM which installs CpuIoPpi.
 | 
			
		||||
 | 
			
		||||
  @param[in]  FileHandle   Pointer to image file handle.
 | 
			
		||||
  @param[in]  PeiServices  Pointer to PEI Services Table   
 | 
			
		||||
  @param[in]  PeiServices  Pointer to PEI Services Table
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS  CPU I/O PPI successfully installed
 | 
			
		||||
 | 
			
		||||
@ -896,12 +896,12 @@ CpuIoInitialize (
 | 
			
		||||
  // Register so it will be automatically shadowed to memory
 | 
			
		||||
  //
 | 
			
		||||
  Status = PeiServicesRegisterForShadow (FileHandle);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Make CpuIo pointer in PeiService table point to gCpuIoPpi
 | 
			
		||||
  //
 | 
			
		||||
  (*((EFI_PEI_SERVICES **)PeiServices))->CpuIo = &gCpuIoPpi;
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  if (Status == EFI_ALREADY_STARTED) {
 | 
			
		||||
    //
 | 
			
		||||
    // Shadow completed and running from memory
 | 
			
		||||
@ -911,6 +911,6 @@ CpuIoInitialize (
 | 
			
		||||
    Status = PeiServicesInstallPpi (&gPpiList);
 | 
			
		||||
    ASSERT_EFI_ERROR (Status);
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  return EFI_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,14 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Internal include file for the CPU I/O PPI.
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
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.             
 | 
			
		||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
@ -40,7 +40,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
  @retval EFI_SUCCESS            The function completed successfully.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -69,7 +69,7 @@ CpuMemoryServiceRead (
 | 
			
		||||
  @retval EFI_SUCCESS            The function completed successfully.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -98,7 +98,7 @@ CpuMemoryServiceWrite (
 | 
			
		||||
  @retval EFI_SUCCESS            The function completed successfully.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -127,7 +127,7 @@ CpuIoServiceRead (
 | 
			
		||||
  @retval EFI_SUCCESS            The function completed successfully.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width, 
 | 
			
		||||
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
 | 
			
		||||
                                 and Count is not valid for this EFI system.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -145,7 +145,7 @@ CpuIoServiceWrite (
 | 
			
		||||
/**
 | 
			
		||||
  8-bit I/O read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -163,7 +163,7 @@ CpuIoRead8 (
 | 
			
		||||
/**
 | 
			
		||||
  16-bit I/O read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -182,7 +182,7 @@ CpuIoRead16 (
 | 
			
		||||
/**
 | 
			
		||||
  32-bit I/O read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -201,7 +201,7 @@ CpuIoRead32 (
 | 
			
		||||
/**
 | 
			
		||||
  64-bit I/O read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -220,7 +220,7 @@ CpuIoRead64 (
 | 
			
		||||
/**
 | 
			
		||||
  8-bit I/O write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -239,7 +239,7 @@ CpuIoWrite8 (
 | 
			
		||||
/**
 | 
			
		||||
  16-bit I/O write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -258,7 +258,7 @@ CpuIoWrite16 (
 | 
			
		||||
/**
 | 
			
		||||
  32-bit I/O write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -277,7 +277,7 @@ CpuIoWrite32 (
 | 
			
		||||
/**
 | 
			
		||||
  64-bit I/O write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -296,7 +296,7 @@ CpuIoWrite64 (
 | 
			
		||||
/**
 | 
			
		||||
  8-bit memory read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -315,7 +315,7 @@ CpuMemRead8 (
 | 
			
		||||
/**
 | 
			
		||||
  16-bit memory read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -334,7 +334,7 @@ CpuMemRead16 (
 | 
			
		||||
/**
 | 
			
		||||
  32-bit memory read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -353,7 +353,7 @@ CpuMemRead32 (
 | 
			
		||||
/**
 | 
			
		||||
  64-bit memory read operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -372,7 +372,7 @@ CpuMemRead64 (
 | 
			
		||||
/**
 | 
			
		||||
  8-bit memory write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -391,7 +391,7 @@ CpuMemWrite8 (
 | 
			
		||||
/**
 | 
			
		||||
  16-bit memory write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -410,7 +410,7 @@ CpuMemWrite16 (
 | 
			
		||||
/**
 | 
			
		||||
  32-bit memory write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -429,7 +429,7 @@ CpuMemWrite32 (
 | 
			
		||||
/**
 | 
			
		||||
  64-bit memory write operations.
 | 
			
		||||
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published 
 | 
			
		||||
  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
 | 
			
		||||
                          by the PEI Foundation.
 | 
			
		||||
  @param[in] This         Pointer to local data for the interface.
 | 
			
		||||
  @param[in] Address      The physical address of the access.
 | 
			
		||||
@ -444,5 +444,5 @@ CpuMemWrite64 (
 | 
			
		||||
  IN  UINT64                      Address,
 | 
			
		||||
  IN  UINT64                      Data
 | 
			
		||||
  );
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
## @file
 | 
			
		||||
#  Produces the CPU I/O PPI by using the services of the I/O Library.
 | 
			
		||||
#
 | 
			
		||||
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
# 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
 | 
			
		||||
@ -18,7 +18,7 @@
 | 
			
		||||
  MODULE_UNI_FILE                = CpuIoPei.uni
 | 
			
		||||
  FILE_GUID                      = AE265864-CF5D-41a8-913D-71C155E76442
 | 
			
		||||
  MODULE_TYPE                    = PEIM
 | 
			
		||||
  VERSION_STRING                 = 1.0  
 | 
			
		||||
  VERSION_STRING                 = 1.0
 | 
			
		||||
  ENTRY_POINT                    = CpuIoInitialize
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
@ -30,7 +30,7 @@
 | 
			
		||||
[Sources]
 | 
			
		||||
  CpuIoPei.c
 | 
			
		||||
  CpuIoPei.h
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
[Packages]
 | 
			
		||||
  MdePkg/MdePkg.dec
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -3,13 +3,13 @@
 | 
			
		||||
//
 | 
			
		||||
// Produces the CPU I/O PPI by using the services of the I/O Library.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// 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.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
// /** @file
 | 
			
		||||
// CpuIoPei Localized Strings and Content
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// This program and the accompanying materials
 | 
			
		||||
// are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
@ -13,8 +13,8 @@
 | 
			
		||||
//
 | 
			
		||||
// **/
 | 
			
		||||
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME 
 | 
			
		||||
#language en-US 
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME
 | 
			
		||||
#language en-US
 | 
			
		||||
"CPU I/O PEI Module"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Update and publish processors' BIST information.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -179,7 +179,7 @@ CollectBistDataFromPpi (
 | 
			
		||||
  UINTN                                 BistInformationSize;
 | 
			
		||||
  EFI_SEC_PLATFORM_INFORMATION_RECORD2  *PlatformInformationRecord2;
 | 
			
		||||
  EFI_SEC_PLATFORM_INFORMATION_CPU      *CpuInstanceInHob;
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  MpInitLibGetNumberOfProcessors(&NumberOfProcessors, &NumberOfEnabledProcessors);
 | 
			
		||||
 | 
			
		||||
@ -264,7 +264,7 @@ CollectBistDataFromPpi (
 | 
			
		||||
    CpuInstanceInHob[ProcessorNumber].CpuLocation = (UINT32) ProcessorInfo.ProcessorId;
 | 
			
		||||
    CpuInstanceInHob[ProcessorNumber].InfoRecord.IA32HealthFlags = BistData;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Build SecPlatformInformation2 PPI GUIDed HOB that also could be consumed
 | 
			
		||||
  // by CPU MP driver to get CPU BIST data
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  CPU PEI Module installs CPU Multiple Processor PPI.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -446,7 +446,7 @@ CpuMpPeimInit (
 | 
			
		||||
  }
 | 
			
		||||
  Status = InitializeCpuExceptionHandlers (VectorInfo);
 | 
			
		||||
  ASSERT_EFI_ERROR (Status);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Wakeup APs to do initialization
 | 
			
		||||
  //
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
  Local APIC library assumes local APIC is enabled. It does not
 | 
			
		||||
  handles cases where local APIC is disabled.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -82,7 +82,7 @@ SetApicMode (
 | 
			
		||||
  Get the initial local APIC ID of the executing processor assigned by hardware upon power on or reset.
 | 
			
		||||
 | 
			
		||||
  In xAPIC mode, the initial local APIC ID may be different from current APIC ID.
 | 
			
		||||
  In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 
 | 
			
		||||
  In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case,
 | 
			
		||||
  the 32-bit local APIC ID is returned as initial APIC ID.
 | 
			
		||||
 | 
			
		||||
  @return  32-bit initial local APIC ID of the executing processor.
 | 
			
		||||
@ -118,7 +118,7 @@ GetApicVersion (
 | 
			
		||||
/**
 | 
			
		||||
  Send a Fixed IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   The local APIC ID of the target processor.
 | 
			
		||||
  @param  Vector   The vector number of the interrupt being sent.
 | 
			
		||||
@ -133,7 +133,7 @@ SendFixedIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send a Fixed IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
 | 
			
		||||
  @param  Vector   The vector number of the interrupt being sent.
 | 
			
		||||
**/
 | 
			
		||||
@ -146,7 +146,7 @@ SendFixedIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send a SMI IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   Specify the local APIC ID of the target processor.
 | 
			
		||||
**/
 | 
			
		||||
@ -159,7 +159,7 @@ SendSmiIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send a SMI IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
**/
 | 
			
		||||
VOID
 | 
			
		||||
EFIAPI
 | 
			
		||||
@ -170,7 +170,7 @@ SendSmiIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   Specify the local APIC ID of the target processor.
 | 
			
		||||
**/
 | 
			
		||||
@ -183,7 +183,7 @@ SendInitIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
**/
 | 
			
		||||
VOID
 | 
			
		||||
EFIAPI
 | 
			
		||||
@ -194,7 +194,7 @@ SendInitIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT-Start-up-Start-up IPI sequence to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  if StartupRoutine >= 1M, then ASSERT.
 | 
			
		||||
  if StartupRoutine is not multiple of 4K, then ASSERT.
 | 
			
		||||
@ -213,7 +213,7 @@ SendInitSipiSipi (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT-Start-up-Start-up IPI sequence to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
 | 
			
		||||
  if StartupRoutine >= 1M, then ASSERT.
 | 
			
		||||
  if StartupRoutine is not multiple of 4K, then ASSERT.
 | 
			
		||||
@ -363,27 +363,27 @@ SendApicEoi (
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Get the 32-bit address that a device should use to send a Message Signaled 
 | 
			
		||||
  Get the 32-bit address that a device should use to send a Message Signaled
 | 
			
		||||
  Interrupt (MSI) to the Local APIC of the currently executing processor.
 | 
			
		||||
 | 
			
		||||
  @return 32-bit address used to send an MSI to the Local APIC.
 | 
			
		||||
**/
 | 
			
		||||
UINT32
 | 
			
		||||
EFIAPI    
 | 
			
		||||
EFIAPI
 | 
			
		||||
GetApicMsiAddress (
 | 
			
		||||
  VOID
 | 
			
		||||
  );
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Get the 64-bit data value that a device should use to send a Message Signaled 
 | 
			
		||||
  Get the 64-bit data value that a device should use to send a Message Signaled
 | 
			
		||||
  Interrupt (MSI) to the Local APIC of the currently executing processor.
 | 
			
		||||
 | 
			
		||||
  If Vector is not in range 0x10..0xFE, then ASSERT().
 | 
			
		||||
  If DeliveryMode is not supported, then ASSERT().
 | 
			
		||||
  
 | 
			
		||||
  @param  Vector          The 8-bit interrupt vector associated with the MSI.  
 | 
			
		||||
 | 
			
		||||
  @param  Vector          The 8-bit interrupt vector associated with the MSI.
 | 
			
		||||
                          Must be in the range 0x10..0xFE
 | 
			
		||||
  @param  DeliveryMode    A 3-bit value that specifies how the recept of the MSI 
 | 
			
		||||
  @param  DeliveryMode    A 3-bit value that specifies how the recept of the MSI
 | 
			
		||||
                          is handled.  The only supported values are:
 | 
			
		||||
                            0: LOCAL_APIC_DELIVERY_MODE_FIXED
 | 
			
		||||
                            1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY
 | 
			
		||||
@ -391,19 +391,19 @@ GetApicMsiAddress (
 | 
			
		||||
                            4: LOCAL_APIC_DELIVERY_MODE_NMI
 | 
			
		||||
                            5: LOCAL_APIC_DELIVERY_MODE_INIT
 | 
			
		||||
                            7: LOCAL_APIC_DELIVERY_MODE_EXTINT
 | 
			
		||||
                          
 | 
			
		||||
  @param  LevelTriggered  TRUE specifies a level triggered interrupt.  
 | 
			
		||||
 | 
			
		||||
  @param  LevelTriggered  TRUE specifies a level triggered interrupt.
 | 
			
		||||
                          FALSE specifies an edge triggered interrupt.
 | 
			
		||||
  @param  AssertionLevel  Ignored if LevelTriggered is FALSE.
 | 
			
		||||
                          TRUE specifies a level triggered interrupt that active 
 | 
			
		||||
                          TRUE specifies a level triggered interrupt that active
 | 
			
		||||
                          when the interrupt line is asserted.
 | 
			
		||||
                          FALSE specifies a level triggered interrupt that active 
 | 
			
		||||
                          FALSE specifies a level triggered interrupt that active
 | 
			
		||||
                          when the interrupt line is deasserted.
 | 
			
		||||
 | 
			
		||||
  @return 64-bit data value used to send an MSI to the Local APIC.
 | 
			
		||||
**/
 | 
			
		||||
UINT64
 | 
			
		||||
EFIAPI    
 | 
			
		||||
EFIAPI
 | 
			
		||||
GetApicMsiValue (
 | 
			
		||||
  IN UINT8    Vector,
 | 
			
		||||
  IN UINTN    DeliveryMode,
 | 
			
		||||
@ -431,6 +431,6 @@ GetProcessorLocationByApicId (
 | 
			
		||||
  OUT UINT32  *Core    OPTIONAL,
 | 
			
		||||
  OUT UINT32  *Thread  OPTIONAL
 | 
			
		||||
  );
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -8,10 +8,10 @@
 | 
			
		||||
#  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.
 | 
			
		||||
#  
 | 
			
		||||
#
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
[Defines]
 | 
			
		||||
@ -21,7 +21,7 @@
 | 
			
		||||
  FILE_GUID                      = 34C24FD7-7A90-45c2-89FD-946473D9CE98
 | 
			
		||||
  MODULE_TYPE                    = BASE
 | 
			
		||||
  VERSION_STRING                 = 1.0
 | 
			
		||||
  LIBRARY_CLASS                  = UefiCpuLib 
 | 
			
		||||
  LIBRARY_CLASS                  = UefiCpuLib
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# The following information is for reference only and not required by the build tools.
 | 
			
		||||
 | 
			
		||||
@ -3,13 +3,13 @@
 | 
			
		||||
//
 | 
			
		||||
// The library routines are UEFI specification compliant.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// 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.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
#------------------------------------------------------------------------------
 | 
			
		||||
#*
 | 
			
		||||
#*   Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#*   Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#*   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
 | 
			
		||||
@ -13,7 +13,7 @@
 | 
			
		||||
#------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Float control word initial value: 
 | 
			
		||||
# Float control word initial value:
 | 
			
		||||
# all exceptions masked, double-precision, round-to-nearest
 | 
			
		||||
#
 | 
			
		||||
ASM_PFX(mFpuControlWord): .word     0x027F
 | 
			
		||||
@ -41,7 +41,7 @@ ASM_PFX(InitializeFloatingPointUnits):
 | 
			
		||||
    #
 | 
			
		||||
    finit
 | 
			
		||||
    fldcw   ASM_PFX(mFpuControlWord)
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    #
 | 
			
		||||
    # Use CpuId instructuion (CPUID.01H:EDX.SSE[bit 25] = 1) to test
 | 
			
		||||
    # whether the processor supports SSE instruction.
 | 
			
		||||
@ -50,14 +50,14 @@ ASM_PFX(InitializeFloatingPointUnits):
 | 
			
		||||
    cpuid
 | 
			
		||||
    btl     $25, %edx
 | 
			
		||||
    jnc     Done
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    #
 | 
			
		||||
    # Set OSFXSR bit 9 in CR4
 | 
			
		||||
    #
 | 
			
		||||
    movl    %cr4, %eax 
 | 
			
		||||
    movl    %cr4, %eax
 | 
			
		||||
    or      $0x200, %eax
 | 
			
		||||
    movl    %eax, %cr4
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    #
 | 
			
		||||
    # The processor should support SSE instruction and we can use
 | 
			
		||||
    # ldmxcsr instruction
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
#------------------------------------------------------------------------------
 | 
			
		||||
#*
 | 
			
		||||
#*   Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#*   Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#*   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
 | 
			
		||||
@ -27,31 +27,31 @@ ASM_PFX(InitializeFloatingPointUnits):
 | 
			
		||||
    # Initialize floating point units
 | 
			
		||||
    #
 | 
			
		||||
    finit
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    #
 | 
			
		||||
    # Float control word initial value: 
 | 
			
		||||
    # Float control word initial value:
 | 
			
		||||
    # all exceptions masked, double-precision, round-to-nearest
 | 
			
		||||
    #
 | 
			
		||||
    pushq   $0x037F
 | 
			
		||||
    lea     (%rsp), %rax 
 | 
			
		||||
    lea     (%rsp), %rax
 | 
			
		||||
    fldcw   (%rax)
 | 
			
		||||
    popq    %rax
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    #
 | 
			
		||||
    # Set OSFXSR bit 9 in CR4
 | 
			
		||||
    #
 | 
			
		||||
    movq    %cr4, %rax 
 | 
			
		||||
    movq    %cr4, %rax
 | 
			
		||||
    or      $0x200, %rax
 | 
			
		||||
    movq    %rax, %cr4
 | 
			
		||||
 | 
			
		||||
    #
 | 
			
		||||
    # Multimedia-extensions control word:
 | 
			
		||||
    # all exceptions masked, round-to-nearest, flush to zero for masked underflow
 | 
			
		||||
    #    
 | 
			
		||||
    #
 | 
			
		||||
    pushq   $0x01F80
 | 
			
		||||
    lea     (%rsp), %rax
 | 
			
		||||
    ldmxcsr (%rax)
 | 
			
		||||
    popq    %rax
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    ret
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@
 | 
			
		||||
 | 
			
		||||
  This local APIC library instance supports xAPIC mode only.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
 | 
			
		||||
 | 
			
		||||
  This program and the accompanying materials
 | 
			
		||||
@ -68,12 +68,12 @@ LocalApicBaseAddressMsrSupported (
 | 
			
		||||
{
 | 
			
		||||
  UINT32  RegEax;
 | 
			
		||||
  UINTN   FamilyId;
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  AsmCpuid (1, &RegEax, NULL, NULL, NULL);
 | 
			
		||||
  FamilyId = BitFieldRead32 (RegEax, 8, 11);
 | 
			
		||||
  if (FamilyId == 0x04 || FamilyId == 0x05) {
 | 
			
		||||
    //
 | 
			
		||||
    // CPUs with a FamilyId of 0x04 or 0x05 do not support the 
 | 
			
		||||
    // CPUs with a FamilyId of 0x04 or 0x05 do not support the
 | 
			
		||||
    // Local APIC Base Address MSR
 | 
			
		||||
    //
 | 
			
		||||
    return FALSE;
 | 
			
		||||
@ -104,7 +104,7 @@ GetLocalApicBaseAddress (
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  return (UINTN)(LShiftU64 ((UINT64) ApicBaseMsr.Bits.ApicBaseHi, 32)) +
 | 
			
		||||
           (((UINTN)ApicBaseMsr.Bits.ApicBase) << 12);
 | 
			
		||||
}
 | 
			
		||||
@ -197,7 +197,7 @@ WriteLocalApicReg (
 | 
			
		||||
/**
 | 
			
		||||
  Send an IPI by writing to ICR.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  IcrLow 32-bit value to be written to the low half of ICR.
 | 
			
		||||
  @param  ApicId APIC ID of the target processor if this IPI is targeted for a specific processor.
 | 
			
		||||
@ -275,7 +275,7 @@ GetApicMode (
 | 
			
		||||
      MSR_IA32_APIC_BASE_REGISTER  ApicBaseMsr;
 | 
			
		||||
 | 
			
		||||
      //
 | 
			
		||||
      // Check to see if the CPU supports the APIC Base Address MSR 
 | 
			
		||||
      // Check to see if the CPU supports the APIC Base Address MSR
 | 
			
		||||
      //
 | 
			
		||||
      if (LocalApicBaseAddressMsrSupported ()) {
 | 
			
		||||
        ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE);
 | 
			
		||||
@ -315,7 +315,7 @@ SetApicMode (
 | 
			
		||||
  Get the initial local APIC ID of the executing processor assigned by hardware upon power on or reset.
 | 
			
		||||
 | 
			
		||||
  In xAPIC mode, the initial local APIC ID may be different from current APIC ID.
 | 
			
		||||
  In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 
 | 
			
		||||
  In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case,
 | 
			
		||||
  the 32-bit local APIC ID is returned as initial APIC ID.
 | 
			
		||||
 | 
			
		||||
  @return  32-bit initial local APIC ID of the executing processor.
 | 
			
		||||
@ -338,7 +338,7 @@ GetInitialApicId (
 | 
			
		||||
  AsmCpuid (CPUID_SIGNATURE, &MaxCpuIdIndex, NULL, NULL, NULL);
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // If CPUID Leaf B is supported, 
 | 
			
		||||
  // If CPUID Leaf B is supported,
 | 
			
		||||
  // And CPUID.0BH:EBX[15:0] reports a non-zero value,
 | 
			
		||||
  // Then the initial 32-bit APIC ID = CPUID.0BH:EDX
 | 
			
		||||
  // Else the initial 8-bit APIC ID = CPUID.1:EBX[31:24]
 | 
			
		||||
@ -368,7 +368,7 @@ GetApicId (
 | 
			
		||||
  UINT32 ApicId;
 | 
			
		||||
 | 
			
		||||
  ASSERT (GetApicMode () == LOCAL_APIC_MODE_XAPIC);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  if ((ApicId = GetInitialApicId ()) < 0x100) {
 | 
			
		||||
    //
 | 
			
		||||
    // If the initial local APIC ID is less 0x100, read APIC ID from
 | 
			
		||||
@ -397,7 +397,7 @@ GetApicVersion (
 | 
			
		||||
/**
 | 
			
		||||
  Send a Fixed IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   The local APIC ID of the target processor.
 | 
			
		||||
  @param  Vector   The vector number of the interrupt being sent.
 | 
			
		||||
@ -421,7 +421,7 @@ SendFixedIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send a Fixed IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
 | 
			
		||||
  @param  Vector   The vector number of the interrupt being sent.
 | 
			
		||||
**/
 | 
			
		||||
@ -444,7 +444,7 @@ SendFixedIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send a SMI IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   Specify the local APIC ID of the target processor.
 | 
			
		||||
**/
 | 
			
		||||
@ -465,7 +465,7 @@ SendSmiIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send a SMI IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
**/
 | 
			
		||||
VOID
 | 
			
		||||
EFIAPI
 | 
			
		||||
@ -485,7 +485,7 @@ SendSmiIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   Specify the local APIC ID of the target processor.
 | 
			
		||||
**/
 | 
			
		||||
@ -506,7 +506,7 @@ SendInitIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
**/
 | 
			
		||||
VOID
 | 
			
		||||
EFIAPI
 | 
			
		||||
@ -526,7 +526,7 @@ SendInitIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT-Start-up-Start-up IPI sequence to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  if StartupRoutine >= 1M, then ASSERT.
 | 
			
		||||
  if StartupRoutine is not multiple of 4K, then ASSERT.
 | 
			
		||||
@ -563,7 +563,7 @@ SendInitSipiSipi (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT-Start-up-Start-up IPI sequence to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
 | 
			
		||||
  if StartupRoutine >= 1M, then ASSERT.
 | 
			
		||||
  if StartupRoutine is not multiple of 4K, then ASSERT.
 | 
			
		||||
@ -767,7 +767,7 @@ InitializeApicTimer (
 | 
			
		||||
    Dcr.Uint32 = ReadLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET);
 | 
			
		||||
    Dcr.Bits.DivideValue1 = (Divisor & 0x3);
 | 
			
		||||
    Dcr.Bits.DivideValue2 = (Divisor >> 2);
 | 
			
		||||
    WriteLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET, Dcr.Uint32); 
 | 
			
		||||
    WriteLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET, Dcr.Uint32);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
@ -897,13 +897,13 @@ SendApicEoi (
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Get the 32-bit address that a device should use to send a Message Signaled 
 | 
			
		||||
  Get the 32-bit address that a device should use to send a Message Signaled
 | 
			
		||||
  Interrupt (MSI) to the Local APIC of the currently executing processor.
 | 
			
		||||
 | 
			
		||||
  @return 32-bit address used to send an MSI to the Local APIC.
 | 
			
		||||
**/
 | 
			
		||||
UINT32
 | 
			
		||||
EFIAPI    
 | 
			
		||||
EFIAPI
 | 
			
		||||
GetApicMsiAddress (
 | 
			
		||||
  VOID
 | 
			
		||||
  )
 | 
			
		||||
@ -911,7 +911,7 @@ GetApicMsiAddress (
 | 
			
		||||
  LOCAL_APIC_MSI_ADDRESS  MsiAddress;
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Return address for an MSI interrupt to be delivered only to the APIC ID 
 | 
			
		||||
  // Return address for an MSI interrupt to be delivered only to the APIC ID
 | 
			
		||||
  // of the currently executing processor.
 | 
			
		||||
  //
 | 
			
		||||
  MsiAddress.Uint32             = 0;
 | 
			
		||||
@ -919,17 +919,17 @@ GetApicMsiAddress (
 | 
			
		||||
  MsiAddress.Bits.DestinationId = GetApicId ();
 | 
			
		||||
  return MsiAddress.Uint32;
 | 
			
		||||
}
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Get the 64-bit data value that a device should use to send a Message Signaled 
 | 
			
		||||
  Get the 64-bit data value that a device should use to send a Message Signaled
 | 
			
		||||
  Interrupt (MSI) to the Local APIC of the currently executing processor.
 | 
			
		||||
 | 
			
		||||
  If Vector is not in range 0x10..0xFE, then ASSERT().
 | 
			
		||||
  If DeliveryMode is not supported, then ASSERT().
 | 
			
		||||
  
 | 
			
		||||
  @param  Vector          The 8-bit interrupt vector associated with the MSI.  
 | 
			
		||||
 | 
			
		||||
  @param  Vector          The 8-bit interrupt vector associated with the MSI.
 | 
			
		||||
                          Must be in the range 0x10..0xFE
 | 
			
		||||
  @param  DeliveryMode    A 3-bit value that specifies how the recept of the MSI 
 | 
			
		||||
  @param  DeliveryMode    A 3-bit value that specifies how the recept of the MSI
 | 
			
		||||
                          is handled.  The only supported values are:
 | 
			
		||||
                            0: LOCAL_APIC_DELIVERY_MODE_FIXED
 | 
			
		||||
                            1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY
 | 
			
		||||
@ -937,19 +937,19 @@ GetApicMsiAddress (
 | 
			
		||||
                            4: LOCAL_APIC_DELIVERY_MODE_NMI
 | 
			
		||||
                            5: LOCAL_APIC_DELIVERY_MODE_INIT
 | 
			
		||||
                            7: LOCAL_APIC_DELIVERY_MODE_EXTINT
 | 
			
		||||
                          
 | 
			
		||||
  @param  LevelTriggered  TRUE specifies a level triggered interrupt.  
 | 
			
		||||
 | 
			
		||||
  @param  LevelTriggered  TRUE specifies a level triggered interrupt.
 | 
			
		||||
                          FALSE specifies an edge triggered interrupt.
 | 
			
		||||
  @param  AssertionLevel  Ignored if LevelTriggered is FALSE.
 | 
			
		||||
                          TRUE specifies a level triggered interrupt that active 
 | 
			
		||||
                          TRUE specifies a level triggered interrupt that active
 | 
			
		||||
                          when the interrupt line is asserted.
 | 
			
		||||
                          FALSE specifies a level triggered interrupt that active 
 | 
			
		||||
                          FALSE specifies a level triggered interrupt that active
 | 
			
		||||
                          when the interrupt line is deasserted.
 | 
			
		||||
 | 
			
		||||
  @return 64-bit data value used to send an MSI to the Local APIC.
 | 
			
		||||
**/
 | 
			
		||||
UINT64
 | 
			
		||||
EFIAPI    
 | 
			
		||||
EFIAPI
 | 
			
		||||
GetApicMsiValue (
 | 
			
		||||
  IN UINT8    Vector,
 | 
			
		||||
  IN UINTN    DeliveryMode,
 | 
			
		||||
@ -961,7 +961,7 @@ GetApicMsiValue (
 | 
			
		||||
 | 
			
		||||
  ASSERT (Vector >= 0x10 && Vector <= 0xFE);
 | 
			
		||||
  ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  MsiData.Uint64            = 0;
 | 
			
		||||
  MsiData.Bits.Vector       = Vector;
 | 
			
		||||
  MsiData.Bits.DeliveryMode = (UINT32)DeliveryMode;
 | 
			
		||||
 | 
			
		||||
@ -4,15 +4,15 @@
 | 
			
		||||
#  Note: Local APIC library assumes local APIC is enabled. It does not handle cases
 | 
			
		||||
#  where local APIC is disabled.
 | 
			
		||||
#
 | 
			
		||||
#  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  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.
 | 
			
		||||
#  
 | 
			
		||||
#
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
[Defines]
 | 
			
		||||
@ -22,7 +22,7 @@
 | 
			
		||||
  FILE_GUID                      = D87CA0A8-1AC2-439b-90F8-EF4A2AC88DAF
 | 
			
		||||
  MODULE_TYPE                    = BASE
 | 
			
		||||
  VERSION_STRING                 = 1.1
 | 
			
		||||
  LIBRARY_CLASS                  = LocalApicLib 
 | 
			
		||||
  LIBRARY_CLASS                  = LocalApicLib
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# The following information is for reference only and not required by the build tools.
 | 
			
		||||
 | 
			
		||||
@ -4,13 +4,13 @@
 | 
			
		||||
// Note: Local APIC library assumes local APIC is enabled. It does not handle cases
 | 
			
		||||
// where local APIC is disabled.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// 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.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
  This local APIC library instance supports x2APIC capable processors
 | 
			
		||||
  which have xAPIC and x2APIC modes.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
 | 
			
		||||
 | 
			
		||||
  This program and the accompanying materials
 | 
			
		||||
@ -69,12 +69,12 @@ LocalApicBaseAddressMsrSupported (
 | 
			
		||||
{
 | 
			
		||||
  UINT32  RegEax;
 | 
			
		||||
  UINTN   FamilyId;
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  AsmCpuid (1, &RegEax, NULL, NULL, NULL);
 | 
			
		||||
  FamilyId = BitFieldRead32 (RegEax, 8, 11);
 | 
			
		||||
  if (FamilyId == 0x04 || FamilyId == 0x05) {
 | 
			
		||||
    //
 | 
			
		||||
    // CPUs with a FamilyId of 0x04 or 0x05 do not support the 
 | 
			
		||||
    // CPUs with a FamilyId of 0x04 or 0x05 do not support the
 | 
			
		||||
    // Local APIC Base Address MSR
 | 
			
		||||
    //
 | 
			
		||||
    return FALSE;
 | 
			
		||||
@ -105,7 +105,7 @@ GetLocalApicBaseAddress (
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  return (UINTN)(LShiftU64 ((UINT64) ApicBaseMsr.Bits.ApicBaseHi, 32)) +
 | 
			
		||||
           (((UINTN)ApicBaseMsr.Bits.ApicBase) << 12);
 | 
			
		||||
}
 | 
			
		||||
@ -236,7 +236,7 @@ WriteLocalApicReg (
 | 
			
		||||
/**
 | 
			
		||||
  Send an IPI by writing to ICR.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  IcrLow 32-bit value to be written to the low half of ICR.
 | 
			
		||||
  @param  ApicId APIC ID of the target processor if this IPI is targeted for a specific processor.
 | 
			
		||||
@ -301,7 +301,7 @@ SendIpi (
 | 
			
		||||
 | 
			
		||||
  } else {
 | 
			
		||||
    //
 | 
			
		||||
    // For x2APIC, A single MSR write to the Interrupt Command Register is required for dispatching an 
 | 
			
		||||
    // For x2APIC, A single MSR write to the Interrupt Command Register is required for dispatching an
 | 
			
		||||
    // interrupt in x2APIC mode.
 | 
			
		||||
    //
 | 
			
		||||
    MsrValue = LShiftU64 ((UINT64) ApicId, 32) | IcrLow;
 | 
			
		||||
@ -414,7 +414,7 @@ SetApicMode (
 | 
			
		||||
  Get the initial local APIC ID of the executing processor assigned by hardware upon power on or reset.
 | 
			
		||||
 | 
			
		||||
  In xAPIC mode, the initial local APIC ID may be different from current APIC ID.
 | 
			
		||||
  In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 
 | 
			
		||||
  In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case,
 | 
			
		||||
  the 32-bit local APIC ID is returned as initial APIC ID.
 | 
			
		||||
 | 
			
		||||
  @return  32-bit initial local APIC ID of the executing processor.
 | 
			
		||||
@ -435,7 +435,7 @@ GetInitialApicId (
 | 
			
		||||
    //
 | 
			
		||||
    AsmCpuid (CPUID_SIGNATURE, &MaxCpuIdIndex, NULL, NULL, NULL);
 | 
			
		||||
    //
 | 
			
		||||
    // If CPUID Leaf B is supported, 
 | 
			
		||||
    // If CPUID Leaf B is supported,
 | 
			
		||||
    // And CPUID.0BH:EBX[15:0] reports a non-zero value,
 | 
			
		||||
    // Then the initial 32-bit APIC ID = CPUID.0BH:EDX
 | 
			
		||||
    // Else the initial 8-bit APIC ID = CPUID.1:EBX[31:24]
 | 
			
		||||
@ -492,7 +492,7 @@ GetApicVersion (
 | 
			
		||||
/**
 | 
			
		||||
  Send a Fixed IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   The local APIC ID of the target processor.
 | 
			
		||||
  @param  Vector   The vector number of the interrupt being sent.
 | 
			
		||||
@ -516,7 +516,7 @@ SendFixedIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send a Fixed IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
 | 
			
		||||
  @param  Vector   The vector number of the interrupt being sent.
 | 
			
		||||
**/
 | 
			
		||||
@ -539,7 +539,7 @@ SendFixedIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send a SMI IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   Specify the local APIC ID of the target processor.
 | 
			
		||||
**/
 | 
			
		||||
@ -560,7 +560,7 @@ SendSmiIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send a SMI IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
**/
 | 
			
		||||
VOID
 | 
			
		||||
EFIAPI
 | 
			
		||||
@ -580,7 +580,7 @@ SendSmiIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT IPI to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  @param  ApicId   Specify the local APIC ID of the target processor.
 | 
			
		||||
**/
 | 
			
		||||
@ -601,7 +601,7 @@ SendInitIpi (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT IPI to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
**/
 | 
			
		||||
VOID
 | 
			
		||||
EFIAPI
 | 
			
		||||
@ -621,7 +621,7 @@ SendInitIpiAllExcludingSelf (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT-Start-up-Start-up IPI sequence to a specified target processor.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processor.
 | 
			
		||||
 | 
			
		||||
  if StartupRoutine >= 1M, then ASSERT.
 | 
			
		||||
  if StartupRoutine is not multiple of 4K, then ASSERT.
 | 
			
		||||
@ -658,7 +658,7 @@ SendInitSipiSipi (
 | 
			
		||||
/**
 | 
			
		||||
  Send an INIT-Start-up-Start-up IPI sequence to all processors excluding self.
 | 
			
		||||
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors. 
 | 
			
		||||
  This function returns after the IPI has been accepted by the target processors.
 | 
			
		||||
 | 
			
		||||
  if StartupRoutine >= 1M, then ASSERT.
 | 
			
		||||
  if StartupRoutine is not multiple of 4K, then ASSERT.
 | 
			
		||||
@ -862,7 +862,7 @@ InitializeApicTimer (
 | 
			
		||||
    Dcr.Uint32 = ReadLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET);
 | 
			
		||||
    Dcr.Bits.DivideValue1 = (Divisor & 0x3);
 | 
			
		||||
    Dcr.Bits.DivideValue2 = (Divisor >> 2);
 | 
			
		||||
    WriteLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET, Dcr.Uint32); 
 | 
			
		||||
    WriteLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET, Dcr.Uint32);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
@ -992,13 +992,13 @@ SendApicEoi (
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Get the 32-bit address that a device should use to send a Message Signaled 
 | 
			
		||||
  Get the 32-bit address that a device should use to send a Message Signaled
 | 
			
		||||
  Interrupt (MSI) to the Local APIC of the currently executing processor.
 | 
			
		||||
 | 
			
		||||
  @return 32-bit address used to send an MSI to the Local APIC.
 | 
			
		||||
**/
 | 
			
		||||
UINT32
 | 
			
		||||
EFIAPI    
 | 
			
		||||
EFIAPI
 | 
			
		||||
GetApicMsiAddress (
 | 
			
		||||
  VOID
 | 
			
		||||
  )
 | 
			
		||||
@ -1006,7 +1006,7 @@ GetApicMsiAddress (
 | 
			
		||||
  LOCAL_APIC_MSI_ADDRESS  MsiAddress;
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Return address for an MSI interrupt to be delivered only to the APIC ID 
 | 
			
		||||
  // Return address for an MSI interrupt to be delivered only to the APIC ID
 | 
			
		||||
  // of the currently executing processor.
 | 
			
		||||
  //
 | 
			
		||||
  MsiAddress.Uint32             = 0;
 | 
			
		||||
@ -1014,17 +1014,17 @@ GetApicMsiAddress (
 | 
			
		||||
  MsiAddress.Bits.DestinationId = GetApicId ();
 | 
			
		||||
  return MsiAddress.Uint32;
 | 
			
		||||
}
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Get the 64-bit data value that a device should use to send a Message Signaled 
 | 
			
		||||
  Get the 64-bit data value that a device should use to send a Message Signaled
 | 
			
		||||
  Interrupt (MSI) to the Local APIC of the currently executing processor.
 | 
			
		||||
 | 
			
		||||
  If Vector is not in range 0x10..0xFE, then ASSERT().
 | 
			
		||||
  If DeliveryMode is not supported, then ASSERT().
 | 
			
		||||
  
 | 
			
		||||
  @param  Vector          The 8-bit interrupt vector associated with the MSI.  
 | 
			
		||||
 | 
			
		||||
  @param  Vector          The 8-bit interrupt vector associated with the MSI.
 | 
			
		||||
                          Must be in the range 0x10..0xFE
 | 
			
		||||
  @param  DeliveryMode    A 3-bit value that specifies how the recept of the MSI 
 | 
			
		||||
  @param  DeliveryMode    A 3-bit value that specifies how the recept of the MSI
 | 
			
		||||
                          is handled.  The only supported values are:
 | 
			
		||||
                            0: LOCAL_APIC_DELIVERY_MODE_FIXED
 | 
			
		||||
                            1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY
 | 
			
		||||
@ -1032,19 +1032,19 @@ GetApicMsiAddress (
 | 
			
		||||
                            4: LOCAL_APIC_DELIVERY_MODE_NMI
 | 
			
		||||
                            5: LOCAL_APIC_DELIVERY_MODE_INIT
 | 
			
		||||
                            7: LOCAL_APIC_DELIVERY_MODE_EXTINT
 | 
			
		||||
                          
 | 
			
		||||
  @param  LevelTriggered  TRUE specifies a level triggered interrupt.  
 | 
			
		||||
 | 
			
		||||
  @param  LevelTriggered  TRUE specifies a level triggered interrupt.
 | 
			
		||||
                          FALSE specifies an edge triggered interrupt.
 | 
			
		||||
  @param  AssertionLevel  Ignored if LevelTriggered is FALSE.
 | 
			
		||||
                          TRUE specifies a level triggered interrupt that active 
 | 
			
		||||
                          TRUE specifies a level triggered interrupt that active
 | 
			
		||||
                          when the interrupt line is asserted.
 | 
			
		||||
                          FALSE specifies a level triggered interrupt that active 
 | 
			
		||||
                          FALSE specifies a level triggered interrupt that active
 | 
			
		||||
                          when the interrupt line is deasserted.
 | 
			
		||||
 | 
			
		||||
  @return 64-bit data value used to send an MSI to the Local APIC.
 | 
			
		||||
**/
 | 
			
		||||
UINT64
 | 
			
		||||
EFIAPI    
 | 
			
		||||
EFIAPI
 | 
			
		||||
GetApicMsiValue (
 | 
			
		||||
  IN UINT8    Vector,
 | 
			
		||||
  IN UINTN    DeliveryMode,
 | 
			
		||||
@ -1056,7 +1056,7 @@ GetApicMsiValue (
 | 
			
		||||
 | 
			
		||||
  ASSERT (Vector >= 0x10 && Vector <= 0xFE);
 | 
			
		||||
  ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  MsiData.Uint64            = 0;
 | 
			
		||||
  MsiData.Bits.Vector       = Vector;
 | 
			
		||||
  MsiData.Bits.DeliveryMode = (UINT32)DeliveryMode;
 | 
			
		||||
 | 
			
		||||
@ -4,15 +4,15 @@
 | 
			
		||||
#  Note: Local APIC library assumes local APIC is enabled. It does not handle cases
 | 
			
		||||
#  where local APIC is disabled.
 | 
			
		||||
#
 | 
			
		||||
#  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  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.
 | 
			
		||||
#  
 | 
			
		||||
#
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
[Defines]
 | 
			
		||||
@ -22,7 +22,7 @@
 | 
			
		||||
  FILE_GUID                      = 967B6E05-F10D-4c10-8BF7-365291CA143F
 | 
			
		||||
  MODULE_TYPE                    = BASE
 | 
			
		||||
  VERSION_STRING                 = 1.1
 | 
			
		||||
  LIBRARY_CLASS                  = LocalApicLib 
 | 
			
		||||
  LIBRARY_CLASS                  = LocalApicLib
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# The following information is for reference only and not required by the build tools.
 | 
			
		||||
 | 
			
		||||
@ -4,13 +4,13 @@
 | 
			
		||||
// Note: Local APIC library assumes local APIC is enabled. It does not handle cases
 | 
			
		||||
// where local APIC is disabled.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// 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.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  CPU Common features library header file.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -855,7 +855,7 @@ FeatureControlGetConfigData (
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Detects if Protected Processor Inventory Number feature supported on current 
 | 
			
		||||
  Detects if Protected Processor Inventory Number feature supported on current
 | 
			
		||||
  processor.
 | 
			
		||||
 | 
			
		||||
  @param[in]  ProcessorNumber  The index of the CPU executing this function.
 | 
			
		||||
@ -889,14 +889,14 @@ PpinSupport (
 | 
			
		||||
                               by CPU_FEATURE_GET_CONFIG_DATA.  NULL if
 | 
			
		||||
                               CPU_FEATURE_GET_CONFIG_DATA was not provided in
 | 
			
		||||
                               RegisterCpuFeature().
 | 
			
		||||
  @param[in]  State            If TRUE, then the Protected Processor Inventory 
 | 
			
		||||
  @param[in]  State            If TRUE, then the Protected Processor Inventory
 | 
			
		||||
                               Number feature must be enabled.
 | 
			
		||||
                               If FALSE, then the Protected Processor Inventory 
 | 
			
		||||
                               If FALSE, then the Protected Processor Inventory
 | 
			
		||||
                               Number feature must be disabled.
 | 
			
		||||
 | 
			
		||||
  @retval RETURN_SUCCESS       Protected Processor Inventory Number feature is 
 | 
			
		||||
  @retval RETURN_SUCCESS       Protected Processor Inventory Number feature is
 | 
			
		||||
                               initialized.
 | 
			
		||||
  @retval RETURN_DEVICE_ERROR  Device can't change state because it has been 
 | 
			
		||||
  @retval RETURN_DEVICE_ERROR  Device can't change state because it has been
 | 
			
		||||
                               locked.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
@ -910,7 +910,7 @@ PpinInitialize (
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Detects if Local machine check exception feature supported on current 
 | 
			
		||||
  Detects if Local machine check exception feature supported on current
 | 
			
		||||
  processor.
 | 
			
		||||
 | 
			
		||||
  @param[in]  ProcessorNumber  The index of the CPU executing this function.
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
#  This library registers CPU features defined in Intel(R) 64 and IA-32
 | 
			
		||||
#  Architectures Software Developer's Manual.
 | 
			
		||||
#
 | 
			
		||||
# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#
 | 
			
		||||
#  This program and the accompanying materials
 | 
			
		||||
#  are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
@ -68,4 +68,4 @@
 | 
			
		||||
  gUefiCpuPkgTokenSpaceGuid.PcdCpuClockModulationDutyCycle   ## SOMETIMES_CONSUMES
 | 
			
		||||
  gUefiCpuPkgTokenSpaceGuid.PcdIsPowerOnReset                ## SOMETIMES_CONSUMES
 | 
			
		||||
  gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceOutputScheme      ## SOMETIMES_CONSUMES
 | 
			
		||||
  gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceMemSize           ## SOMETIMES_CONSUMES
 | 
			
		||||
  gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceMemSize           ## SOMETIMES_CONSUMES
 | 
			
		||||
 | 
			
		||||
@ -235,7 +235,7 @@ McgCtlInitialize (
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Detects if Local machine check exception feature supported on current 
 | 
			
		||||
  Detects if Local machine check exception feature supported on current
 | 
			
		||||
  processor.
 | 
			
		||||
 | 
			
		||||
  @param[in]  ProcessorNumber  The index of the CPU executing this function.
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Protected Processor Inventory Number(PPIN) feature.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -15,7 +15,7 @@
 | 
			
		||||
#include "CpuCommonFeatures.h"
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Detects if Protected Processor Inventory Number feature supported on current 
 | 
			
		||||
  Detects if Protected Processor Inventory Number feature supported on current
 | 
			
		||||
  processor.
 | 
			
		||||
 | 
			
		||||
  @param[in]  ProcessorNumber  The index of the CPU executing this function.
 | 
			
		||||
@ -41,13 +41,13 @@ PpinSupport (
 | 
			
		||||
{
 | 
			
		||||
  MSR_IVY_BRIDGE_PLATFORM_INFO_1_REGISTER    PlatformInfo;
 | 
			
		||||
 | 
			
		||||
  if ((CpuInfo->DisplayFamily == 0x06) && 
 | 
			
		||||
  if ((CpuInfo->DisplayFamily == 0x06) &&
 | 
			
		||||
      ((CpuInfo->DisplayModel == 0x3E) ||      // Xeon E5 V2
 | 
			
		||||
       (CpuInfo->DisplayModel == 0x56) ||      // Xeon Processor D Product
 | 
			
		||||
       (CpuInfo->DisplayModel == 0x4F) ||      // Xeon E5 v4, E7 v4
 | 
			
		||||
       (CpuInfo->DisplayModel == 0x55) ||      // Xeon Processor Scalable
 | 
			
		||||
       (CpuInfo->DisplayModel == 0x57) ||      // Xeon Phi processor 3200, 5200, 7200 series.
 | 
			
		||||
       (CpuInfo->DisplayModel == 0x85)         // Future Xeon phi processor 
 | 
			
		||||
       (CpuInfo->DisplayModel == 0x85)         // Future Xeon phi processor
 | 
			
		||||
     )) {
 | 
			
		||||
    //
 | 
			
		||||
    // Check whether platform support this feature.
 | 
			
		||||
@ -69,14 +69,14 @@ PpinSupport (
 | 
			
		||||
                               by CPU_FEATURE_GET_CONFIG_DATA.  NULL if
 | 
			
		||||
                               CPU_FEATURE_GET_CONFIG_DATA was not provided in
 | 
			
		||||
                               RegisterCpuFeature().
 | 
			
		||||
  @param[in]  State            If TRUE, then the Protected Processor Inventory 
 | 
			
		||||
  @param[in]  State            If TRUE, then the Protected Processor Inventory
 | 
			
		||||
                               Number feature must be enabled.
 | 
			
		||||
                               If FALSE, then the Protected Processor Inventory 
 | 
			
		||||
                               If FALSE, then the Protected Processor Inventory
 | 
			
		||||
                               Number feature must be disabled.
 | 
			
		||||
 | 
			
		||||
  @retval RETURN_SUCCESS       Protected Processor Inventory Number feature is 
 | 
			
		||||
  @retval RETURN_SUCCESS       Protected Processor Inventory Number feature is
 | 
			
		||||
                               initialized.
 | 
			
		||||
  @retval RETURN_DEVICE_ERROR  Device can't change state because it has been 
 | 
			
		||||
  @retval RETURN_DEVICE_ERROR  Device can't change state because it has been
 | 
			
		||||
                               locked.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Intel Processor Trace feature.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -16,11 +16,11 @@
 | 
			
		||||
 | 
			
		||||
///
 | 
			
		||||
/// This macro define the max entries in the Topa table.
 | 
			
		||||
/// Each entry in the table contains some attribute bits, a pointer to an output region, and the size of the region. 
 | 
			
		||||
/// The last entry in the table may hold a pointer to the next table. This pointer can either point to the top of the 
 | 
			
		||||
/// current table (for circular array) or to the base of another table. 
 | 
			
		||||
/// At least 2 entries are needed because the list of entries must 
 | 
			
		||||
/// be terminated by an entry with the END bit set to 1, so 2 
 | 
			
		||||
/// Each entry in the table contains some attribute bits, a pointer to an output region, and the size of the region.
 | 
			
		||||
/// The last entry in the table may hold a pointer to the next table. This pointer can either point to the top of the
 | 
			
		||||
/// current table (for circular array) or to the base of another table.
 | 
			
		||||
/// At least 2 entries are needed because the list of entries must
 | 
			
		||||
/// be terminated by an entry with the END bit set to 1, so 2
 | 
			
		||||
/// entries are required to use a single valid entry.
 | 
			
		||||
///
 | 
			
		||||
#define MAX_TOPA_ENTRY_COUNT         2
 | 
			
		||||
@ -43,7 +43,7 @@ typedef struct  {
 | 
			
		||||
typedef struct  {
 | 
			
		||||
  UINT32                      NumberOfProcessors;
 | 
			
		||||
 | 
			
		||||
  UINT8                       ProcTraceOutputScheme;  
 | 
			
		||||
  UINT8                       ProcTraceOutputScheme;
 | 
			
		||||
  UINT32                      ProcTraceMemSize;
 | 
			
		||||
 | 
			
		||||
  UINTN                       *ThreadMemRegionTable;
 | 
			
		||||
@ -88,7 +88,7 @@ ProcTraceGetConfigData (
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Detects if Intel Processor Trace feature supported on current 
 | 
			
		||||
  Detects if Intel Processor Trace feature supported on current
 | 
			
		||||
  processor.
 | 
			
		||||
 | 
			
		||||
  @param[in]  ProcessorNumber  The index of the CPU executing this function.
 | 
			
		||||
@ -291,7 +291,7 @@ ProcTraceInitialize (
 | 
			
		||||
  //
 | 
			
		||||
  //  Single Range output scheme
 | 
			
		||||
  //
 | 
			
		||||
  if (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported && 
 | 
			
		||||
  if (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported &&
 | 
			
		||||
      (ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeSingleRange)) {
 | 
			
		||||
    if (FirstIn) {
 | 
			
		||||
      DEBUG ((DEBUG_INFO, "ProcTrace: Enabling Single Range Output scheme \n"));
 | 
			
		||||
@ -337,7 +337,7 @@ ProcTraceInitialize (
 | 
			
		||||
  //
 | 
			
		||||
  //  ToPA(Table of physical address) scheme
 | 
			
		||||
  //
 | 
			
		||||
  if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported && 
 | 
			
		||||
  if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported &&
 | 
			
		||||
      (ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeToPA)) {
 | 
			
		||||
    //
 | 
			
		||||
    //  Create ToPA structure aligned at 4KB for each logical thread
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  CPU Exception Handler Library common functions.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -177,4 +177,4 @@ ReadAndVerifyVectorInfo (
 | 
			
		||||
    VectorInfo ++;
 | 
			
		||||
  }
 | 
			
		||||
  return EFI_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  MP initialize support functions for DXE phase.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -268,7 +268,7 @@ RelocateApLoop (
 | 
			
		||||
  ASM_RELOCATE_AP_LOOP   AsmRelocateApLoopFunc;
 | 
			
		||||
  UINTN                  ProcessorNumber;
 | 
			
		||||
 | 
			
		||||
  MpInitLibWhoAmI (&ProcessorNumber); 
 | 
			
		||||
  MpInitLibWhoAmI (&ProcessorNumber);
 | 
			
		||||
  CpuMpData    = GetCpuMpData ();
 | 
			
		||||
  MwaitSupport = IsMwaitSupport ();
 | 
			
		||||
  AsmRelocateApLoopFunc = (ASM_RELOCATE_AP_LOOP) (UINTN) mReservedApLoopFunc;
 | 
			
		||||
@ -406,7 +406,7 @@ InitMpGlobalData (
 | 
			
		||||
  //
 | 
			
		||||
  // Make sure that the buffer memory is executable if NX protection is enabled
 | 
			
		||||
  // for EfiReservedMemoryType.
 | 
			
		||||
  // 
 | 
			
		||||
  //
 | 
			
		||||
  // TODO: Check EFI_MEMORY_XP bit set or not once it's available in DXE GCD
 | 
			
		||||
  //       service.
 | 
			
		||||
  //
 | 
			
		||||
 | 
			
		||||
@ -193,11 +193,11 @@ GetNextProcNumber:
 | 
			
		||||
    jz          ProgramStack
 | 
			
		||||
    add         edi, 20
 | 
			
		||||
    inc         ebx
 | 
			
		||||
    jmp         GetNextProcNumber    
 | 
			
		||||
    jmp         GetNextProcNumber
 | 
			
		||||
 | 
			
		||||
ProgramStack:
 | 
			
		||||
    mov         esp, [edi + 12]
 | 
			
		||||
   
 | 
			
		||||
 | 
			
		||||
CProcedureInvoke:
 | 
			
		||||
    push       ebp               ; push BIST data at top of AP stack
 | 
			
		||||
    xor        ebp, ebp          ; clear ebp for call stack trace
 | 
			
		||||
 | 
			
		||||
@ -655,7 +655,7 @@ ApWakeupFunction (
 | 
			
		||||
          SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateBusy);
 | 
			
		||||
          //
 | 
			
		||||
          // Enable source debugging on AP function
 | 
			
		||||
          //         
 | 
			
		||||
          //
 | 
			
		||||
          EnableDebugAgent ();
 | 
			
		||||
          //
 | 
			
		||||
          // Invoke AP function here
 | 
			
		||||
@ -1115,7 +1115,7 @@ CalculateTimeout (
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // GetPerformanceCounterProperties () returns the timestamp counter's frequency
 | 
			
		||||
  // in Hz. 
 | 
			
		||||
  // in Hz.
 | 
			
		||||
  //
 | 
			
		||||
  TimestampCounterFreq = GetPerformanceCounterProperties (NULL, NULL);
 | 
			
		||||
 | 
			
		||||
@ -1737,7 +1737,7 @@ MpInitLibGetProcessorInfo (
 | 
			
		||||
                               enabled AP. Otherwise, it will be disabled.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS          BSP successfully switched.
 | 
			
		||||
  @retval others               Failed to switch BSP. 
 | 
			
		||||
  @retval others               Failed to switch BSP.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
EFI_STATUS
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  Common header file for MP Initialize Library.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -463,7 +463,7 @@ StartupThisAPWorker (
 | 
			
		||||
                               enabled AP. Otherwise, it will be disabled.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS          BSP successfully switched.
 | 
			
		||||
  @retval others               Failed to switch BSP. 
 | 
			
		||||
  @retval others               Failed to switch BSP.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
EFI_STATUS
 | 
			
		||||
 | 
			
		||||
@ -216,7 +216,7 @@ GetNextProcNumber:
 | 
			
		||||
    jz          ProgramStack
 | 
			
		||||
    add         edi, 20
 | 
			
		||||
    inc         ebx
 | 
			
		||||
    jmp         GetNextProcNumber    
 | 
			
		||||
    jmp         GetNextProcNumber
 | 
			
		||||
 | 
			
		||||
ProgramStack:
 | 
			
		||||
    mov         rsp, qword [edi + 12]
 | 
			
		||||
 | 
			
		||||
@ -1,15 +1,15 @@
 | 
			
		||||
## @file
 | 
			
		||||
#  MTRR library provides APIs for MTRR operation.
 | 
			
		||||
#
 | 
			
		||||
#  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  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.
 | 
			
		||||
#  
 | 
			
		||||
#
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
[Defines]
 | 
			
		||||
@ -19,7 +19,7 @@
 | 
			
		||||
  FILE_GUID                      = 6826b408-f4f3-47ee-917f-af7047f9d937
 | 
			
		||||
  MODULE_TYPE                    = BASE
 | 
			
		||||
  VERSION_STRING                 = 1.0
 | 
			
		||||
  LIBRARY_CLASS                  = MtrrLib 
 | 
			
		||||
  LIBRARY_CLASS                  = MtrrLib
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
@ -3,13 +3,13 @@
 | 
			
		||||
//
 | 
			
		||||
// MTRR library provides APIs for MTRR operation.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// 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.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  CPU Features Initialize functions.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
@ -63,7 +63,7 @@ GetSupportPcd (
 | 
			
		||||
  UINT8                  *SupportBitMask;
 | 
			
		||||
 | 
			
		||||
  SupportBitMask = AllocateCopyPool (
 | 
			
		||||
          PcdGetSize (PcdCpuFeaturesSupport), 
 | 
			
		||||
          PcdGetSize (PcdCpuFeaturesSupport),
 | 
			
		||||
          PcdGetPtr (PcdCpuFeaturesSupport)
 | 
			
		||||
          );
 | 
			
		||||
  ASSERT (SupportBitMask != NULL);
 | 
			
		||||
@ -84,7 +84,7 @@ GetConfigurationPcd (
 | 
			
		||||
  UINT8                  *SupportBitMask;
 | 
			
		||||
 | 
			
		||||
  SupportBitMask = AllocateCopyPool (
 | 
			
		||||
          PcdGetSize (PcdCpuFeaturesUserConfiguration), 
 | 
			
		||||
          PcdGetSize (PcdCpuFeaturesUserConfiguration),
 | 
			
		||||
          PcdGetPtr (PcdCpuFeaturesUserConfiguration)
 | 
			
		||||
          );
 | 
			
		||||
  ASSERT (SupportBitMask != NULL);
 | 
			
		||||
 | 
			
		||||
@ -3,9 +3,9 @@
 | 
			
		||||
#
 | 
			
		||||
# Timer Library that only uses CPU resources to provide calibrated delays
 | 
			
		||||
#  on IA-32, x64, and IPF.
 | 
			
		||||
# Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can use this TimerLib 
 | 
			
		||||
#  in their initialization without any issues. They only have to be careful in 
 | 
			
		||||
#  the implementation of runtime services and SMI handlers.  
 | 
			
		||||
# Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can use this TimerLib
 | 
			
		||||
#  in their initialization without any issues. They only have to be careful in
 | 
			
		||||
#  the implementation of runtime services and SMI handlers.
 | 
			
		||||
#  Because CPU Local APIC and ITC could be programmed by OS, it cannot be
 | 
			
		||||
#  used by SMM drivers and runtime drivers, ACPI timer is recommended for SMM
 | 
			
		||||
#  drivers and runtime drivers.
 | 
			
		||||
@ -13,7 +13,7 @@
 | 
			
		||||
# This library differs with the SecPeiDxeTimerLibCpu library in the MdePkg in
 | 
			
		||||
# that it uses the local APIC library so that it supports x2APIC mode.
 | 
			
		||||
#
 | 
			
		||||
# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#
 | 
			
		||||
#  This program and the accompanying materials
 | 
			
		||||
#  are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
 | 
			
		||||
@ -9,11 +9,11 @@
 | 
			
		||||
// Because CPU Local APIC and ITC could be programmed by OS, it cannot be
 | 
			
		||||
// used by SMM drivers and runtime drivers, ACPI timer is recommended for SMM
 | 
			
		||||
// drivers and runtime drivers.
 | 
			
		||||
// 
 | 
			
		||||
//
 | 
			
		||||
// This library differs with the SecPeiDxeTimerLibCpu library in the MdePkg in
 | 
			
		||||
// that it uses the local APIC library so that it supports x2APIC mode.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// This program and the accompanying materials
 | 
			
		||||
// are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,8 @@
 | 
			
		||||
  Timer Library functions built upon local APIC on IA32/x64.
 | 
			
		||||
 | 
			
		||||
  This library uses the local APIC library so that it supports x2APIC mode.
 | 
			
		||||
  
 | 
			
		||||
  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  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
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  SMM CPU misc functions for Ia32 arch specific.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
This program and the accompanying materials
 | 
			
		||||
are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
@ -43,7 +43,7 @@ InitializeIDTSmmStackGuard (
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Initialize Gdt for all processors.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]   Cr3          CR3 value.
 | 
			
		||||
  @param[out]  GdtStepSize  The step size for GDT table.
 | 
			
		||||
 | 
			
		||||
@ -80,7 +80,7 @@ InitGdt (
 | 
			
		||||
    //
 | 
			
		||||
    // IA32 Stack Guard need use task switch to switch stack that need
 | 
			
		||||
    // write GDT and TSS, so AllocateCodePages() could not be used here
 | 
			
		||||
    // as code pages will be set to RO. 
 | 
			
		||||
    // as code pages will be set to RO.
 | 
			
		||||
    //
 | 
			
		||||
    GdtTssTables = (UINT8*)AllocatePages (EFI_SIZE_TO_PAGES (mGdtBufferSize));
 | 
			
		||||
    ASSERT (GdtTssTables != NULL);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** @file
 | 
			
		||||
SMM MP service implementation
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
 | 
			
		||||
 | 
			
		||||
This program and the accompanying materials
 | 
			
		||||
@ -199,7 +199,7 @@ AllCpusInSmmWithExceptions (
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Has OS enabled Lmce in the MSR_IA32_MCG_EXT_CTL
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @retval TRUE     Os enable lmce.
 | 
			
		||||
  @retval FALSE    Os not enable lmce.
 | 
			
		||||
 | 
			
		||||
@ -228,9 +228,9 @@ IsLmceOsEnabled (
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Return if Local machine check exception signaled. 
 | 
			
		||||
  Return if Local machine check exception signaled.
 | 
			
		||||
 | 
			
		||||
  Indicates (when set) that a local machine check exception was generated. This indicates that the current machine-check event was 
 | 
			
		||||
  Indicates (when set) that a local machine check exception was generated. This indicates that the current machine-check event was
 | 
			
		||||
  delivered to only the logical processor.
 | 
			
		||||
 | 
			
		||||
  @retval TRUE    LMCE was signaled.
 | 
			
		||||
@ -1046,7 +1046,7 @@ CpuSmmDebugEntry (
 | 
			
		||||
  )
 | 
			
		||||
{
 | 
			
		||||
  SMRAM_SAVE_STATE_MAP *CpuSaveState;
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  if (FeaturePcdGet (PcdCpuSmmDebug)) {
 | 
			
		||||
    ASSERT(CpuIndex < mMaxNumberOfCpus);
 | 
			
		||||
    CpuSaveState = (SMRAM_SAVE_STATE_MAP *)gSmmCpuPrivate->CpuSaveState[CpuIndex];
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  SMM CPU misc functions for x64 arch specific.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
This program and the accompanying materials
 | 
			
		||||
are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
@ -40,7 +40,7 @@ InitializeIDTSmmStackGuard (
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Initialize Gdt for all processors.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param[in]   Cr3          CR3 value.
 | 
			
		||||
  @param[out]  GdtStepSize  The step size for GDT table.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
## @file
 | 
			
		||||
#  Reset Vector
 | 
			
		||||
#  
 | 
			
		||||
#
 | 
			
		||||
#  This VTF requires build time fixups in order to find the SEC entry point.
 | 
			
		||||
#
 | 
			
		||||
#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#
 | 
			
		||||
#  This program and the accompanying materials
 | 
			
		||||
#  are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
; @file
 | 
			
		||||
; Transition from 32 bit flat protected mode into 64 bit flat protected mode
 | 
			
		||||
;
 | 
			
		||||
; Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
; 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
 | 
			
		||||
@ -24,7 +24,7 @@ Transition32FlatTo64Flat:
 | 
			
		||||
 | 
			
		||||
    mov     eax, cr4
 | 
			
		||||
    bts     eax, 5                      ; enable PAE
 | 
			
		||||
    mov     cr4, eax                    
 | 
			
		||||
    mov     cr4, eax
 | 
			
		||||
 | 
			
		||||
    mov     ecx, 0xc0000080
 | 
			
		||||
    rdmsr
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
; @file
 | 
			
		||||
; Serial port debug support macros
 | 
			
		||||
;
 | 
			
		||||
; Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
; 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
 | 
			
		||||
@ -107,7 +107,7 @@
 | 
			
		||||
BITS    16
 | 
			
		||||
 | 
			
		||||
%macro  debugInitialize 0
 | 
			
		||||
	jmp	real16InitDebug
 | 
			
		||||
  jmp  real16InitDebug
 | 
			
		||||
real16InitDebugReturn:
 | 
			
		||||
%endmacro
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
// /** @file
 | 
			
		||||
// UefiCpu Package Localized Strings and Content.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// This program and the accompanying materials are licensed and made available under
 | 
			
		||||
// the terms and conditions of the BSD License which accompanies this distribution.
 | 
			
		||||
@ -13,8 +13,8 @@
 | 
			
		||||
//
 | 
			
		||||
// **/
 | 
			
		||||
 | 
			
		||||
#string STR_PROPERTIES_PACKAGE_NAME 
 | 
			
		||||
#language en-US 
 | 
			
		||||
#string STR_PROPERTIES_PACKAGE_NAME
 | 
			
		||||
#language en-US
 | 
			
		||||
"UefiCpu package"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -118,7 +118,7 @@ typedef union {
 | 
			
		||||
    UINT64  CacheDisabled:1;          // 0 = Cached, 1=Non-Cached
 | 
			
		||||
    UINT64  Accessed:1;               // 0 = Not accessed, 1 = Accessed (set by CPU)
 | 
			
		||||
    UINT64  Dirty:1;                  // 0 = Not Dirty, 1 = written by processor on access to page
 | 
			
		||||
    UINT64  MustBe1:1;                // Must be 1 
 | 
			
		||||
    UINT64  MustBe1:1;                // Must be 1
 | 
			
		||||
    UINT64  Global:1;                 // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
 | 
			
		||||
    UINT64  Available:3;              // Available for use by system software
 | 
			
		||||
    UINT64  PAT:1;                    //
 | 
			
		||||
@ -142,7 +142,7 @@ typedef union {
 | 
			
		||||
    UINT64  CacheDisabled:1;          // 0 = Cached, 1=Non-Cached
 | 
			
		||||
    UINT64  Accessed:1;               // 0 = Not accessed, 1 = Accessed (set by CPU)
 | 
			
		||||
    UINT64  Dirty:1;                  // 0 = Not Dirty, 1 = written by processor on access to page
 | 
			
		||||
    UINT64  MustBe1:1;                // Must be 1 
 | 
			
		||||
    UINT64  MustBe1:1;                // Must be 1
 | 
			
		||||
    UINT64  Global:1;                 // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
 | 
			
		||||
    UINT64  Available:3;              // Available for use by system software
 | 
			
		||||
    UINT64  PAT:1;                    //
 | 
			
		||||
@ -177,9 +177,9 @@ typedef struct {
 | 
			
		||||
//
 | 
			
		||||
/**
 | 
			
		||||
  a ASM function to transfer control to OS.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param  S3WakingVector  The S3 waking up vector saved in ACPI Facs table
 | 
			
		||||
  @param  AcpiLowMemoryBase a buffer under 1M which could be used during the transfer             
 | 
			
		||||
  @param  AcpiLowMemoryBase a buffer under 1M which could be used during the transfer
 | 
			
		||||
**/
 | 
			
		||||
typedef
 | 
			
		||||
VOID
 | 
			
		||||
@ -425,7 +425,7 @@ S3ResumeBootOs (
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // NOTE: Because Debug Timer interrupt and system interrupts will be disabled 
 | 
			
		||||
  // NOTE: Because Debug Timer interrupt and system interrupts will be disabled
 | 
			
		||||
  // in BootScriptExecuteDxe, the rest code in S3ResumeBootOs() cannot be halted
 | 
			
		||||
  // by soft debugger.
 | 
			
		||||
  //
 | 
			
		||||
@ -563,7 +563,7 @@ S3ResumeBootOs (
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Restore S3 page table because we do not trust ACPINvs content.
 | 
			
		||||
  If BootScriptExector driver will not run in 64-bit mode, this function will do nothing. 
 | 
			
		||||
  If BootScriptExector driver will not run in 64-bit mode, this function will do nothing.
 | 
			
		||||
 | 
			
		||||
  @param S3NvsPageTableAddress   PageTableAddress in ACPINvs
 | 
			
		||||
  @param Build4GPageTableOnly    If BIOS just build 4G page table only
 | 
			
		||||
@ -611,7 +611,7 @@ RestoreS3PageTables (
 | 
			
		||||
    //
 | 
			
		||||
    PageMap = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress;
 | 
			
		||||
    S3NvsPageTableAddress += SIZE_4KB;
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    Page1GSupport = FALSE;
 | 
			
		||||
    if (PcdGetBool(PcdUse1GPageTable)) {
 | 
			
		||||
      AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
 | 
			
		||||
@ -622,7 +622,7 @@ RestoreS3PageTables (
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // Get physical address bits supported.
 | 
			
		||||
    //
 | 
			
		||||
@ -638,7 +638,7 @@ RestoreS3PageTables (
 | 
			
		||||
        PhysicalAddressBits = 36;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses.
 | 
			
		||||
    //
 | 
			
		||||
@ -665,7 +665,7 @@ RestoreS3PageTables (
 | 
			
		||||
      NumberOfPml4EntriesNeeded = (UINT32)LShiftU64 (1, (PhysicalAddressBits - 39));
 | 
			
		||||
      NumberOfPdpEntriesNeeded = 512;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    PageMapLevel4Entry = PageMap;
 | 
			
		||||
    PageAddress        = 0;
 | 
			
		||||
    for (IndexOfPml4Entries = 0; IndexOfPml4Entries < NumberOfPml4EntriesNeeded; IndexOfPml4Entries++, PageMapLevel4Entry++) {
 | 
			
		||||
@ -675,7 +675,7 @@ RestoreS3PageTables (
 | 
			
		||||
      //
 | 
			
		||||
      PageDirectoryPointerEntry = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress;
 | 
			
		||||
      S3NvsPageTableAddress += SIZE_4KB;
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
      //
 | 
			
		||||
      // Make a PML4 Entry
 | 
			
		||||
      //
 | 
			
		||||
@ -685,7 +685,7 @@ RestoreS3PageTables (
 | 
			
		||||
 | 
			
		||||
      if (Page1GSupport) {
 | 
			
		||||
        PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry;
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
        for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectory1GEntry++, PageAddress += SIZE_1GB) {
 | 
			
		||||
          //
 | 
			
		||||
          // Fill in the Page Directory entries
 | 
			
		||||
@ -700,17 +700,17 @@ RestoreS3PageTables (
 | 
			
		||||
          //
 | 
			
		||||
          // Each Directory Pointer entries points to a page of Page Directory entires.
 | 
			
		||||
          // So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop.
 | 
			
		||||
          //       
 | 
			
		||||
          //
 | 
			
		||||
          PageDirectoryEntry = (PAGE_TABLE_ENTRY *)S3NvsPageTableAddress;
 | 
			
		||||
          S3NvsPageTableAddress += SIZE_4KB;
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
          //
 | 
			
		||||
          // Fill in a Page Directory Pointer Entries
 | 
			
		||||
          //
 | 
			
		||||
          PageDirectoryPointerEntry->Uint64 = (UINT64)(UINTN)PageDirectoryEntry | AddressEncMask;
 | 
			
		||||
          PageDirectoryPointerEntry->Bits.ReadWrite = 1;
 | 
			
		||||
          PageDirectoryPointerEntry->Bits.Present = 1;
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
          for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectoryEntry++, PageAddress += SIZE_2MB) {
 | 
			
		||||
            //
 | 
			
		||||
            // Fill in the Page Directory entries
 | 
			
		||||
@ -725,9 +725,9 @@ RestoreS3PageTables (
 | 
			
		||||
    }
 | 
			
		||||
    return ;
 | 
			
		||||
  } else {
 | 
			
		||||
  	//
 | 
			
		||||
  	// If DXE is running 32-bit mode, no need to establish page table.
 | 
			
		||||
  	//
 | 
			
		||||
    //
 | 
			
		||||
    // If DXE is running 32-bit mode, no need to establish page table.
 | 
			
		||||
    //
 | 
			
		||||
    return ;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -770,7 +770,7 @@ S3ResumeExecuteBootScript (
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // Send SMI to APs
 | 
			
		||||
    //    
 | 
			
		||||
    //
 | 
			
		||||
    SendSmiIpiAllExcludingSelf ();
 | 
			
		||||
    //
 | 
			
		||||
    // Send SMI to BSP
 | 
			
		||||
@ -785,13 +785,13 @@ S3ResumeExecuteBootScript (
 | 
			
		||||
                              );
 | 
			
		||||
    if (!EFI_ERROR (Status)) {
 | 
			
		||||
      DEBUG ((DEBUG_INFO, "Close all SMRAM regions before executing boot script\n"));
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
      for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) {
 | 
			
		||||
        Status = SmmAccess->Close ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      DEBUG ((DEBUG_INFO, "Lock all SMRAM regions before executing boot script\n"));
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
      for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) {
 | 
			
		||||
        Status = SmmAccess->Lock ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index);
 | 
			
		||||
      }
 | 
			
		||||
@ -816,12 +816,12 @@ S3ResumeExecuteBootScript (
 | 
			
		||||
  if (FeaturePcdGet (PcdFrameworkCompatibilitySupport)) {
 | 
			
		||||
    //
 | 
			
		||||
    // On some platform, such as ECP, a dispatch node in boot script table may execute a 32-bit PEIM which may need PeiServices
 | 
			
		||||
    // pointer. So PeiServices need preserve in (IDTBase- sizeof (UINTN)). 
 | 
			
		||||
    // pointer. So PeiServices need preserve in (IDTBase- sizeof (UINTN)).
 | 
			
		||||
    //
 | 
			
		||||
    IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile);
 | 
			
		||||
    //
 | 
			
		||||
    // Make sure the newly allocated IDT align with 16-bytes
 | 
			
		||||
    // 
 | 
			
		||||
    //
 | 
			
		||||
    IdtBuffer = AllocatePages (EFI_SIZE_TO_PAGES((IdtDescriptor->Limit + 1) + 16));
 | 
			
		||||
    if (IdtBuffer == NULL) {
 | 
			
		||||
      REPORT_STATUS_CODE (
 | 
			
		||||
@ -833,7 +833,7 @@ S3ResumeExecuteBootScript (
 | 
			
		||||
    //
 | 
			
		||||
    // Additional 16 bytes allocated to save IA32 IDT descriptor and Pei Service Table Pointer
 | 
			
		||||
    // IA32 IDT descriptor will be used to setup IA32 IDT table for 32-bit Framework Boot Script code
 | 
			
		||||
    // 
 | 
			
		||||
    //
 | 
			
		||||
    ZeroMem (IdtBuffer, 16);
 | 
			
		||||
    AsmReadIdtr ((IA32_DESCRIPTOR *)IdtBuffer);
 | 
			
		||||
    CopyMem ((VOID*)((UINT8*)IdtBuffer + 16),(VOID*)(IdtDescriptor->Base), (IdtDescriptor->Limit + 1));
 | 
			
		||||
@ -874,7 +874,7 @@ S3ResumeExecuteBootScript (
 | 
			
		||||
  // Save IDT
 | 
			
		||||
  //
 | 
			
		||||
  AsmReadIdtr (&PeiS3ResumeState->Idtr);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  //
 | 
			
		||||
  // Report Status Code to indicate S3 boot script execution
 | 
			
		||||
  //
 | 
			
		||||
@ -1011,7 +1011,7 @@ S3RestoreConfig2 (
 | 
			
		||||
  DEBUG (( DEBUG_INFO, "AcpiS3Context = %x\n", AcpiS3Context));
 | 
			
		||||
  DEBUG (( DEBUG_INFO, "Waking Vector = %x\n", ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable)))->FirmwareWakingVector));
 | 
			
		||||
  DEBUG (( DEBUG_INFO, "AcpiS3Context->AcpiFacsTable = %x\n", AcpiS3Context->AcpiFacsTable));
 | 
			
		||||
  DEBUG (( DEBUG_INFO, "AcpiS3Context->IdtrProfile = %x\n", AcpiS3Context->IdtrProfile));  
 | 
			
		||||
  DEBUG (( DEBUG_INFO, "AcpiS3Context->IdtrProfile = %x\n", AcpiS3Context->IdtrProfile));
 | 
			
		||||
  DEBUG (( DEBUG_INFO, "AcpiS3Context->S3NvsPageTableAddress = %x\n", AcpiS3Context->S3NvsPageTableAddress));
 | 
			
		||||
  DEBUG (( DEBUG_INFO, "AcpiS3Context->S3DebugBufferAddress = %x\n", AcpiS3Context->S3DebugBufferAddress));
 | 
			
		||||
  DEBUG (( DEBUG_INFO, "AcpiS3Context->BootScriptStackBase = %x\n", AcpiS3Context->BootScriptStackBase));
 | 
			
		||||
@ -1100,7 +1100,7 @@ S3RestoreConfig2 (
 | 
			
		||||
      AsmWriteGdtr (&mGdt);
 | 
			
		||||
      //
 | 
			
		||||
      // update segment selectors per the new GDT.
 | 
			
		||||
      //      
 | 
			
		||||
      //
 | 
			
		||||
      AsmSetDataSelectors (DATA_SEGEMENT_SELECTOR);
 | 
			
		||||
      //
 | 
			
		||||
      // Restore interrupt state.
 | 
			
		||||
@ -1134,7 +1134,7 @@ S3RestoreConfig2 (
 | 
			
		||||
  Main entry for S3 Resume PEIM.
 | 
			
		||||
 | 
			
		||||
  This routine is to install EFI_PEI_S3_RESUME2_PPI.
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @param  FileHandle              Handle of the file being invoked.
 | 
			
		||||
  @param  PeiServices             Pointer to PEI Services table.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -5,13 +5,13 @@
 | 
			
		||||
// This module will excute the boot script saved during last boot and after that,
 | 
			
		||||
// control is passed to OS waking up handler.
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// 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.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
// /** @file
 | 
			
		||||
// S3Resume2Pei Localized Strings and Content
 | 
			
		||||
//
 | 
			
		||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
//
 | 
			
		||||
// This program and the accompanying materials are
 | 
			
		||||
// licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
@ -13,8 +13,8 @@
 | 
			
		||||
//
 | 
			
		||||
// **/
 | 
			
		||||
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME 
 | 
			
		||||
#language en-US 
 | 
			
		||||
#string STR_PROPERTIES_MODULE_NAME
 | 
			
		||||
#language en-US
 | 
			
		||||
"S3 Resume v2 PEI Module"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user