TianoCore EDK2 master
|
#include "LightMemoryTest.h"
Go to the source code of this file.
Variables | |
EFI_PHYSICAL_ADDRESS | mCurrentAddress |
LIST_ENTRY * | mCurrentLink |
NONTESTED_MEMORY_RANGE * | mCurrentRange |
UINT64 | mTestedSystemMemory |
UINT64 | mNonTestedSystemMemory |
UINT32 | GenericMemoryTestMonoPattern [GENERIC_CACHELINE_SIZE/4] |
GENERIC_MEMORY_TEST_PRIVATE | mGenericMemoryTestPrivate |
Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file LightMemoryTest.c.
INTN EFIAPI CompareMemWithoutCheckArgument | ( | IN CONST VOID * | DestinationBuffer, |
IN CONST VOID * | SourceBuffer, | ||
IN UINTN | Length | ||
) |
Compares the contents of two buffers.
This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer. If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the value returned is the first mismatched byte in SourceBuffer subtracted from the first mismatched byte in DestinationBuffer.
If Length = 0, then ASSERT().
[in] | DestinationBuffer | The pointer to the destination buffer to compare. |
[in] | SourceBuffer | The pointer to the source buffer to compare. |
[in] | Length | The number of bytes to compare. |
Non-zero | The first mismatched byte in SourceBuffer subtracted from the first mismatched byte in DestinationBuffer. |
Definition at line 62 of file LightMemoryTest.c.
EFI_STATUS ConstructBaseMemoryRange | ( | IN GENERIC_MEMORY_TEST_PRIVATE * | Private | ) |
Construct the system base memory range through GCD service.
[in] | Private | Point to generic memory test driver's private data. |
EFI_SUCCESS | Successful construct the base memory range through GCD service. |
EFI_OUT_OF_RESOURCE | Could not allocate needed resource from base memory. |
Others | Failed to construct base memory range through GCD service. |
Definition at line 90 of file LightMemoryTest.c.
EFI_STATUS ConstructNonTestedMemoryRange | ( | IN GENERIC_MEMORY_TEST_PRIVATE * | Private | ) |
Construct the system non-tested memory range through GCD service.
[in] | Private | Point to generic memory test driver's private data. |
EFI_SUCCESS | Successful construct the non-tested memory range through GCD service. |
EFI_OUT_OF_RESOURCE | Could not allocate needed resource from base memory. |
Others | Failed to construct non-tested memory range through GCD service. |
Definition at line 268 of file LightMemoryTest.c.
EFI_STATUS ConvertToTestedMemory | ( | IN UINT64 | BaseAddress, |
IN UINT64 | Length, | ||
IN UINT64 | Capabilities | ||
) |
Convert the memory range to tested.
BaseAddress | Base address of the memory range. |
Length | Length of the memory range. |
Capabilities | Capabilities of the memory range. |
EFI_SUCCESS | The memory range is converted to tested. |
others | Error happens. |
Definition at line 149 of file LightMemoryTest.c.
VOID DestroyLinkList | ( | IN GENERIC_MEMORY_TEST_PRIVATE * | Private | ) |
Destroy the link list base on the correspond link list type.
[in] | Private | Point to generic memory test driver's private data. |
Definition at line 121 of file LightMemoryTest.c.
EFI_STATUS DirectRangeTest | ( | IN GENERIC_MEMORY_TEST_PRIVATE * | Private, |
IN EFI_PHYSICAL_ADDRESS | StartAddress, | ||
IN UINT64 | Length, | ||
IN UINT64 | Capabilities | ||
) |
Test a range of the memory directly .
[in] | Private | Point to generic memory test driver's private data. |
[in] | StartAddress | Starting address of the memory range to be tested. |
[in] | Length | Length in bytes of the memory range to be tested. |
[in] | Capabilities | The bit mask of attributes that the memory range supports. |
EFI_SUCCESS | Successful test the range of memory. |
Others | Failed to test the range of memory. |
Definition at line 222 of file LightMemoryTest.c.
EFI_STATUS EFIAPI GenCompatibleRangeTest | ( | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL * | This, |
IN EFI_PHYSICAL_ADDRESS | StartAddress, | ||
IN UINT64 | Length | ||
) |
Provides the capability to test the compatible range used by some special drivers.
[in] | This | The protocol instance pointer. |
[in] | StartAddress | The start address of the compatible memory range that must be below 16M. |
[in] | Length | The compatible memory range's length. |
EFI_SUCCESS | The compatible memory range pass the memory test. |
EFI_INVALID_PARAMETER | The compatible memory range are not below Low 16M. |
Definition at line 727 of file LightMemoryTest.c.
EFI_STATUS EFIAPI GenericMemoryTestEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The generic memory test driver's entry point.
It initializes private data to default value.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
EFI_NOT_FOUND | Can't find HandOff Hob in HobList. |
other | Some error occurs when executing this entry point. |
Definition at line 889 of file LightMemoryTest.c.
EFI_STATUS EFIAPI GenMemoryTestFinished | ( | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL * | This | ) |
Finish the memory test.
[in] | This | The protocol instance pointer. |
EFI_SUCCESS | Success. All resources used in the memory test are freed. |
Definition at line 683 of file LightMemoryTest.c.
EFI_STATUS EFIAPI GenPerformMemoryTest | ( | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL * | This, |
OUT UINT64 * | TestedMemorySize, | ||
OUT UINT64 * | TotalMemorySize, | ||
OUT BOOLEAN * | ErrorOut, | ||
IN BOOLEAN | TestAbort | ||
) |
Perform the memory test.
[in] | This | The protocol instance pointer. |
[out] | TestedMemorySize | Return the tested extended memory size. |
[out] | TotalMemorySize | Return the whole system physical memory size. The total memory size does not include memory in a slot with a disabled DIMM. |
[out] | ErrorOut | TRUE if the memory error occurred. |
[in] | IfTestAbort | Indicates that the user pressed "ESC" to skip the memory test. |
EFI_SUCCESS | One block of memory passed the test. |
EFI_NOT_FOUND | All memory blocks have already been tested. |
EFI_DEVICE_ERROR | Memory device error occurred, and no agent can handle it. |
Definition at line 563 of file LightMemoryTest.c.
EFI_STATUS EFIAPI InitializeMemoryTest | ( | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL * | This, |
IN EXTENDMEM_COVERAGE_LEVEL | Level, | ||
OUT BOOLEAN * | RequireSoftECCInit | ||
) |
Initialize the generic memory test.
[in] | This | The protocol instance pointer. |
[in] | Level | The coverage level of the memory test. |
[out] | RequireSoftECCInit | Indicate if the memory need software ECC init. |
EFI_SUCCESS | The generic memory test is initialized correctly. |
EFI_NO_MEDIA | The system had no memory to be tested. |
Definition at line 460 of file LightMemoryTest.c.
EFI_STATUS PerformAddressDataLineTest | ( | IN GENERIC_MEMORY_TEST_PRIVATE * | Private | ) |
Perform the address line walking ones test.
[in] | Private | Point to generic memory test driver's private data. |
EFI_SUCCESS | Successful finished walking ones test. |
EFI_OUT_OF_RESOURCE | Could not get resource in base memory. |
EFI_ACCESS_DENIED | Code may can not run here because if walking one test failed, system may be already halt. |
Definition at line 804 of file LightMemoryTest.c.
EFI_STATUS UpdateMemoryMap | ( | IN GENERIC_MEMORY_TEST_PRIVATE * | Private | ) |
Add the extened memory to whole system memory map.
[in] | Private | Point to generic memory test driver's private data. |
EFI_SUCCESS | Successful add all the extended memory to system memory map. |
Others | Failed to add the tested extended memory. |
Definition at line 185 of file LightMemoryTest.c.
EFI_STATUS VerifyMemory | ( | IN GENERIC_MEMORY_TEST_PRIVATE * | Private, |
IN EFI_PHYSICAL_ADDRESS | Start, | ||
IN UINT64 | Size | ||
) |
Verify the range of physical memory which covered by memory test pattern.
This function will also do not return any informatin just cause system reset, because the handle error encount fatal error and disable the bad DIMMs.
[in] | Private | Point to generic memory test driver's private data. |
[in] | Start | The memory range's start address. |
[in] | Size | The memory range's size. |
EFI_SUCCESS | Successful verify the range of memory, no errors' location found. |
Others | The range of memory have errors contained. |
Definition at line 379 of file LightMemoryTest.c.
EFI_STATUS WriteMemory | ( | IN GENERIC_MEMORY_TEST_PRIVATE * | Private, |
IN EFI_PHYSICAL_ADDRESS | Start, | ||
IN UINT64 | Size | ||
) |
Write the memory test pattern into a range of physical memory.
[in] | Private | Point to generic memory test driver's private data. |
[in] | Start | The memory range's start address. |
[in] | Size | The memory range's size. |
EFI_SUCCESS | Successful write the test pattern into the non-tested memory. |
Others | The test pattern may not really write into the physical memory. |
Definition at line 330 of file LightMemoryTest.c.
UINT32 GenericMemoryTestMonoPattern[GENERIC_CACHELINE_SIZE/4] |
Definition at line 22 of file LightMemoryTest.c.
EFI_PHYSICAL_ADDRESS mCurrentAddress |
Definition at line 16 of file LightMemoryTest.c.
LIST_ENTRY* mCurrentLink |
Definition at line 17 of file LightMemoryTest.c.
NONTESTED_MEMORY_RANGE* mCurrentRange |
Definition at line 18 of file LightMemoryTest.c.
GENERIC_MEMORY_TEST_PRIVATE mGenericMemoryTestPrivate |
Definition at line 852 of file LightMemoryTest.c.
UINT64 mNonTestedSystemMemory |
Definition at line 20 of file LightMemoryTest.c.
UINT64 mTestedSystemMemory |
Definition at line 19 of file LightMemoryTest.c.