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:
Liming Gao
2018-06-27 21:14:20 +08:00
parent 77695f4da3
commit 7367cc6c24
59 changed files with 614 additions and 614 deletions

View File

@@ -1,7 +1,7 @@
/** @file /** @file
UEFI Application to display CPUID leaf information. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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_ECX Ecx;
CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX Edx; CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF_EDX Edx;
UINT32 SubLeaf; UINT32 SubLeaf;
SubLeaf = CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF; SubLeaf = CPUID_INTEL_SGX_CAPABILITIES_RESOURCES_SUB_LEAF;
do { do {
AsmCpuidEx ( AsmCpuidEx (
@@ -1068,7 +1068,7 @@ CpuidEnumerationOfIntelSgx (
// //
return; return;
} }
CpuidEnumerationOfIntelSgxCapabilities0SubLeaf (); CpuidEnumerationOfIntelSgxCapabilities0SubLeaf ();
CpuidEnumerationOfIntelSgxCapabilities1SubLeaf (); CpuidEnumerationOfIntelSgxCapabilities1SubLeaf ();
CpuidEnumerationOfIntelSgxResourcesSubLeaf (); CpuidEnumerationOfIntelSgxResourcesSubLeaf ();

View File

@@ -1,7 +1,7 @@
/** @file /** @file
CPU DXE Module to produce CPU ARCH Protocol. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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. @param[in]ImageHandle Image handle this driver.
@@ -1125,7 +1125,7 @@ AddLocalApicMemorySpace (
ASSERT_EFI_ERROR (Status); 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 // status because it may be allocated by other driver, or DXE Core if
// this range is built into Memory Allocation HOB. // this range is built into Memory Allocation HOB.
// //
@@ -1164,7 +1164,7 @@ InitializeCpu (
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_EVENT IdleLoopEvent; EFI_EVENT IdleLoopEvent;
InitializePageTableLib(); InitializePageTableLib();
InitializeFloatingPointUnits (); InitializeFloatingPointUnits ();

View File

@@ -3,13 +3,13 @@
// //
// CPU driver installs CPU Architecture Protocol and CPU MP Protocol. // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //

View File

@@ -1,7 +1,7 @@
// /** @file // /** @file
// CpuDxe Localized Strings and Content // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
// //
// **/ // **/
#string STR_PROPERTIES_MODULE_NAME #string STR_PROPERTIES_MODULE_NAME
#language en-US #language en-US
"CPU Architectural and CPU Multi-processor DXE Driver" "CPU Architectural and CPU Multi-processor DXE Driver"

View File

@@ -1,7 +1,7 @@
/** @file /** @file
CPU Features DXE driver to initialize CPU features. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -107,8 +107,8 @@ CpuFeaturesDxeInitialize (
if (GetFirstGuidHob (&gEdkiiCpuFeaturesInitDoneGuid) != NULL) { if (GetFirstGuidHob (&gEdkiiCpuFeaturesInitDoneGuid) != NULL) {
// //
// Try to find HOB first. This HOB exist means CPU features have // Try to find HOB first. This HOB exist means CPU features have
// been initialized by CpuFeaturesPei driver, just install // been initialized by CpuFeaturesPei driver, just install
// gEdkiiCpuFeaturesInitDoneGuid. // gEdkiiCpuFeaturesInitDoneGuid.
// //
Handle = NULL; Handle = NULL;

View File

@@ -1,16 +1,16 @@
/** @file /** @file
Produces the CPU I/O 2 Protocol. 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> Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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. 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 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
@param[in] MmioOperation TRUE for an MMIO operation, FALSE for I/O Port operation. @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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. @param[in] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
@@ -137,7 +137,7 @@ CpuIoCheckParameter (
if (!MmioOperation && (Width == EfiCpuIoWidthUint64)) { if (!MmioOperation && (Width == EfiCpuIoWidthUint64)) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
// //
// Check to see if Address is aligned // 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 // allowed address. The maximum address implied by the parameters passed in is
// Address + Size * Count. If the following condition is met, then the transfer // Address + Size * Count. If the following condition is met, then the transfer
// is not supported. // is not supported.
// //
// Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1 // 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 // can also be the maximum integer value supported by the CPU, this range
// check must be adjusted to avoid all oveflow conditions. // check must be adjusted to avoid all 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). // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1).
// //
Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS); Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS);
@@ -165,7 +165,7 @@ CpuIoCheckParameter (
if (Address > Limit) { if (Address > Limit) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
} else { } else {
MaxCount = RShiftU64 (Limit, Width); MaxCount = RShiftU64 (Limit, Width);
if (MaxCount < (Count - 1)) { if (MaxCount < (Count - 1)) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
@@ -189,30 +189,30 @@ CpuIoCheckParameter (
/** /**
Reads memory-mapped registers. Reads memory-mapped registers.
The I/O operations are carried out exactly as requested. The caller is responsible 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
each of the Count operations that is performed. each of the Count operations that is performed.
If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
incremented for each of the Count operations that is performed. The read or incremented for each of the Count operations that is performed. The read or
write operation is performed Count times on the same Address. write operation is performed Count times on the same Address.
If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
incremented for each of the Count operations that is performed. The read or 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. 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] 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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. @param[out] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
@@ -269,30 +269,30 @@ CpuMemoryServiceRead (
/** /**
Writes memory-mapped registers. Writes memory-mapped registers.
The I/O operations are carried out exactly as requested. The caller is responsible 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
each of the Count operations that is performed. each of the Count operations that is performed.
If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
incremented for each of the Count operations that is performed. The read or incremented for each of the Count operations that is performed. The read or
write operation is performed Count times on the same Address. write operation is performed Count times on the same Address.
If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
incremented for each of the Count operations that is performed. The read or 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. 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] 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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. @param[in] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
@@ -349,30 +349,30 @@ CpuMemoryServiceWrite (
/** /**
Reads I/O registers. Reads I/O registers.
The I/O operations are carried out exactly as requested. The caller is responsible 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
each of the Count operations that is performed. each of the Count operations that is performed.
If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
incremented for each of the Count operations that is performed. The read or incremented for each of the Count operations that is performed. The read or
write operation is performed Count times on the same Address. write operation is performed Count times on the same Address.
If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
incremented for each of the Count operations that is performed. The read or 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. 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] 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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. @param[out] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
@@ -453,30 +453,30 @@ CpuIoServiceRead (
/** /**
Write I/O registers. Write I/O registers.
The I/O operations are carried out exactly as requested. The caller is responsible 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
each of the Count operations that is performed. each of the Count operations that is performed.
If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
incremented for each of the Count operations that is performed. The read or incremented for each of the Count operations that is performed. The read or
write operation is performed Count times on the same Address. write operation is performed Count times on the same Address.
If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
incremented for each of the Count operations that is performed. The read or 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. 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] 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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. @param[in] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@@ -553,16 +553,16 @@ CpuIoServiceWrite (
IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer)); IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer));
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/** /**
The user Entry Point for module CpuIo2Dxe. The user code starts with this function. 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. @param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The entry point is executed successfully. @retval EFI_SUCCESS The entry point is executed successfully.
@retval other Some error occurs when executing this entry point. @retval other Some error occurs when executing this entry point.

View File

@@ -1,14 +1,14 @@
/** @file /** @file
Internal include file for the CPU I/O 2 Protocol. Internal include file for the CPU I/O 2 Protocol.
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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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. Reads memory-mapped registers.
The I/O operations are carried out exactly as requested. The caller is responsible 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
each of the Count operations that is performed. each of the Count operations that is performed.
If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
incremented for each of the Count operations that is performed. The read or incremented for each of the Count operations that is performed. The read or
write operation is performed Count times on the same Address. write operation is performed Count times on the same Address.
If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
incremented for each of the Count operations that is performed. The read or 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. 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] 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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. @param[out] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
@@ -78,30 +78,30 @@ CpuMemoryServiceRead (
/** /**
Writes memory-mapped registers. Writes memory-mapped registers.
The I/O operations are carried out exactly as requested. The caller is responsible 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
each of the Count operations that is performed. each of the Count operations that is performed.
If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
incremented for each of the Count operations that is performed. The read or incremented for each of the Count operations that is performed. The read or
write operation is performed Count times on the same Address. write operation is performed Count times on the same Address.
If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
incremented for each of the Count operations that is performed. The read or 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. 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] 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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. @param[in] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
@@ -127,30 +127,30 @@ CpuMemoryServiceWrite (
/** /**
Reads I/O registers. Reads I/O registers.
The I/O operations are carried out exactly as requested. The caller is responsible 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
each of the Count operations that is performed. each of the Count operations that is performed.
If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
incremented for each of the Count operations that is performed. The read or incremented for each of the Count operations that is performed. The read or
write operation is performed Count times on the same Address. write operation is performed Count times on the same Address.
If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
incremented for each of the Count operations that is performed. The read or 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. 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] 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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[out] Buffer For read operations, the destination buffer to store the results. @param[out] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
@@ -176,30 +176,30 @@ CpuIoServiceRead (
/** /**
Write I/O registers. Write I/O registers.
The I/O operations are carried out exactly as requested. The caller is responsible 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 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 platform might require. For example on some platforms, width requests of
EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
be handled by the driver. be handled by the driver.
If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
each of the Count operations that is performed. each of the Count operations that is performed.
If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
incremented for each of the Count operations that is performed. The read or incremented for each of the Count operations that is performed. The read or
write operation is performed Count times on the same Address. write operation is performed Count times on the same Address.
If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
incremented for each of the Count operations that is performed. The read or 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. 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] 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] Width Signifies the width of the I/O or Memory operation.
@param[in] Address The base address of the I/O 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] Count The number of I/O operations to perform. The number of
bytes moved is Width size * Count, starting at Address. bytes moved is Width size * Count, starting at Address.
@param[in] Buffer For read operations, the destination buffer to store the results. @param[in] Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data. 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 Width is invalid for this PI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. @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. and Count is not valid for this PI system.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI

View File

@@ -1,7 +1,7 @@
## @file ## @file
# Produces the CPU I/O 2 Protocol by using the services of the I/O Library. # 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> # Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
@@ -20,7 +20,7 @@
MODULE_UNI_FILE = CpuIo2Dxe.uni MODULE_UNI_FILE = CpuIo2Dxe.uni
FILE_GUID = A19B1FE7-C1BC-49F8-875F-54A5D542443F FILE_GUID = A19B1FE7-C1BC-49F8-875F-54A5D542443F
MODULE_TYPE = DXE_DRIVER MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
ENTRY_POINT = CpuIo2Initialize ENTRY_POINT = CpuIo2Initialize
# #

View File

@@ -3,13 +3,13 @@
// //
// Produces the CPU I/O 2 Protocol by using the services of the I/O Library. // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //

View File

@@ -1,7 +1,7 @@
// /** @file // /** @file
// CpuIo2Dxe Localized Strings and Content // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
// //
// **/ // **/
#string STR_PROPERTIES_MODULE_NAME #string STR_PROPERTIES_MODULE_NAME
#language en-US #language en-US
"CPU I/O v2 DXE Driver" "CPU I/O v2 DXE Driver"

