2 This protocol defines the generic memory test interfaces in Dxe phase.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __GENERIC_MEMORY_TEST_H__
10 #define __GENERIC_MEMORY_TEST_H__
12 #define EFI_GENERIC_MEMORY_TEST_PROTOCOL_GUID \
13 { 0x309de7f1, 0x7f5e, 0x4ace, {0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef} }
15 typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL
;
18 /// Memory test coverage level.
19 /// Ignore chooses not to test memory. Quick and Sparse test some memory, and Extensive performs a detailed memory test.
27 } EXTENDMEM_COVERAGE_LEVEL
;
31 Initialize the generic memory test.
33 @param This The protocol instance pointer.
34 @param Level The coverage level of the memory test.
35 @param RequireSoftECCInit Indicate if the memory need software ECC init.
37 @retval EFI_SUCCESS The generic memory test is initialized correctly.
38 @retval EFI_NO_MEDIA The system had no memory to be tested.
43 (EFIAPI
*EFI_MEMORY_TEST_INIT
)(
44 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
45 IN EXTENDMEM_COVERAGE_LEVEL Level
,
46 OUT BOOLEAN
*RequireSoftECCInit
51 Perform the memory test.
53 @param This The protocol instance pointer.
54 @param TestedMemorySize Return the tested extended memory size.
55 @param TotalMemorySize Return the whole system physical memory size.
56 The total memory size does not include memory in a slot with a disabled DIMM.
57 @param ErrorOut TRUE if the memory error occured.
58 @param IfTestAbort Indicates that the user pressed "ESC" to skip the memory test.
60 @retval EFI_SUCCESS One block of memory passed the test.
61 @retval EFI_NOT_FOUND All memory blocks have already been tested.
62 @retval EFI_DEVICE_ERROR Memory device error occured, and no agent can handle it.
67 (EFIAPI
*EFI_PERFORM_MEMORY_TEST
)(
68 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
69 OUT UINT64
*TestedMemorySize
,
70 OUT UINT64
*TotalMemorySize
,
71 OUT BOOLEAN
*ErrorOut
,
72 IN BOOLEAN IfTestAbort
77 Finish the memory test.
79 @param This The protocol instance pointer.
81 @retval EFI_SUCCESS Success. All resources used in the memory test are freed.
86 (EFIAPI
*EFI_MEMORY_TEST_FINISHED
)(
87 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
91 Provides the capability to test the compatible range used by some special drivers.
93 @param This The protocol instance pointer.
94 @param StartAddress The start address of the compatible memory range that
96 @param Length The compatible memory range's length.
98 @retval EFI_SUCCESS The compatible memory range pass the memory test.
99 @retval EFI_INVALID_PARAMETER The compatible memory range are not below Low 16M.
104 (EFIAPI
*EFI_MEMORY_TEST_COMPATIBLE_RANGE
)(
105 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
106 IN EFI_PHYSICAL_ADDRESS StartAddress
,
110 struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL
{
111 EFI_MEMORY_TEST_INIT MemoryTestInit
;
112 EFI_PERFORM_MEMORY_TEST PerformMemoryTest
;
113 EFI_MEMORY_TEST_FINISHED Finished
;
114 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest
;
117 extern EFI_GUID gEfiGenericMemTestProtocolGuid
;