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
;
30 Initialize the generic memory test.
32 @param This The protocol instance pointer.
33 @param Level The coverage level of the memory test.
34 @param RequireSoftECCInit Indicate if the memory need software ECC init.
36 @retval EFI_SUCCESS The generic memory test is initialized correctly.
37 @retval EFI_NO_MEDIA The system had no memory to be tested.
42 (EFIAPI
*EFI_MEMORY_TEST_INIT
)(
43 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
44 IN EXTENDMEM_COVERAGE_LEVEL Level
,
45 OUT BOOLEAN
*RequireSoftECCInit
49 Perform the memory test.
51 @param This The protocol instance pointer.
52 @param TestedMemorySize Return the tested extended memory size.
53 @param TotalMemorySize Return the whole system physical memory size.
54 The total memory size does not include memory in a slot with a disabled DIMM.
55 @param ErrorOut TRUE if the memory error occurred.
56 @param IfTestAbort Indicates that the user pressed "ESC" to skip the memory test.
58 @retval EFI_SUCCESS One block of memory passed the test.
59 @retval EFI_NOT_FOUND All memory blocks have already been tested.
60 @retval EFI_DEVICE_ERROR Memory device error occurred, and no agent can handle it.
65 (EFIAPI
*EFI_PERFORM_MEMORY_TEST
)(
66 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
67 OUT UINT64
*TestedMemorySize
,
68 OUT UINT64
*TotalMemorySize
,
69 OUT BOOLEAN
*ErrorOut
,
70 IN BOOLEAN IfTestAbort
74 Finish the memory test.
76 @param This The protocol instance pointer.
78 @retval EFI_SUCCESS Success. All resources used in the memory test are freed.
83 (EFIAPI
*EFI_MEMORY_TEST_FINISHED
)(
84 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
88 Provides the capability to test the compatible range used by some special drivers.
90 @param This The protocol instance pointer.
91 @param StartAddress The start address of the compatible memory range that
93 @param Length The compatible memory range's length.
95 @retval EFI_SUCCESS The compatible memory range pass the memory test.
96 @retval EFI_INVALID_PARAMETER The compatible memory range are not below Low 16M.
101 (EFIAPI
*EFI_MEMORY_TEST_COMPATIBLE_RANGE
)(
102 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
103 IN EFI_PHYSICAL_ADDRESS StartAddress
,
107 struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL
{
108 EFI_MEMORY_TEST_INIT MemoryTestInit
;
109 EFI_PERFORM_MEMORY_TEST PerformMemoryTest
;
110 EFI_MEMORY_TEST_FINISHED Finished
;
111 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest
;
114 extern EFI_GUID gEfiGenericMemTestProtocolGuid
;