]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
Retire TCG platform protocol, which will be replaced by PI Security Architecture...
[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
1e354c03 4Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
88f20127 9\r
1e354c03 10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT 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
21typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;\r
22\r
346cf9ac
LG
23///\r
24/// Memory test coverage level\r
25/// Ignore op not test memory, Quick and Sparse op test memory quickly, Extensive op test memory detailedly.\r
26///\r
88f20127 27typedef 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
39 @param This 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
42\r
346cf9ac
LG
43 @retval EFI_SUCCESS The generic memory test is initialized correctly. \r
44 @retval EFI_NO_MEDIA There is not any non-tested memory found, which means \r
1e354c03 45 that the memory test driver have not detect any \r
346cf9ac 46 non-tested extended memory in current system. \r
1e354c03 47\r
48**/\r
88f20127 49typedef\r
50EFI_STATUS\r
7d839888 51(EFIAPI *EFI_MEMORY_TEST_INIT)(\r
5f597758 52 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 53 IN EXTENDMEM_COVERAGE_LEVEL Level,\r
54 OUT BOOLEAN *RequireSoftECCInit\r
ed66e1bc 55 );\r
88f20127 56\r
88f20127 57\r
1e354c03 58/**\r
59 Perform the memory test.\r
88f20127 60\r
1e354c03 61 @param This Protocol instance pointer. \r
62 @param TestedMemorySize Return the tested extended memory size. \r
63 @param TotalMemorySize Return the whole system physical memory size, this \r
346cf9ac
LG
64 value may be changed if some error DIMMs is disabled in some case. \r
65 @param ErrorOut TRUE if the memory error occurs.\r
66 @param IfTestAbort Indicate if the user press "ESC" to skip the memory test. \r
67\r
68 @retval EFI_SUCCESS One block of memory pass test.\r
69 @retval EFI_NOT_FOUND Indicate all the non-tested memory blocks have been\r
70 already gone through.\r
71 @retval EFI_DEVICE_ERROR Memory device error occurs and no agent can handle it.\r
88f20127 72\r
1e354c03 73**/\r
88f20127 74typedef\r
75EFI_STATUS\r
7d839888 76(EFIAPI *EFI_PERFORM_MEMORY_TEST)(\r
346cf9ac 77 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 78 OUT UINT64 *TestedMemorySize,\r
79 OUT UINT64 *TotalMemorySize,\r
80 OUT BOOLEAN *ErrorOut,\r
81 IN BOOLEAN IfTestAbort\r
ed66e1bc 82 );\r
88f20127 83\r
1e354c03 84\r
85/**\r
346cf9ac 86 Finish the memory test.\r
1e354c03 87\r
88 @param This Protocol instance pointer. \r
89\r
b9982883
LG
90 @retval EFI_SUCCESS Success. Then free all the generic memory test driver\r
91 allocated resource and notify to platform memory\r
92 test driver that memory test finished.\r
1e354c03 93\r
94**/\r
88f20127 95typedef\r
96EFI_STATUS\r
7d839888 97(EFIAPI *EFI_MEMORY_TEST_FINISHED)(\r
88f20127 98 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This\r
ed66e1bc 99 );\r
88f20127 100\r
1e354c03 101/**\r
346cf9ac
LG
102 Provide capability to test compatible range used by some sepcial\r
103 driver before BDS perform memory test.\r
88f20127 104\r
1e354c03 105 @param This Protocol instance pointer. \r
346cf9ac
LG
106 @param StartAddress The start address of the compatible memory range that\r
107 must be below 16M.\r
108 @param Length The compatible memory range's length. \r
88f20127 109 \r
5f597758 110 @retval EFI_SUCCESS The compatible memory range pass the memory test. \r
b9982883 111 @retval EFI_INVALID_PARAMETER The compatible memory range are not below Low 16M.\r
1e354c03 112\r
113**/\r
88f20127 114typedef\r
115EFI_STATUS\r
7d839888 116(EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE)(\r
5f597758 117 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 118 IN EFI_PHYSICAL_ADDRESS StartAddress,\r
119 IN UINT64 Length\r
ed66e1bc 120 );\r
88f20127 121\r
122struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {\r
123 EFI_MEMORY_TEST_INIT MemoryTestInit;\r
124 EFI_PERFORM_MEMORY_TEST PerformMemoryTest;\r
125 EFI_MEMORY_TEST_FINISHED Finished;\r
126 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest;\r
127};\r
128\r
129extern EFI_GUID gEfiGenericMemTestProtocolGuid;\r
130\r
131#endif\r
132\r