]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / GenericMemoryTest.h
CommitLineData
1e354c03 1/** @file\r
346cf9ac 2 This protocol defines the generic memory test interfaces in Dxe phase.\r
88f20127 3\r
d1102dba 4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
88f20127 6\r
1e354c03 7**/\r
88f20127 8\r
9#ifndef __GENERIC_MEMORY_TEST_H__\r
10#define __GENERIC_MEMORY_TEST_H__\r
11\r
12#define EFI_GENERIC_MEMORY_TEST_PROTOCOL_GUID \\r
13 { 0x309de7f1, 0x7f5e, 0x4ace, {0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef} }\r
14\r
15typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;\r
16\r
346cf9ac 17///\r
64a80549 18/// Memory test coverage level.\r
19/// Ignore chooses not to test memory. Quick and Sparse test some memory, and Extensive performs a detailed memory test.\r
346cf9ac 20///\r
88f20127 21typedef enum {\r
22 IGNORE,\r
23 QUICK,\r
24 SPARSE,\r
25 EXTENSIVE,\r
26 MAXLEVEL\r
27} EXTENDMEM_COVERAGE_LEVEL;\r
28\r
1e354c03 29\r
30/**\r
31 Initialize the generic memory test.\r
32\r
d1102dba
LG
33 @param This The protocol instance pointer.\r
34 @param Level The coverage level of the memory test.\r
35 @param RequireSoftECCInit Indicate if the memory need software ECC init.\r
1e354c03 36\r
d1102dba
LG
37 @retval EFI_SUCCESS The generic memory test is initialized correctly.\r
38 @retval EFI_NO_MEDIA The system had no memory to be tested.\r
1e354c03 39\r
40**/\r
88f20127 41typedef\r
42EFI_STATUS\r
7d839888 43(EFIAPI *EFI_MEMORY_TEST_INIT)(\r
5f597758 44 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 45 IN EXTENDMEM_COVERAGE_LEVEL Level,\r
46 OUT BOOLEAN *RequireSoftECCInit\r
ed66e1bc 47 );\r
88f20127 48\r
88f20127 49\r
1e354c03 50/**\r
51 Perform the memory test.\r
88f20127 52\r
d1102dba
LG
53 @param This The protocol instance pointer.\r
54 @param TestedMemorySize Return the tested extended memory size.\r
55 @param TotalMemorySize Return the whole system physical memory size.\r
56 The total memory size does not include memory in a slot with a disabled DIMM.\r
e9b67286 57 @param ErrorOut TRUE if the memory error occured.\r
d1102dba 58 @param IfTestAbort Indicates that the user pressed "ESC" to skip the memory test.\r
346cf9ac 59\r
e9b67286 60 @retval EFI_SUCCESS One block of memory passed the test.\r
61 @retval EFI_NOT_FOUND All memory blocks have already been tested.\r
62 @retval EFI_DEVICE_ERROR Memory device error occured, and no agent can handle it.\r
88f20127 63\r
1e354c03 64**/\r
88f20127 65typedef\r
66EFI_STATUS\r
7d839888 67(EFIAPI *EFI_PERFORM_MEMORY_TEST)(\r
346cf9ac 68 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 69 OUT UINT64 *TestedMemorySize,\r
70 OUT UINT64 *TotalMemorySize,\r
71 OUT BOOLEAN *ErrorOut,\r
72 IN BOOLEAN IfTestAbort\r
ed66e1bc 73 );\r
88f20127 74\r
1e354c03 75\r
76/**\r
346cf9ac 77 Finish the memory test.\r
1e354c03 78\r
d1102dba 79 @param This The protocol instance pointer.\r
1e354c03 80\r
e9b67286 81 @retval EFI_SUCCESS Success. All resources used in the memory test are freed.\r
1e354c03 82\r
83**/\r
88f20127 84typedef\r
85EFI_STATUS\r
7d839888 86(EFIAPI *EFI_MEMORY_TEST_FINISHED)(\r
88f20127 87 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This\r
ed66e1bc 88 );\r
88f20127 89\r
1e354c03 90/**\r
e40b7d5d 91 Provides the capability to test the compatible range used by some special drivers.\r
88f20127 92\r
d1102dba 93 @param This The protocol instance pointer.\r
346cf9ac
LG
94 @param StartAddress The start address of the compatible memory range that\r
95 must be below 16M.\r
d1102dba
LG
96 @param Length The compatible memory range's length.\r
97\r
98 @retval EFI_SUCCESS The compatible memory range pass the memory test.\r
b9982883 99 @retval EFI_INVALID_PARAMETER The compatible memory range are not below Low 16M.\r
1e354c03 100\r
101**/\r
88f20127 102typedef\r
103EFI_STATUS\r
7d839888 104(EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE)(\r
5f597758 105 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 106 IN EFI_PHYSICAL_ADDRESS StartAddress,\r
107 IN UINT64 Length\r
ed66e1bc 108 );\r
88f20127 109\r
110struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {\r
111 EFI_MEMORY_TEST_INIT MemoryTestInit;\r
112 EFI_PERFORM_MEMORY_TEST PerformMemoryTest;\r
113 EFI_MEMORY_TEST_FINISHED Finished;\r
114 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest;\r
115};\r
116\r
117extern EFI_GUID gEfiGenericMemTestProtocolGuid;\r
118\r
119#endif\r
120\r