View File

@@ -1,14 +1,14 @@
/** @file /** @file
Produces the SMM CPU I/O Protocol. Produces the SMM CPU I/O Protocol.
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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] 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] Width Signifies the width of the I/O operations.
@param[in] Address The base address of the I/O operations. The caller is @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[in] Buffer For read operations, the destination buffer to store @param[in] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
**/ **/
EFI_STATUS EFI_STATUS
CpuIoCheckParameter ( CpuIoCheckParameter (
@@ -92,20 +92,20 @@ CpuIoCheckParameter (
if (!MmioOperation && (Width == SMM_IO_UINT64)) { if (!MmioOperation && (Width == SMM_IO_UINT64)) {
return EFI_INVALID_PARAMETER; 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 // allowed address. The maximum address implied by the parameters passed in is
// Address + Size * Count. If the following condition is met, then the transfer // Address + Size * Count. If the following condition is met, then the transfer
// is not supported. // is not supported.
// //
// Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1 // 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 // can also be the maximum integer value supported by the CPU, this range
// check must be adjusted to avoid all overflow conditions. // 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). // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1).
// //
Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS); Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS);
@@ -113,7 +113,7 @@ CpuIoCheckParameter (
if (Address > Limit) { if (Address > Limit) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
} else { } else {
MaxCount = RShiftU64 (Limit, Width); MaxCount = RShiftU64 (Limit, Width);
if (MaxCount < (Count - 1)) { if (MaxCount < (Count - 1)) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
@@ -122,7 +122,7 @@ CpuIoCheckParameter (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
} }
// //
// Check to see if Address is aligned // Check to see if Address is aligned
// //
@@ -136,23 +136,23 @@ CpuIoCheckParameter (
/** /**
Reads memory-mapped registers. Reads memory-mapped registers.
The I/O operations are carried out exactly as requested. The caller is 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, responsible for any alignment and I/O width issues that the bus, device,
platform, or type of I/O might require. platform, or type of I/O might require.
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
@param[in] Width Signifies the width of the I/O operations. @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 @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[out] Buffer For read operations, the destination buffer to store @param[out] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @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 lack of resources
**/ **/
@@ -196,23 +196,23 @@ CpuMemoryServiceRead (
/** /**
Writes memory-mapped registers. Writes memory-mapped registers.
The I/O operations are carried out exactly as requested. The caller is 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, responsible for any alignment and I/O width issues that the bus, device,
platform, or type of I/O might require. platform, or type of I/O might require.
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
@param[in] Width Signifies the width of the I/O operations. @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 @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[in] Buffer For read operations, the destination buffer to store @param[in] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @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 lack of resources
**/ **/
@@ -256,23 +256,23 @@ CpuMemoryServiceWrite (
/** /**
Reads I/O registers. Reads I/O registers.
The I/O operations are carried out exactly as requested. The caller is 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, responsible for any alignment and I/O width issues that the bus, device,
platform, or type of I/O might require. platform, or type of I/O might require.
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
@param[in] Width Signifies the width of the I/O operations. @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 @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[out] Buffer For read operations, the destination buffer to store @param[out] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @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 lack of resources
**/ **/
@@ -315,23 +315,23 @@ CpuIoServiceRead (
/** /**
Write I/O registers. Write I/O registers.
The I/O operations are carried out exactly as requested. The caller is 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, responsible for any alignment and I/O width issues that the bus, device,
platform, or type of I/O might require. platform, or type of I/O might require.
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
@param[in] Width Signifies the width of the I/O operations. @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 @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[in] Buffer For read operations, the destination buffer to store @param[in] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @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 lack of resources
**/ **/
@@ -370,7 +370,7 @@ CpuIoServiceWrite (
IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer)); IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer));
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -408,6 +408,6 @@ SmmCpuIo2Initialize (
&mSmmCpuIo2 &mSmmCpuIo2
); );
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
return Status; return Status;
} }

View File

@@ -1,14 +1,14 @@
/** @file /** @file
Internal include file for the SMM CPU I/O Protocol. Internal include file for the SMM CPU I/O Protocol.
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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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. Reads memory-mapped registers.
The I/O operations are carried out exactly as requested. The caller is 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, responsible for any alignment and I/O width issues that the bus, device,
platform, or type of I/O might require. platform, or type of I/O might require.
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
@param[in] Width Signifies the width of the I/O operations. @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 @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[out] Buffer For read operations, the destination buffer to store @param[out] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @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 lack of resources
**/ **/
@@ -63,23 +63,23 @@ CpuMemoryServiceRead (
/** /**
Writes memory-mapped registers. Writes memory-mapped registers.
The I/O operations are carried out exactly as requested. The caller is 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, responsible for any alignment and I/O width issues that the bus, device,
platform, or type of I/O might require. platform, or type of I/O might require.
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
@param[in] Width Signifies the width of the I/O operations. @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 @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[in] Buffer For read operations, the destination buffer to store @param[in] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @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 lack of resources
**/ **/
@@ -96,23 +96,23 @@ CpuMemoryServiceWrite (
/** /**
Reads I/O registers. Reads I/O registers.
The I/O operations are carried out exactly as requested. The caller is 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, responsible for any alignment and I/O width issues that the bus, device,
platform, or type of I/O might require. platform, or type of I/O might require.
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
@param[in] Width Signifies the width of the I/O operations. @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 @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[out] Buffer For read operations, the destination buffer to store @param[out] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @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 lack of resources
**/ **/
@@ -129,23 +129,23 @@ CpuIoServiceRead (
/** /**
Write I/O registers. Write I/O registers.
The I/O operations are carried out exactly as requested. The caller is 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, responsible for any alignment and I/O width issues that the bus, device,
platform, or type of I/O might require. platform, or type of I/O might require.
@param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
@param[in] Width Signifies the width of the I/O operations. @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 @param[in] Address The base address of the I/O operations. The caller is
responsible for aligning the Address if required. responsible for aligning the Address if required.
@param[in] Count The number of I/O operations to perform. @param[in] Count The number of I/O operations to perform.
@param[in] Buffer For read operations, the destination buffer to store @param[in] Buffer For read operations, the destination buffer to store
the results. For write operations, the source buffer the results. For write operations, the source buffer
from which to write data. from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device. @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_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @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 lack of resources
**/ **/

View File

@@ -1,7 +1,7 @@
## @file ## @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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # 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. # The following information is for reference only and not required by the build tools.
# #
# VALID_ARCHITECTURES = IA32 X64 # VALID_ARCHITECTURES = IA32 X64
# #
[Sources] [Sources]
CpuIo2Smm.c CpuIo2Smm.c
CpuIo2Smm.h CpuIo2Smm.h
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
@@ -41,7 +41,7 @@
IoLib IoLib
SmmServicesTableLib SmmServicesTableLib
BaseMemoryLib BaseMemoryLib
[Protocols] [Protocols]
gEfiSmmCpuIo2ProtocolGuid ## PRODUCES gEfiSmmCpuIo2ProtocolGuid ## PRODUCES

View File

@@ -1,7 +1,7 @@
// /** @file // /** @file
// CpuIo2Smm Localized Strings and Content // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 #language en-US
"CPU I/O v2 SMM Driver" "CPU I/O v2 SMM Driver"

View File

@@ -1,16 +1,16 @@
/** @file /** @file
Produces the CPU I/O PPI. 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> Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
@@ -54,7 +54,7 @@ EFI_PEI_PPI_DESCRIPTOR gPpiList = {
&gEfiPeiCpuIoPpiInstalledGuid, &gEfiPeiCpuIoPpiInstalledGuid,
NULL NULL
}; };
// //
// Lookup table for increment values based on transfer widths // 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_SUCCESS The parameters for this request pass the checks.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
EFI_STATUS EFI_STATUS
CpuIoCheckParameter ( CpuIoCheckParameter (
@@ -148,20 +148,20 @@ CpuIoCheckParameter (
if (!MmioOperation && (Width == EfiPeiCpuIoWidthUint64)) { if (!MmioOperation && (Width == EfiPeiCpuIoWidthUint64)) {
return EFI_INVALID_PARAMETER; 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 // allowed address. The maximum address implied by the parameters passed in is
// Address + Size * Count. If the following condition is met, then the transfer // Address + Size * Count. If the following condition is met, then the transfer
// is not supported. // is not supported.
// //
// Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1 // 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 // can also be the maximum integer value supported by the CPU, this range
// check must be adjusted to avoid all overflow conditions. // 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). // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1).
// //
Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS); Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS);
@@ -169,7 +169,7 @@ CpuIoCheckParameter (
if (Address > Limit) { if (Address > Limit) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
} else { } else {
MaxCount = RShiftU64 (Limit, Width); MaxCount = RShiftU64 (Limit, Width);
if (MaxCount < (Count - 1)) { if (MaxCount < (Count - 1)) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
@@ -178,7 +178,7 @@ CpuIoCheckParameter (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -196,7 +196,7 @@ CpuIoCheckParameter (
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
@@ -270,7 +270,7 @@ CpuMemoryServiceRead (
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
@@ -344,7 +344,7 @@ CpuMemoryServiceWrite (
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
@@ -438,7 +438,7 @@ CpuIoServiceRead (
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
@@ -517,14 +517,14 @@ CpuIoServiceWrite (
} }
} }
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/** /**
8-bit I/O read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -545,7 +545,7 @@ CpuIoRead8 (
/** /**
16-bit I/O read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -567,7 +567,7 @@ CpuIoRead16 (
/** /**
32-bit I/O read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -589,7 +589,7 @@ CpuIoRead32 (
/** /**
64-bit I/O read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -611,7 +611,7 @@ CpuIoRead64 (
/** /**
8-bit I/O write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -633,7 +633,7 @@ CpuIoWrite8 (
/** /**
16-bit I/O write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -655,7 +655,7 @@ CpuIoWrite16 (
/** /**
32-bit I/O write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -677,7 +677,7 @@ CpuIoWrite32 (
/** /**
64-bit I/O write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -699,7 +699,7 @@ CpuIoWrite64 (
/** /**
8-bit memory read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -721,7 +721,7 @@ CpuMemRead8 (
/** /**
16-bit memory read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -743,7 +743,7 @@ CpuMemRead16 (
/** /**
32-bit memory read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -765,7 +765,7 @@ CpuMemRead32 (
/** /**
64-bit memory read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -787,7 +787,7 @@ CpuMemRead64 (
/** /**
8-bit memory write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -809,7 +809,7 @@ CpuMemWrite8 (
/** /**
16-bit memory write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -831,7 +831,7 @@ CpuMemWrite16 (
/** /**
32-bit memory write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -853,7 +853,7 @@ CpuMemWrite32 (
/** /**
64-bit memory write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @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. 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] 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 @retval EFI_SUCCESS CPU I/O PPI successfully installed
@@ -896,12 +896,12 @@ CpuIoInitialize (
// Register so it will be automatically shadowed to memory // Register so it will be automatically shadowed to memory
// //
Status = PeiServicesRegisterForShadow (FileHandle); Status = PeiServicesRegisterForShadow (FileHandle);
// //
// Make CpuIo pointer in PeiService table point to gCpuIoPpi // Make CpuIo pointer in PeiService table point to gCpuIoPpi
// //
(*((EFI_PEI_SERVICES **)PeiServices))->CpuIo = &gCpuIoPpi; (*((EFI_PEI_SERVICES **)PeiServices))->CpuIo = &gCpuIoPpi;
if (Status == EFI_ALREADY_STARTED) { if (Status == EFI_ALREADY_STARTED) {
// //
// Shadow completed and running from memory // Shadow completed and running from memory
@@ -911,6 +911,6 @@ CpuIoInitialize (
Status = PeiServicesInstallPpi (&gPpiList); Status = PeiServicesInstallPpi (&gPpiList);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@@ -1,14 +1,14 @@
/** @file /** @file
Internal include file for the CPU I/O PPI. Internal include file for the CPU I/O PPI.
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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
@@ -69,7 +69,7 @@ CpuMemoryServiceRead (
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
@@ -98,7 +98,7 @@ CpuMemoryServiceWrite (
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
@@ -127,7 +127,7 @@ CpuIoServiceRead (
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
@retval EFI_INVALID_PARAMETER Buffer is NULL. @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. and Count is not valid for this EFI system.
**/ **/
@@ -145,7 +145,7 @@ CpuIoServiceWrite (
/** /**
8-bit I/O read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -163,7 +163,7 @@ CpuIoRead8 (
/** /**
16-bit I/O read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -182,7 +182,7 @@ CpuIoRead16 (
/** /**
32-bit I/O read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -201,7 +201,7 @@ CpuIoRead32 (
/** /**
64-bit I/O read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -220,7 +220,7 @@ CpuIoRead64 (
/** /**
8-bit I/O write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -239,7 +239,7 @@ CpuIoWrite8 (
/** /**
16-bit I/O write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -258,7 +258,7 @@ CpuIoWrite16 (
/** /**
32-bit I/O write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -277,7 +277,7 @@ CpuIoWrite32 (
/** /**
64-bit I/O write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -296,7 +296,7 @@ CpuIoWrite64 (
/** /**
8-bit memory read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -315,7 +315,7 @@ CpuMemRead8 (
/** /**
16-bit memory read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -334,7 +334,7 @@ CpuMemRead16 (
/** /**
32-bit memory read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -353,7 +353,7 @@ CpuMemRead32 (
/** /**
64-bit memory read operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -372,7 +372,7 @@ CpuMemRead64 (
/** /**
8-bit memory write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -391,7 +391,7 @@ CpuMemWrite8 (
/** /**
16-bit memory write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -410,7 +410,7 @@ CpuMemWrite16 (
/** /**
32-bit memory write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -429,7 +429,7 @@ CpuMemWrite32 (
/** /**
64-bit memory write operations. 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. by the PEI Foundation.
@param[in] This Pointer to local data for the interface. @param[in] This Pointer to local data for the interface.
@param[in] Address The physical address of the access. @param[in] Address The physical address of the access.
@@ -444,5 +444,5 @@ CpuMemWrite64 (
IN UINT64 Address, IN UINT64 Address,
IN UINT64 Data IN UINT64 Data
); );
#endif #endif

View File

@@ -1,7 +1,7 @@
## @file ## @file
# Produces the CPU I/O PPI by using the services of the I/O Library. # 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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
@@ -18,7 +18,7 @@
MODULE_UNI_FILE = CpuIoPei.uni MODULE_UNI_FILE = CpuIoPei.uni
FILE_GUID = AE265864-CF5D-41a8-913D-71C155E76442 FILE_GUID = AE265864-CF5D-41a8-913D-71C155E76442
MODULE_TYPE = PEIM MODULE_TYPE = PEIM
VERSION_STRING = 1.0 VERSION_STRING = 1.0
ENTRY_POINT = CpuIoInitialize ENTRY_POINT = CpuIoInitialize
# #
@@ -30,7 +30,7 @@
[Sources] [Sources]
CpuIoPei.c CpuIoPei.c
CpuIoPei.h CpuIoPei.h
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec

View File

@@ -3,13 +3,13 @@
// //
// Produces the CPU I/O PPI by using the services of the I/O Library. // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //

View File

@@ -1,7 +1,7 @@
// /** @file // /** @file
// CpuIoPei Localized Strings and Content // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
// //
// **/ // **/
#string STR_PROPERTIES_MODULE_NAME #string STR_PROPERTIES_MODULE_NAME
#language en-US #language en-US
"CPU I/O PEI Module" "CPU I/O PEI Module"

View File

@@ -1,7 +1,7 @@
/** @file /** @file
Update and publish processors' BIST information. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -179,7 +179,7 @@ CollectBistDataFromPpi (
UINTN BistInformationSize; UINTN BistInformationSize;
EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2; EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2;
EFI_SEC_PLATFORM_INFORMATION_CPU *CpuInstanceInHob; EFI_SEC_PLATFORM_INFORMATION_CPU *CpuInstanceInHob;
MpInitLibGetNumberOfProcessors(&NumberOfProcessors, &NumberOfEnabledProcessors); MpInitLibGetNumberOfProcessors(&NumberOfProcessors, &NumberOfEnabledProcessors);
@@ -264,7 +264,7 @@ CollectBistDataFromPpi (
CpuInstanceInHob[ProcessorNumber].CpuLocation = (UINT32) ProcessorInfo.ProcessorId; CpuInstanceInHob[ProcessorNumber].CpuLocation = (UINT32) ProcessorInfo.ProcessorId;
CpuInstanceInHob[ProcessorNumber].InfoRecord.IA32HealthFlags = BistData; CpuInstanceInHob[ProcessorNumber].InfoRecord.IA32HealthFlags = BistData;
} }
// //
// Build SecPlatformInformation2 PPI GUIDed HOB that also could be consumed // Build SecPlatformInformation2 PPI GUIDed HOB that also could be consumed
// by CPU MP driver to get CPU BIST data // by CPU MP driver to get CPU BIST data

View File

@@ -1,7 +1,7 @@
/** @file /** @file
CPU PEI Module installs CPU Multiple Processor PPI. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -446,7 +446,7 @@ CpuMpPeimInit (
} }
Status = InitializeCpuExceptionHandlers (VectorInfo); Status = InitializeCpuExceptionHandlers (VectorInfo);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
// //
// Wakeup APs to do initialization // Wakeup APs to do initialization
// //

View File

@@ -4,7 +4,7 @@
Local APIC library assumes local APIC is enabled. It does not Local APIC library assumes local APIC is enabled. It does not
handles cases where local APIC is disabled. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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. 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 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. the 32-bit local APIC ID is returned as initial APIC ID.
@return 32-bit initial local APIC ID of the executing processor. @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. 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 ApicId The local APIC ID of the target processor.
@param Vector The vector number of the interrupt being sent. @param Vector The vector number of the interrupt being sent.
@@ -133,7 +133,7 @@ SendFixedIpi (
/** /**
Send a Fixed IPI to all processors excluding self. 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. @param Vector The vector number of the interrupt being sent.
**/ **/
@@ -146,7 +146,7 @@ SendFixedIpiAllExcludingSelf (
/** /**
Send a SMI IPI to a specified target processor. 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. @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. 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 VOID
EFIAPI EFIAPI
@@ -170,7 +170,7 @@ SendSmiIpiAllExcludingSelf (
/** /**
Send an INIT IPI to a specified target processor. 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. @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. 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 VOID
EFIAPI EFIAPI
@@ -194,7 +194,7 @@ SendInitIpiAllExcludingSelf (
/** /**
Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. 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 >= 1M, then ASSERT.
if StartupRoutine is not multiple of 4K, 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. 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 >= 1M, then ASSERT.
if StartupRoutine is not multiple of 4K, 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. Interrupt (MSI) to the Local APIC of the currently executing processor.
@return 32-bit address used to send an MSI to the Local APIC. @return 32-bit address used to send an MSI to the Local APIC.
**/ **/
UINT32 UINT32
EFIAPI EFIAPI
GetApicMsiAddress ( GetApicMsiAddress (
VOID 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. Interrupt (MSI) to the Local APIC of the currently executing processor.
If Vector is not in range 0x10..0xFE, then ASSERT(). If Vector is not in range 0x10..0xFE, then ASSERT().
If DeliveryMode is not supported, 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 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: is handled. The only supported values are:
0: LOCAL_APIC_DELIVERY_MODE_FIXED 0: LOCAL_APIC_DELIVERY_MODE_FIXED
1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY 1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY
@@ -391,19 +391,19 @@ GetApicMsiAddress (
4: LOCAL_APIC_DELIVERY_MODE_NMI 4: LOCAL_APIC_DELIVERY_MODE_NMI
5: LOCAL_APIC_DELIVERY_MODE_INIT 5: LOCAL_APIC_DELIVERY_MODE_INIT
7: LOCAL_APIC_DELIVERY_MODE_EXTINT 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. FALSE specifies an edge triggered interrupt.
@param AssertionLevel Ignored if LevelTriggered is FALSE. @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. 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. when the interrupt line is deasserted.
@return 64-bit data value used to send an MSI to the Local APIC. @return 64-bit data value used to send an MSI to the Local APIC.
**/ **/
UINT64 UINT64
EFIAPI EFIAPI
GetApicMsiValue ( GetApicMsiValue (
IN UINT8 Vector, IN UINT8 Vector,
IN UINTN DeliveryMode, IN UINTN DeliveryMode,
@@ -431,6 +431,6 @@ GetProcessorLocationByApicId (
OUT UINT32 *Core OPTIONAL, OUT UINT32 *Core OPTIONAL,
OUT UINT32 *Thread OPTIONAL OUT UINT32 *Thread OPTIONAL
); );
#endif #endif

View File

@@ -8,10 +8,10 @@
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
## ##
[Defines] [Defines]
@@ -21,7 +21,7 @@
FILE_GUID = 34C24FD7-7A90-45c2-89FD-946473D9CE98 FILE_GUID = 34C24FD7-7A90-45c2-89FD-946473D9CE98
MODULE_TYPE = BASE MODULE_TYPE = BASE
VERSION_STRING = 1.0 VERSION_STRING = 1.0
LIBRARY_CLASS = UefiCpuLib LIBRARY_CLASS = UefiCpuLib
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.

View File

@@ -3,13 +3,13 @@
// //
// The library routines are UEFI specification compliant. // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //

View File

@@ -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 #* This program and the accompanying materials
#* are licensed and made available under the terms and conditions of the BSD License #* 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 #* 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 # all exceptions masked, double-precision, round-to-nearest
# #
ASM_PFX(mFpuControlWord): .word 0x027F ASM_PFX(mFpuControlWord): .word 0x027F
@@ -41,7 +41,7 @@ ASM_PFX(InitializeFloatingPointUnits):
# #
finit finit
fldcw ASM_PFX(mFpuControlWord) fldcw ASM_PFX(mFpuControlWord)
# #
# Use CpuId instructuion (CPUID.01H:EDX.SSE[bit 25] = 1) to test # Use CpuId instructuion (CPUID.01H:EDX.SSE[bit 25] = 1) to test
# whether the processor supports SSE instruction. # whether the processor supports SSE instruction.
@@ -50,14 +50,14 @@ ASM_PFX(InitializeFloatingPointUnits):
cpuid cpuid
btl $25, %edx btl $25, %edx
jnc Done jnc Done
# #
# Set OSFXSR bit 9 in CR4 # Set OSFXSR bit 9 in CR4
# #
movl %cr4, %eax movl %cr4, %eax
or $0x200, %eax or $0x200, %eax
movl %eax, %cr4 movl %eax, %cr4
# #
# The processor should support SSE instruction and we can use # The processor should support SSE instruction and we can use
# ldmxcsr instruction # ldmxcsr instruction

View File

@@ -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 #* This program and the accompanying materials
#* are licensed and made available under the terms and conditions of the BSD License #* 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 #* 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 # Initialize floating point units
# #
finit finit
# #
# Float control word initial value: # Float control word initial value:
# all exceptions masked, double-precision, round-to-nearest # all exceptions masked, double-precision, round-to-nearest
# #
pushq $0x037F pushq $0x037F
lea (%rsp), %rax lea (%rsp), %rax
fldcw (%rax) fldcw (%rax)
popq %rax popq %rax
# #
# Set OSFXSR bit 9 in CR4 # Set OSFXSR bit 9 in CR4
# #
movq %cr4, %rax movq %cr4, %rax
or $0x200, %rax or $0x200, %rax
movq %rax, %cr4 movq %rax, %cr4
# #
# Multimedia-extensions control word: # Multimedia-extensions control word:
# all exceptions masked, round-to-nearest, flush to zero for masked underflow # all exceptions masked, round-to-nearest, flush to zero for masked underflow
# #
pushq $0x01F80 pushq $0x01F80
lea (%rsp), %rax lea (%rsp), %rax
ldmxcsr (%rax) ldmxcsr (%rax)
popq %rax popq %rax
ret ret

View File

@@ -3,7 +3,7 @@
This local APIC library instance supports xAPIC mode only. 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> Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
@@ -68,12 +68,12 @@ LocalApicBaseAddressMsrSupported (
{ {
UINT32 RegEax; UINT32 RegEax;
UINTN FamilyId; UINTN FamilyId;
AsmCpuid (1, &RegEax, NULL, NULL, NULL); AsmCpuid (1, &RegEax, NULL, NULL, NULL);
FamilyId = BitFieldRead32 (RegEax, 8, 11); FamilyId = BitFieldRead32 (RegEax, 8, 11);
if (FamilyId == 0x04 || FamilyId == 0x05) { 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 // Local APIC Base Address MSR
// //
return FALSE; return FALSE;
@@ -104,7 +104,7 @@ GetLocalApicBaseAddress (
} }
ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE); ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE);
return (UINTN)(LShiftU64 ((UINT64) ApicBaseMsr.Bits.ApicBaseHi, 32)) + return (UINTN)(LShiftU64 ((UINT64) ApicBaseMsr.Bits.ApicBaseHi, 32)) +
(((UINTN)ApicBaseMsr.Bits.ApicBase) << 12); (((UINTN)ApicBaseMsr.Bits.ApicBase) << 12);
} }
@@ -197,7 +197,7 @@ WriteLocalApicReg (
/** /**
Send an IPI by writing to ICR. 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 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. @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; 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 ()) { if (LocalApicBaseAddressMsrSupported ()) {
ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE); 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. 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 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. the 32-bit local APIC ID is returned as initial APIC ID.
@return 32-bit initial local APIC ID of the executing processor. @return 32-bit initial local APIC ID of the executing processor.
@@ -338,7 +338,7 @@ GetInitialApicId (
AsmCpuid (CPUID_SIGNATURE, &MaxCpuIdIndex, NULL, NULL, NULL); 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, // And CPUID.0BH:EBX[15:0] reports a non-zero value,
// Then the initial 32-bit APIC ID = CPUID.0BH:EDX // Then the initial 32-bit APIC ID = CPUID.0BH:EDX
// Else the initial 8-bit APIC ID = CPUID.1:EBX[31:24] // Else the initial 8-bit APIC ID = CPUID.1:EBX[31:24]
@@ -368,7 +368,7 @@ GetApicId (
UINT32 ApicId; UINT32 ApicId;
ASSERT (GetApicMode () == LOCAL_APIC_MODE_XAPIC); ASSERT (GetApicMode () == LOCAL_APIC_MODE_XAPIC);
if ((ApicId = GetInitialApicId ()) < 0x100) { if ((ApicId = GetInitialApicId ()) < 0x100) {
// //
// If the initial local APIC ID is less 0x100, read APIC ID from // 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. 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 ApicId The local APIC ID of the target processor.
@param Vector The vector number of the interrupt being sent. @param Vector The vector number of the interrupt being sent.
@@ -421,7 +421,7 @@ SendFixedIpi (
/** /**
Send a Fixed IPI to all processors excluding self. 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. @param Vector The vector number of the interrupt being sent.
**/ **/
@@ -444,7 +444,7 @@ SendFixedIpiAllExcludingSelf (
/** /**
Send a SMI IPI to a specified target processor. 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. @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. 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 VOID
EFIAPI EFIAPI
@@ -485,7 +485,7 @@ SendSmiIpiAllExcludingSelf (
/** /**
Send an INIT IPI to a specified target processor. 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. @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. 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 VOID
EFIAPI EFIAPI
@@ -526,7 +526,7 @@ SendInitIpiAllExcludingSelf (
/** /**
Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. 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 >= 1M, then ASSERT.
if StartupRoutine is not multiple of 4K, 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. 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 >= 1M, then ASSERT.
if StartupRoutine is not multiple of 4K, 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.Uint32 = ReadLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET);
Dcr.Bits.DivideValue1 = (Divisor & 0x3); Dcr.Bits.DivideValue1 = (Divisor & 0x3);
Dcr.Bits.DivideValue2 = (Divisor >> 2); 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. Interrupt (MSI) to the Local APIC of the currently executing processor.
@return 32-bit address used to send an MSI to the Local APIC. @return 32-bit address used to send an MSI to the Local APIC.
**/ **/
UINT32 UINT32
EFIAPI EFIAPI
GetApicMsiAddress ( GetApicMsiAddress (
VOID VOID
) )
@@ -911,7 +911,7 @@ GetApicMsiAddress (
LOCAL_APIC_MSI_ADDRESS MsiAddress; 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. // of the currently executing processor.
// //
MsiAddress.Uint32 = 0; MsiAddress.Uint32 = 0;
@@ -919,17 +919,17 @@ GetApicMsiAddress (
MsiAddress.Bits.DestinationId = GetApicId (); MsiAddress.Bits.DestinationId = GetApicId ();
return MsiAddress.Uint32; 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. Interrupt (MSI) to the Local APIC of the currently executing processor.
If Vector is not in range 0x10..0xFE, then ASSERT(). If Vector is not in range 0x10..0xFE, then ASSERT().
If DeliveryMode is not supported, 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 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: is handled. The only supported values are:
0: LOCAL_APIC_DELIVERY_MODE_FIXED 0: LOCAL_APIC_DELIVERY_MODE_FIXED
1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY 1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY
@@ -937,19 +937,19 @@ GetApicMsiAddress (
4: LOCAL_APIC_DELIVERY_MODE_NMI 4: LOCAL_APIC_DELIVERY_MODE_NMI
5: LOCAL_APIC_DELIVERY_MODE_INIT 5: LOCAL_APIC_DELIVERY_MODE_INIT
7: LOCAL_APIC_DELIVERY_MODE_EXTINT 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. FALSE specifies an edge triggered interrupt.
@param AssertionLevel Ignored if LevelTriggered is FALSE. @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. 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. when the interrupt line is deasserted.
@return 64-bit data value used to send an MSI to the Local APIC. @return 64-bit data value used to send an MSI to the Local APIC.
**/ **/
UINT64 UINT64
EFIAPI EFIAPI
GetApicMsiValue ( GetApicMsiValue (
IN UINT8 Vector, IN UINT8 Vector,
IN UINTN DeliveryMode, IN UINTN DeliveryMode,
@@ -961,7 +961,7 @@ GetApicMsiValue (
ASSERT (Vector >= 0x10 && Vector <= 0xFE); ASSERT (Vector >= 0x10 && Vector <= 0xFE);
ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3); ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3);
MsiData.Uint64 = 0; MsiData.Uint64 = 0;
MsiData.Bits.Vector = Vector; MsiData.Bits.Vector = Vector;
MsiData.Bits.DeliveryMode = (UINT32)DeliveryMode; MsiData.Bits.DeliveryMode = (UINT32)DeliveryMode;

View File

@@ -4,15 +4,15 @@
# Note: Local APIC library assumes local APIC is enabled. It does not handle cases # Note: Local APIC library assumes local APIC is enabled. It does not handle cases
# where local APIC is disabled. # 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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
## ##
[Defines] [Defines]
@@ -22,7 +22,7 @@
FILE_GUID = D87CA0A8-1AC2-439b-90F8-EF4A2AC88DAF FILE_GUID = D87CA0A8-1AC2-439b-90F8-EF4A2AC88DAF
MODULE_TYPE = BASE MODULE_TYPE = BASE
VERSION_STRING = 1.1 VERSION_STRING = 1.1
LIBRARY_CLASS = LocalApicLib LIBRARY_CLASS = LocalApicLib
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.

View File

@@ -4,13 +4,13 @@
// Note: Local APIC library assumes local APIC is enabled. It does not handle cases // Note: Local APIC library assumes local APIC is enabled. It does not handle cases
// where local APIC is disabled. // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //

View File

@@ -4,7 +4,7 @@
This local APIC library instance supports x2APIC capable processors This local APIC library instance supports x2APIC capable processors
which have xAPIC and x2APIC modes. 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> Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
@@ -69,12 +69,12 @@ LocalApicBaseAddressMsrSupported (
{ {
UINT32 RegEax; UINT32 RegEax;
UINTN FamilyId; UINTN FamilyId;
AsmCpuid (1, &RegEax, NULL, NULL, NULL); AsmCpuid (1, &RegEax, NULL, NULL, NULL);
FamilyId = BitFieldRead32 (RegEax, 8, 11); FamilyId = BitFieldRead32 (RegEax, 8, 11);
if (FamilyId == 0x04 || FamilyId == 0x05) { 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 // Local APIC Base Address MSR
// //
return FALSE; return FALSE;
@@ -105,7 +105,7 @@ GetLocalApicBaseAddress (
} }
ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE); ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE);
return (UINTN)(LShiftU64 ((UINT64) ApicBaseMsr.Bits.ApicBaseHi, 32)) + return (UINTN)(LShiftU64 ((UINT64) ApicBaseMsr.Bits.ApicBaseHi, 32)) +
(((UINTN)ApicBaseMsr.Bits.ApicBase) << 12); (((UINTN)ApicBaseMsr.Bits.ApicBase) << 12);
} }
@@ -236,7 +236,7 @@ WriteLocalApicReg (
/** /**
Send an IPI by writing to ICR. 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 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. @param ApicId APIC ID of the target processor if this IPI is targeted for a specific processor.
@@ -301,7 +301,7 @@ SendIpi (
} else { } 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. // interrupt in x2APIC mode.
// //
MsrValue = LShiftU64 ((UINT64) ApicId, 32) | IcrLow; 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. 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 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. the 32-bit local APIC ID is returned as initial APIC ID.
@return 32-bit initial local APIC ID of the executing processor. @return 32-bit initial local APIC ID of the executing processor.
@@ -435,7 +435,7 @@ GetInitialApicId (
// //
AsmCpuid (CPUID_SIGNATURE, &MaxCpuIdIndex, NULL, NULL, NULL); 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, // And CPUID.0BH:EBX[15:0] reports a non-zero value,
// Then the initial 32-bit APIC ID = CPUID.0BH:EDX // Then the initial 32-bit APIC ID = CPUID.0BH:EDX
// Else the initial 8-bit APIC ID = CPUID.1:EBX[31:24] // 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. 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 ApicId The local APIC ID of the target processor.
@param Vector The vector number of the interrupt being sent. @param Vector The vector number of the interrupt being sent.
@@ -516,7 +516,7 @@ SendFixedIpi (
/** /**
Send a Fixed IPI to all processors excluding self. 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. @param Vector The vector number of the interrupt being sent.
**/ **/
@@ -539,7 +539,7 @@ SendFixedIpiAllExcludingSelf (
/** /**
Send a SMI IPI to a specified target processor. 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. @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. 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 VOID
EFIAPI EFIAPI
@@ -580,7 +580,7 @@ SendSmiIpiAllExcludingSelf (
/** /**
Send an INIT IPI to a specified target processor. 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. @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. 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 VOID
EFIAPI EFIAPI
@@ -621,7 +621,7 @@ SendInitIpiAllExcludingSelf (
/** /**
Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. 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 >= 1M, then ASSERT.
if StartupRoutine is not multiple of 4K, 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. 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 >= 1M, then ASSERT.
if StartupRoutine is not multiple of 4K, 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.Uint32 = ReadLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET);
Dcr.Bits.DivideValue1 = (Divisor & 0x3); Dcr.Bits.DivideValue1 = (Divisor & 0x3);
Dcr.Bits.DivideValue2 = (Divisor >> 2); 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. Interrupt (MSI) to the Local APIC of the currently executing processor.
@return 32-bit address used to send an MSI to the Local APIC. @return 32-bit address used to send an MSI to the Local APIC.
**/ **/
UINT32 UINT32
EFIAPI EFIAPI
GetApicMsiAddress ( GetApicMsiAddress (
VOID VOID
) )
@@ -1006,7 +1006,7 @@ GetApicMsiAddress (
LOCAL_APIC_MSI_ADDRESS MsiAddress; 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. // of the currently executing processor.
// //
MsiAddress.Uint32 = 0; MsiAddress.Uint32 = 0;
@@ -1014,17 +1014,17 @@ GetApicMsiAddress (
MsiAddress.Bits.DestinationId = GetApicId (); MsiAddress.Bits.DestinationId = GetApicId ();
return MsiAddress.Uint32; 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. Interrupt (MSI) to the Local APIC of the currently executing processor.
If Vector is not in range 0x10..0xFE, then ASSERT(). If Vector is not in range 0x10..0xFE, then ASSERT().
If DeliveryMode is not supported, 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 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: is handled. The only supported values are:
0: LOCAL_APIC_DELIVERY_MODE_FIXED 0: LOCAL_APIC_DELIVERY_MODE_FIXED
1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY 1: LOCAL_APIC_DELIVERY_MODE_LOWEST_PRIORITY
@@ -1032,19 +1032,19 @@ GetApicMsiAddress (
4: LOCAL_APIC_DELIVERY_MODE_NMI 4: LOCAL_APIC_DELIVERY_MODE_NMI
5: LOCAL_APIC_DELIVERY_MODE_INIT 5: LOCAL_APIC_DELIVERY_MODE_INIT
7: LOCAL_APIC_DELIVERY_MODE_EXTINT 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. FALSE specifies an edge triggered interrupt.
@param AssertionLevel Ignored if LevelTriggered is FALSE. @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. 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. when the interrupt line is deasserted.
@return 64-bit data value used to send an MSI to the Local APIC. @return 64-bit data value used to send an MSI to the Local APIC.
**/ **/
UINT64 UINT64
EFIAPI EFIAPI
GetApicMsiValue ( GetApicMsiValue (
IN UINT8 Vector, IN UINT8 Vector,
IN UINTN DeliveryMode, IN UINTN DeliveryMode,
@@ -1056,7 +1056,7 @@ GetApicMsiValue (
ASSERT (Vector >= 0x10 && Vector <= 0xFE); ASSERT (Vector >= 0x10 && Vector <= 0xFE);
ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3); ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3);
MsiData.Uint64 = 0; MsiData.Uint64 = 0;
MsiData.Bits.Vector = Vector; MsiData.Bits.Vector = Vector;
MsiData.Bits.DeliveryMode = (UINT32)DeliveryMode; MsiData.Bits.DeliveryMode = (UINT32)DeliveryMode;

View File

@@ -4,15 +4,15 @@
# Note: Local APIC library assumes local APIC is enabled. It does not handle cases # Note: Local APIC library assumes local APIC is enabled. It does not handle cases
# where local APIC is disabled. # 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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
## ##
[Defines] [Defines]
@@ -22,7 +22,7 @@
FILE_GUID = 967B6E05-F10D-4c10-8BF7-365291CA143F FILE_GUID = 967B6E05-F10D-4c10-8BF7-365291CA143F
MODULE_TYPE = BASE MODULE_TYPE = BASE
VERSION_STRING = 1.1 VERSION_STRING = 1.1
LIBRARY_CLASS = LocalApicLib LIBRARY_CLASS = LocalApicLib
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.

View File

@@ -4,13 +4,13 @@
// Note: Local APIC library assumes local APIC is enabled. It does not handle cases // Note: Local APIC library assumes local APIC is enabled. It does not handle cases
// where local APIC is disabled. // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //

View File

@@ -1,7 +1,7 @@
/** @file /** @file
CPU Common features library header 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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. processor.
@param[in] ProcessorNumber The index of the CPU executing this function. @param[in] ProcessorNumber The index of the CPU executing this function.
@@ -889,14 +889,14 @@ PpinSupport (
by CPU_FEATURE_GET_CONFIG_DATA. NULL if by CPU_FEATURE_GET_CONFIG_DATA. NULL if
CPU_FEATURE_GET_CONFIG_DATA was not provided in CPU_FEATURE_GET_CONFIG_DATA was not provided in
RegisterCpuFeature(). 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. Number feature must be enabled.
If FALSE, then the Protected Processor Inventory If FALSE, then the Protected Processor Inventory
Number feature must be disabled. Number feature must be disabled.
@retval RETURN_SUCCESS Protected Processor Inventory Number feature is @retval RETURN_SUCCESS Protected Processor Inventory Number feature is
initialized. 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. 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. processor.
@param[in] ProcessorNumber The index of the CPU executing this function. @param[in] ProcessorNumber The index of the CPU executing this function.

View File

@@ -4,7 +4,7 @@
# This library registers CPU features defined in Intel(R) 64 and IA-32 # This library registers CPU features defined in Intel(R) 64 and IA-32
# Architectures Software Developer's Manual. # 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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@@ -68,4 +68,4 @@
gUefiCpuPkgTokenSpaceGuid.PcdCpuClockModulationDutyCycle ## SOMETIMES_CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdCpuClockModulationDutyCycle ## SOMETIMES_CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdIsPowerOnReset ## SOMETIMES_CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdIsPowerOnReset ## SOMETIMES_CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceOutputScheme ## SOMETIMES_CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceOutputScheme ## SOMETIMES_CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceMemSize ## SOMETIMES_CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceMemSize ## SOMETIMES_CONSUMES

View File

@@ -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. processor.
@param[in] ProcessorNumber The index of the CPU executing this function. @param[in] ProcessorNumber The index of the CPU executing this function.

View File

@@ -1,7 +1,7 @@
/** @file /** @file
Protected Processor Inventory Number(PPIN) feature. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -15,7 +15,7 @@
#include "CpuCommonFeatures.h" #include "CpuCommonFeatures.h"
/** /**
Detects if Protected Processor Inventory Number feature supported on current Detects if Protected Processor Inventory Number feature supported on current
processor. processor.
@param[in] ProcessorNumber The index of the CPU executing this function. @param[in] ProcessorNumber The index of the CPU executing this function.
@@ -41,13 +41,13 @@ PpinSupport (
{ {
MSR_IVY_BRIDGE_PLATFORM_INFO_1_REGISTER PlatformInfo; MSR_IVY_BRIDGE_PLATFORM_INFO_1_REGISTER PlatformInfo;
if ((CpuInfo->DisplayFamily == 0x06) && if ((CpuInfo->DisplayFamily == 0x06) &&
((CpuInfo->DisplayModel == 0x3E) || // Xeon E5 V2 ((CpuInfo->DisplayModel == 0x3E) || // Xeon E5 V2
(CpuInfo->DisplayModel == 0x56) || // Xeon Processor D Product (CpuInfo->DisplayModel == 0x56) || // Xeon Processor D Product
(CpuInfo->DisplayModel == 0x4F) || // Xeon E5 v4, E7 v4 (CpuInfo->DisplayModel == 0x4F) || // Xeon E5 v4, E7 v4
(CpuInfo->DisplayModel == 0x55) || // Xeon Processor Scalable (CpuInfo->DisplayModel == 0x55) || // Xeon Processor Scalable
(CpuInfo->DisplayModel == 0x57) || // Xeon Phi processor 3200, 5200, 7200 series. (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. // Check whether platform support this feature.
@@ -69,14 +69,14 @@ PpinSupport (
by CPU_FEATURE_GET_CONFIG_DATA. NULL if by CPU_FEATURE_GET_CONFIG_DATA. NULL if
CPU_FEATURE_GET_CONFIG_DATA was not provided in CPU_FEATURE_GET_CONFIG_DATA was not provided in
RegisterCpuFeature(). 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. Number feature must be enabled.
If FALSE, then the Protected Processor Inventory If FALSE, then the Protected Processor Inventory
Number feature must be disabled. Number feature must be disabled.
@retval RETURN_SUCCESS Protected Processor Inventory Number feature is @retval RETURN_SUCCESS Protected Processor Inventory Number feature is
initialized. 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. locked.
**/ **/

View File

@@ -1,7 +1,7 @@
/** @file /** @file
Intel Processor Trace feature. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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. /// 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. /// 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 /// 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. /// current table (for circular array) or to the base of another table.
/// At least 2 entries are needed because the list of entries must /// 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 /// be terminated by an entry with the END bit set to 1, so 2
/// entries are required to use a single valid entry. /// entries are required to use a single valid entry.
/// ///
#define MAX_TOPA_ENTRY_COUNT 2 #define MAX_TOPA_ENTRY_COUNT 2
@@ -43,7 +43,7 @@ typedef struct {
typedef struct { typedef struct {
UINT32 NumberOfProcessors; UINT32 NumberOfProcessors;
UINT8 ProcTraceOutputScheme; UINT8 ProcTraceOutputScheme;
UINT32 ProcTraceMemSize; UINT32 ProcTraceMemSize;
UINTN *ThreadMemRegionTable; 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. processor.
@param[in] ProcessorNumber The index of the CPU executing this function. @param[in] ProcessorNumber The index of the CPU executing this function.
@@ -291,7 +291,7 @@ ProcTraceInitialize (
// //
// Single Range output scheme // Single Range output scheme
// //
if (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported && if (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported &&
(ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeSingleRange)) { (ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeSingleRange)) {
if (FirstIn) { if (FirstIn) {
DEBUG ((DEBUG_INFO, "ProcTrace: Enabling Single Range Output scheme \n")); DEBUG ((DEBUG_INFO, "ProcTrace: Enabling Single Range Output scheme \n"));
@@ -337,7 +337,7 @@ ProcTraceInitialize (
// //
// ToPA(Table of physical address) scheme // ToPA(Table of physical address) scheme
// //
if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported && if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported &&
(ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeToPA)) { (ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeToPA)) {
// //
// Create ToPA structure aligned at 4KB for each logical thread // Create ToPA structure aligned at 4KB for each logical thread

View File

@@ -1,7 +1,7 @@
/** @file /** @file
CPU Exception Handler Library common functions. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -177,4 +177,4 @@ ReadAndVerifyVectorInfo (
VectorInfo ++; VectorInfo ++;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@@ -1,7 +1,7 @@
/** @file /** @file
MP initialize support functions for DXE phase. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -268,7 +268,7 @@ RelocateApLoop (
ASM_RELOCATE_AP_LOOP AsmRelocateApLoopFunc; ASM_RELOCATE_AP_LOOP AsmRelocateApLoopFunc;
UINTN ProcessorNumber; UINTN ProcessorNumber;
MpInitLibWhoAmI (&ProcessorNumber); MpInitLibWhoAmI (&ProcessorNumber);
CpuMpData = GetCpuMpData (); CpuMpData = GetCpuMpData ();
MwaitSupport = IsMwaitSupport (); MwaitSupport = IsMwaitSupport ();
AsmRelocateApLoopFunc = (ASM_RELOCATE_AP_LOOP) (UINTN) mReservedApLoopFunc; 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 // Make sure that the buffer memory is executable if NX protection is enabled
// for EfiReservedMemoryType. // for EfiReservedMemoryType.
// //
// TODO: Check EFI_MEMORY_XP bit set or not once it's available in DXE GCD // TODO: Check EFI_MEMORY_XP bit set or not once it's available in DXE GCD
// service. // service.
// //

View File

@@ -193,11 +193,11 @@ GetNextProcNumber:
jz ProgramStack jz ProgramStack
add edi, 20 add edi, 20
inc ebx inc ebx
jmp GetNextProcNumber jmp GetNextProcNumber
ProgramStack: ProgramStack:
mov esp, [edi + 12] mov esp, [edi + 12]
CProcedureInvoke: CProcedureInvoke:
push ebp ; push BIST data at top of AP stack push ebp ; push BIST data at top of AP stack
xor ebp, ebp ; clear ebp for call stack trace xor ebp, ebp ; clear ebp for call stack trace

View File

@@ -655,7 +655,7 @@ ApWakeupFunction (
SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateBusy); SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateBusy);
// //
// Enable source debugging on AP function // Enable source debugging on AP function
// //
EnableDebugAgent (); EnableDebugAgent ();
// //
// Invoke AP function here // Invoke AP function here
@@ -1115,7 +1115,7 @@ CalculateTimeout (
// //
// GetPerformanceCounterProperties () returns the timestamp counter's frequency // GetPerformanceCounterProperties () returns the timestamp counter's frequency
// in Hz. // in Hz.
// //
TimestampCounterFreq = GetPerformanceCounterProperties (NULL, NULL); TimestampCounterFreq = GetPerformanceCounterProperties (NULL, NULL);
@@ -1737,7 +1737,7 @@ MpInitLibGetProcessorInfo (
enabled AP. Otherwise, it will be disabled. enabled AP. Otherwise, it will be disabled.
@retval EFI_SUCCESS BSP successfully switched. @retval EFI_SUCCESS BSP successfully switched.
@retval others Failed to switch BSP. @retval others Failed to switch BSP.
**/ **/
EFI_STATUS EFI_STATUS

View File

@@ -1,7 +1,7 @@
/** @file /** @file
Common header file for MP Initialize Library. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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. enabled AP. Otherwise, it will be disabled.
@retval EFI_SUCCESS BSP successfully switched. @retval EFI_SUCCESS BSP successfully switched.
@retval others Failed to switch BSP. @retval others Failed to switch BSP.
**/ **/
EFI_STATUS EFI_STATUS

View File

@@ -216,7 +216,7 @@ GetNextProcNumber:
jz ProgramStack jz ProgramStack
add edi, 20 add edi, 20
inc ebx inc ebx
jmp GetNextProcNumber jmp GetNextProcNumber
ProgramStack: ProgramStack:
mov rsp, qword [edi + 12] mov rsp, qword [edi + 12]

View File

@@ -1,15 +1,15 @@
## @file ## @file
# MTRR library provides APIs for MTRR operation. # 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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
## ##
[Defines] [Defines]
@@ -19,7 +19,7 @@
FILE_GUID = 6826b408-f4f3-47ee-917f-af7047f9d937 FILE_GUID = 6826b408-f4f3-47ee-917f-af7047f9d937
MODULE_TYPE = BASE MODULE_TYPE = BASE
VERSION_STRING = 1.0 VERSION_STRING = 1.0
LIBRARY_CLASS = MtrrLib LIBRARY_CLASS = MtrrLib
# #

View File

@@ -3,13 +3,13 @@
// //
// MTRR library provides APIs for MTRR operation. // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //

View File

@@ -1,7 +1,7 @@
/** @file /** @file
CPU Features Initialize functions. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -63,7 +63,7 @@ GetSupportPcd (
UINT8 *SupportBitMask; UINT8 *SupportBitMask;
SupportBitMask = AllocateCopyPool ( SupportBitMask = AllocateCopyPool (
PcdGetSize (PcdCpuFeaturesSupport), PcdGetSize (PcdCpuFeaturesSupport),
PcdGetPtr (PcdCpuFeaturesSupport) PcdGetPtr (PcdCpuFeaturesSupport)
); );
ASSERT (SupportBitMask != NULL); ASSERT (SupportBitMask != NULL);
@@ -84,7 +84,7 @@ GetConfigurationPcd (
UINT8 *SupportBitMask; UINT8 *SupportBitMask;
SupportBitMask = AllocateCopyPool ( SupportBitMask = AllocateCopyPool (
PcdGetSize (PcdCpuFeaturesUserConfiguration), PcdGetSize (PcdCpuFeaturesUserConfiguration),
PcdGetPtr (PcdCpuFeaturesUserConfiguration) PcdGetPtr (PcdCpuFeaturesUserConfiguration)
); );
ASSERT (SupportBitMask != NULL); ASSERT (SupportBitMask != NULL);

View File

@@ -3,9 +3,9 @@
# #
# Timer Library that only uses CPU resources to provide calibrated delays # Timer Library that only uses CPU resources to provide calibrated delays
# on IA-32, x64, and IPF. # on IA-32, x64, and IPF.
# Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can use this TimerLib # 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 # in their initialization without any issues. They only have to be careful in
# the implementation of runtime services and SMI handlers. # the implementation of runtime services and SMI handlers.
# Because CPU Local APIC and ITC could be programmed by OS, it cannot be # 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 # used by SMM drivers and runtime drivers, ACPI timer is recommended for SMM
# drivers and runtime drivers. # drivers and runtime drivers.
@@ -13,7 +13,7 @@
# This library differs with the SecPeiDxeTimerLibCpu library in the MdePkg in # This library differs with the SecPeiDxeTimerLibCpu library in the MdePkg in
# that it uses the local APIC library so that it supports x2APIC mode. # 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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License

View File

@@ -9,11 +9,11 @@
// Because CPU Local APIC and ITC could be programmed by OS, it cannot be // 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 // used by SMM drivers and runtime drivers, ACPI timer is recommended for SMM
// drivers and runtime drivers. // drivers and runtime drivers.
// //
// This library differs with the SecPeiDxeTimerLibCpu library in the MdePkg in // This library differs with the SecPeiDxeTimerLibCpu library in the MdePkg in
// that it uses the local APIC library so that it supports x2APIC mode. // 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 // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // are licensed and made available under the terms and conditions of the BSD License

View File

@@ -2,8 +2,8 @@
Timer Library functions built upon local APIC on IA32/x64. Timer Library functions built upon local APIC on IA32/x64.
This library uses the local APIC library so that it supports x2APIC mode. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at

View File

@@ -1,6 +1,6 @@
/** @file /** @file
SMM CPU misc functions for Ia32 arch specific. SMM CPU misc functions for Ia32 arch specific.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@@ -43,7 +43,7 @@ InitializeIDTSmmStackGuard (
/** /**
Initialize Gdt for all processors. Initialize Gdt for all processors.
@param[in] Cr3 CR3 value. @param[in] Cr3 CR3 value.
@param[out] GdtStepSize The step size for GDT table. @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 // IA32 Stack Guard need use task switch to switch stack that need
// write GDT and TSS, so AllocateCodePages() could not be used here // 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)); GdtTssTables = (UINT8*)AllocatePages (EFI_SIZE_TO_PAGES (mGdtBufferSize));
ASSERT (GdtTssTables != NULL); ASSERT (GdtTssTables != NULL);

View File

@@ -1,7 +1,7 @@
/** @file /** @file
SMM MP service implementation 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> Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
@@ -199,7 +199,7 @@ AllCpusInSmmWithExceptions (
/** /**
Has OS enabled Lmce in the MSR_IA32_MCG_EXT_CTL Has OS enabled Lmce in the MSR_IA32_MCG_EXT_CTL
@retval TRUE Os enable lmce. @retval TRUE Os enable lmce.
@retval FALSE Os not 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. delivered to only the logical processor.
@retval TRUE LMCE was signaled. @retval TRUE LMCE was signaled.
@@ -1046,7 +1046,7 @@ CpuSmmDebugEntry (
) )
{ {
SMRAM_SAVE_STATE_MAP *CpuSaveState; SMRAM_SAVE_STATE_MAP *CpuSaveState;
if (FeaturePcdGet (PcdCpuSmmDebug)) { if (FeaturePcdGet (PcdCpuSmmDebug)) {
ASSERT(CpuIndex < mMaxNumberOfCpus); ASSERT(CpuIndex < mMaxNumberOfCpus);
CpuSaveState = (SMRAM_SAVE_STATE_MAP *)gSmmCpuPrivate->CpuSaveState[CpuIndex]; CpuSaveState = (SMRAM_SAVE_STATE_MAP *)gSmmCpuPrivate->CpuSaveState[CpuIndex];

View File

@@ -1,6 +1,6 @@
/** @file /** @file
SMM CPU misc functions for x64 arch specific. SMM CPU misc functions for x64 arch specific.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@@ -40,7 +40,7 @@ InitializeIDTSmmStackGuard (
/** /**
Initialize Gdt for all processors. Initialize Gdt for all processors.
@param[in] Cr3 CR3 value. @param[in] Cr3 CR3 value.
@param[out] GdtStepSize The step size for GDT table. @param[out] GdtStepSize The step size for GDT table.

View File

@@ -1,9 +1,9 @@
## @file ## @file
# Reset Vector # Reset Vector
# #
# This VTF requires build time fixups in order to find the SEC entry point. # 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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License

View File

@@ -2,7 +2,7 @@
; @file ; @file
; Transition from 32 bit flat protected mode into 64 bit flat protected mode ; 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 ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; 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 ; which accompanies this distribution. The full text of the license may be found at
@@ -24,7 +24,7 @@ Transition32FlatTo64Flat:
mov eax, cr4 mov eax, cr4
bts eax, 5 ; enable PAE bts eax, 5 ; enable PAE
mov cr4, eax mov cr4, eax
mov ecx, 0xc0000080 mov ecx, 0xc0000080
rdmsr rdmsr

View File

@@ -2,7 +2,7 @@
; @file ; @file
; Serial port debug support macros ; 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 ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; 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 ; which accompanies this distribution. The full text of the license may be found at
@@ -107,7 +107,7 @@
BITS 16 BITS 16
%macro debugInitialize 0 %macro debugInitialize 0
jmp real16InitDebug jmp real16InitDebug
real16InitDebugReturn: real16InitDebugReturn:
%endmacro %endmacro

View File

@@ -1,7 +1,7 @@
// /** @file // /** @file
// UefiCpu Package Localized Strings and Content. // 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 // 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 terms and conditions of the BSD License which accompanies this distribution.
@@ -13,8 +13,8 @@
// //
// **/ // **/
#string STR_PROPERTIES_PACKAGE_NAME #string STR_PROPERTIES_PACKAGE_NAME
#language en-US #language en-US
"UefiCpu package" "UefiCpu package"

View File

@@ -118,7 +118,7 @@ typedef union {
UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU) 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 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 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 Available:3; // Available for use by system software
UINT64 PAT:1; // UINT64 PAT:1; //
@@ -142,7 +142,7 @@ typedef union {
UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU) 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 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 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 Available:3; // Available for use by system software
UINT64 PAT:1; // UINT64 PAT:1; //
@@ -177,9 +177,9 @@ typedef struct {
// //
/** /**
a ASM function to transfer control to OS. a ASM function to transfer control to OS.
@param S3WakingVector The S3 waking up vector saved in ACPI Facs table @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 typedef
VOID 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 // in BootScriptExecuteDxe, the rest code in S3ResumeBootOs() cannot be halted
// by soft debugger. // by soft debugger.
// //
@@ -563,7 +563,7 @@ S3ResumeBootOs (
/** /**
Restore S3 page table because we do not trust ACPINvs content. 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 S3NvsPageTableAddress PageTableAddress in ACPINvs
@param Build4GPageTableOnly If BIOS just build 4G page table only @param Build4GPageTableOnly If BIOS just build 4G page table only
@@ -611,7 +611,7 @@ RestoreS3PageTables (
// //
PageMap = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress; PageMap = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress;
S3NvsPageTableAddress += SIZE_4KB; S3NvsPageTableAddress += SIZE_4KB;
Page1GSupport = FALSE; Page1GSupport = FALSE;
if (PcdGetBool(PcdUse1GPageTable)) { if (PcdGetBool(PcdUse1GPageTable)) {
AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL); AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
@@ -622,7 +622,7 @@ RestoreS3PageTables (
} }
} }
} }
// //
// Get physical address bits supported. // Get physical address bits supported.
// //
@@ -638,7 +638,7 @@ RestoreS3PageTables (
PhysicalAddressBits = 36; PhysicalAddressBits = 36;
} }
} }
// //
// IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses. // IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses.
// //
@@ -665,7 +665,7 @@ RestoreS3PageTables (
NumberOfPml4EntriesNeeded = (UINT32)LShiftU64 (1, (PhysicalAddressBits - 39)); NumberOfPml4EntriesNeeded = (UINT32)LShiftU64 (1, (PhysicalAddressBits - 39));
NumberOfPdpEntriesNeeded = 512; NumberOfPdpEntriesNeeded = 512;
} }
PageMapLevel4Entry = PageMap; PageMapLevel4Entry = PageMap;
PageAddress = 0; PageAddress = 0;
for (IndexOfPml4Entries = 0; IndexOfPml4Entries < NumberOfPml4EntriesNeeded; IndexOfPml4Entries++, PageMapLevel4Entry++) { for (IndexOfPml4Entries = 0; IndexOfPml4Entries < NumberOfPml4EntriesNeeded; IndexOfPml4Entries++, PageMapLevel4Entry++) {
@@ -675,7 +675,7 @@ RestoreS3PageTables (
// //
PageDirectoryPointerEntry = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress; PageDirectoryPointerEntry = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress;
S3NvsPageTableAddress += SIZE_4KB; S3NvsPageTableAddress += SIZE_4KB;
// //
// Make a PML4 Entry // Make a PML4 Entry
// //
@@ -685,7 +685,7 @@ RestoreS3PageTables (
if (Page1GSupport) { if (Page1GSupport) {
PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry; PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry;
for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectory1GEntry++, PageAddress += SIZE_1GB) { for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectory1GEntry++, PageAddress += SIZE_1GB) {
// //
// Fill in the Page Directory entries // Fill in the Page Directory entries
@@ -700,17 +700,17 @@ RestoreS3PageTables (
// //
// Each Directory Pointer entries points to a page of Page Directory entires. // 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. // So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop.
// //
PageDirectoryEntry = (PAGE_TABLE_ENTRY *)S3NvsPageTableAddress; PageDirectoryEntry = (PAGE_TABLE_ENTRY *)S3NvsPageTableAddress;
S3NvsPageTableAddress += SIZE_4KB; S3NvsPageTableAddress += SIZE_4KB;
// //
// Fill in a Page Directory Pointer Entries // Fill in a Page Directory Pointer Entries
// //
PageDirectoryPointerEntry->Uint64 = (UINT64)(UINTN)PageDirectoryEntry | AddressEncMask; PageDirectoryPointerEntry->Uint64 = (UINT64)(UINTN)PageDirectoryEntry | AddressEncMask;
PageDirectoryPointerEntry->Bits.ReadWrite = 1; PageDirectoryPointerEntry->Bits.ReadWrite = 1;
PageDirectoryPointerEntry->Bits.Present = 1; PageDirectoryPointerEntry->Bits.Present = 1;
for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectoryEntry++, PageAddress += SIZE_2MB) { for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectoryEntry++, PageAddress += SIZE_2MB) {
// //
// Fill in the Page Directory entries // Fill in the Page Directory entries
@@ -725,9 +725,9 @@ RestoreS3PageTables (
} }
return ; return ;
} else { } 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 ; return ;
} }
} }
@@ -770,7 +770,7 @@ S3ResumeExecuteBootScript (
// //
// Send SMI to APs // Send SMI to APs
// //
SendSmiIpiAllExcludingSelf (); SendSmiIpiAllExcludingSelf ();
// //
// Send SMI to BSP // Send SMI to BSP
@@ -785,13 +785,13 @@ S3ResumeExecuteBootScript (
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "Close all SMRAM regions before executing boot script\n")); DEBUG ((DEBUG_INFO, "Close all SMRAM regions before executing boot script\n"));
for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) {
Status = SmmAccess->Close ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); Status = SmmAccess->Close ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index);
} }
DEBUG ((DEBUG_INFO, "Lock all SMRAM regions before executing boot script\n")); DEBUG ((DEBUG_INFO, "Lock all SMRAM regions before executing boot script\n"));
for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) {
Status = SmmAccess->Lock ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); Status = SmmAccess->Lock ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index);
} }
@@ -816,12 +816,12 @@ S3ResumeExecuteBootScript (
if (FeaturePcdGet (PcdFrameworkCompatibilitySupport)) { 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 // 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); IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile);
// //
// Make sure the newly allocated IDT align with 16-bytes // Make sure the newly allocated IDT align with 16-bytes
// //
IdtBuffer = AllocatePages (EFI_SIZE_TO_PAGES((IdtDescriptor->Limit + 1) + 16)); IdtBuffer = AllocatePages (EFI_SIZE_TO_PAGES((IdtDescriptor->Limit + 1) + 16));
if (IdtBuffer == NULL) { if (IdtBuffer == NULL) {
REPORT_STATUS_CODE ( REPORT_STATUS_CODE (
@@ -833,7 +833,7 @@ S3ResumeExecuteBootScript (
// //
// Additional 16 bytes allocated to save IA32 IDT descriptor and Pei Service Table Pointer // 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 // IA32 IDT descriptor will be used to setup IA32 IDT table for 32-bit Framework Boot Script code
// //
ZeroMem (IdtBuffer, 16); ZeroMem (IdtBuffer, 16);
AsmReadIdtr ((IA32_DESCRIPTOR *)IdtBuffer); AsmReadIdtr ((IA32_DESCRIPTOR *)IdtBuffer);
CopyMem ((VOID*)((UINT8*)IdtBuffer + 16),(VOID*)(IdtDescriptor->Base), (IdtDescriptor->Limit + 1)); CopyMem ((VOID*)((UINT8*)IdtBuffer + 16),(VOID*)(IdtDescriptor->Base), (IdtDescriptor->Limit + 1));
@@ -874,7 +874,7 @@ S3ResumeExecuteBootScript (
// Save IDT // Save IDT
// //
AsmReadIdtr (&PeiS3ResumeState->Idtr); AsmReadIdtr (&PeiS3ResumeState->Idtr);
// //
// Report Status Code to indicate S3 boot script execution // Report Status Code to indicate S3 boot script execution
// //
@@ -1011,7 +1011,7 @@ S3RestoreConfig2 (
DEBUG (( DEBUG_INFO, "AcpiS3Context = %x\n", AcpiS3Context)); 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, "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->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->S3NvsPageTableAddress = %x\n", AcpiS3Context->S3NvsPageTableAddress));
DEBUG (( DEBUG_INFO, "AcpiS3Context->S3DebugBufferAddress = %x\n", AcpiS3Context->S3DebugBufferAddress)); DEBUG (( DEBUG_INFO, "AcpiS3Context->S3DebugBufferAddress = %x\n", AcpiS3Context->S3DebugBufferAddress));
DEBUG (( DEBUG_INFO, "AcpiS3Context->BootScriptStackBase = %x\n", AcpiS3Context->BootScriptStackBase)); DEBUG (( DEBUG_INFO, "AcpiS3Context->BootScriptStackBase = %x\n", AcpiS3Context->BootScriptStackBase));
@@ -1100,7 +1100,7 @@ S3RestoreConfig2 (
AsmWriteGdtr (&mGdt); AsmWriteGdtr (&mGdt);
// //
// update segment selectors per the new GDT. // update segment selectors per the new GDT.
// //
AsmSetDataSelectors (DATA_SEGEMENT_SELECTOR); AsmSetDataSelectors (DATA_SEGEMENT_SELECTOR);
// //
// Restore interrupt state. // Restore interrupt state.
@@ -1134,7 +1134,7 @@ S3RestoreConfig2 (
Main entry for S3 Resume PEIM. Main entry for S3 Resume PEIM.
This routine is to install EFI_PEI_S3_RESUME2_PPI. This routine is to install EFI_PEI_S3_RESUME2_PPI.
@param FileHandle Handle of the file being invoked. @param FileHandle Handle of the file being invoked.
@param PeiServices Pointer to PEI Services table. @param PeiServices Pointer to PEI Services table.

View File

@@ -5,13 +5,13 @@
// This module will excute the boot script saved during last boot and after that, // This module will excute the boot script saved during last boot and after that,
// control is passed to OS waking up handler. // 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 // This program and the accompanying materials are
// licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //

View File

@@ -1,7 +1,7 @@
// /** @file // /** @file
// S3Resume2Pei Localized Strings and Content // 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 // This program and the accompanying materials are
// licensed and made available under the terms and conditions of the BSD License // licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
// //
// **/ // **/
#string STR_PROPERTIES_MODULE_NAME #string STR_PROPERTIES_MODULE_NAME
#language en-US #language en-US
"S3 Resume v2 PEI Module" "S3 Resume v2 PEI Module"