]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / GenericMemoryTest.h
1 /** @file
2 This protocol defines the generic memory test interfaces in Dxe phase.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __GENERIC_MEMORY_TEST_H__
10 #define __GENERIC_MEMORY_TEST_H__
11
12 #define EFI_GENERIC_MEMORY_TEST_PROTOCOL_GUID \
13 { 0x309de7f1, 0x7f5e, 0x4ace, {0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef} }
14
15 typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;
16
17 ///
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.
20 ///
21 typedef enum {
22 IGNORE,
23 QUICK,
24 SPARSE,
25 EXTENSIVE,
26 MAXLEVEL
27 } EXTENDMEM_COVERAGE_LEVEL;
28
29
30 /**
31 Initialize the generic memory test.
32
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.
36
37 @retval EFI_SUCCESS The generic memory test is initialized correctly.
38 @retval EFI_NO_MEDIA The system had no memory to be tested.
39
40 **/
41 typedef
42 EFI_STATUS
43 (EFIAPI *EFI_MEMORY_TEST_INIT)(
44 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
45 IN EXTENDMEM_COVERAGE_LEVEL Level,
46 OUT BOOLEAN *RequireSoftECCInit
47 );
48
49
50 /**
51 Perform the memory test.
52
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.
59
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.
63
64 **/
65 typedef
66 EFI_STATUS
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
73 );
74
75
76 /**
77 Finish the memory test.
78
79 @param This The protocol instance pointer.
80
81 @retval EFI_SUCCESS Success. All resources used in the memory test are freed.
82
83 **/
84 typedef
85 EFI_STATUS
86 (EFIAPI *EFI_MEMORY_TEST_FINISHED)(
87 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This
88 );
89
90 /**
91 Provides the capability to test the compatible range used by some special drivers.
92
93 @param This The protocol instance pointer.
94 @param StartAddress The start address of the compatible memory range that
95 must be below 16M.
96 @param Length The compatible memory range's length.
97
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.
100
101 **/
102 typedef
103 EFI_STATUS
104 (EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE)(
105 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
106 IN EFI_PHYSICAL_ADDRESS StartAddress,
107 IN UINT64 Length
108 );
109
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;
115 };
116
117 extern EFI_GUID gEfiGenericMemTestProtocolGuid;
118
119 #endif
120