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