Commit | Line | Data |
---|---|---|
1e354c03 | 1 | /** @file\r |
5f597758 | 2 | This protocol defines the EFI generic memory test interfaces in Dxe phase.\r |
88f20127 | 3 | \r |
1e354c03 | 4 | Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
88f20127 | 9 | \r |
1e354c03 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
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 | |
23 | typedef enum {\r | |
24 | IGNORE,\r | |
25 | QUICK,\r | |
26 | SPARSE,\r | |
27 | EXTENSIVE,\r | |
28 | MAXLEVEL\r | |
29 | } EXTENDMEM_COVERAGE_LEVEL;\r | |
30 | \r | |
1e354c03 | 31 | \r |
32 | /**\r | |
33 | Initialize the generic memory test.\r | |
34 | \r | |
35 | @param This Protocol instance pointer. \r | |
36 | @param Level The coverage level of the memory test. \r | |
37 | @param RequireSoftECCInit Indicate if the memory need software ECC init. \r | |
38 | \r | |
39 | @retval EFI_SUCCESS The generic memory test initialized correctly. \r | |
40 | @retval EFI_NO_MEDIA There is not any non-tested memory found, in this \r | |
41 | function if not any non-tesed memory found means \r | |
42 | that the memory test driver have not detect any \r | |
43 | non-tested extended memory of current system. \r | |
44 | \r | |
45 | **/\r | |
88f20127 | 46 | typedef\r |
47 | EFI_STATUS\r | |
7d839888 | 48 | (EFIAPI *EFI_MEMORY_TEST_INIT)(\r |
5f597758 | 49 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r |
88f20127 | 50 | IN EXTENDMEM_COVERAGE_LEVEL Level,\r |
51 | OUT BOOLEAN *RequireSoftECCInit\r | |
ed66e1bc | 52 | );\r |
88f20127 | 53 | \r |
88f20127 | 54 | \r |
1e354c03 | 55 | /**\r |
56 | Perform the memory test.\r | |
88f20127 | 57 | \r |
1e354c03 | 58 | @param This Protocol instance pointer. \r |
59 | @param TestedMemorySize Return the tested extended memory size. \r | |
60 | @param TotalMemorySize Return the whole system physical memory size, this \r | |
61 | value may be changed if in some case some error \r | |
62 | DIMMs be disabled. \r | |
63 | @param ErrorOut Any time the memory error occurs, this will be \r | |
64 | TRUE. \r | |
65 | @param IfTestAbort Indicate if the user press "ESC" to skip the memory \r | |
66 | test. \r | |
88f20127 | 67 | \r |
1e354c03 | 68 | @retval EFI_SUCCESS One block of memory test ok, the block size is hide \r |
69 | internally. \r | |
70 | @retval EFI_NOT_FOUND Indicate all the non-tested memory blocks have \r | |
71 | already go through. \r | |
5f597758 | 72 | @retval EFI_DEVICE_ERROR Mis-compare error, and no agent can handle it\r |
88f20127 | 73 | \r |
1e354c03 | 74 | **/\r |
88f20127 | 75 | typedef\r |
76 | EFI_STATUS\r | |
7d839888 | 77 | (EFIAPI *EFI_PERFORM_MEMORY_TEST)(\r |
88f20127 | 78 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r |
79 | OUT UINT64 *TestedMemorySize,\r | |
80 | OUT UINT64 *TotalMemorySize,\r | |
81 | OUT BOOLEAN *ErrorOut,\r | |
82 | IN BOOLEAN IfTestAbort\r | |
ed66e1bc | 83 | );\r |
88f20127 | 84 | \r |
1e354c03 | 85 | \r |
86 | /**\r | |
87 | The memory test finished.\r | |
88 | \r | |
89 | @param This Protocol instance pointer. \r | |
90 | \r | |
91 | @retval EFI_SUCCESS Successful free all the generic memory test driver \r | |
92 | allocated resource and notify to platform memory \r | |
93 | test driver that memory test finished. \r | |
94 | \r | |
95 | **/\r | |
88f20127 | 96 | typedef\r |
97 | EFI_STATUS\r | |
7d839888 | 98 | (EFIAPI *EFI_MEMORY_TEST_FINISHED)(\r |
88f20127 | 99 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This\r |
ed66e1bc | 100 | );\r |
88f20127 | 101 | \r |
1e354c03 | 102 | /**\r |
103 | Provide capability to test compatible range which used by some sepcial\r | |
104 | driver required using memory range before BDS perform memory test.\r | |
88f20127 | 105 | \r |
1e354c03 | 106 | @param This Protocol instance pointer. \r |
107 | @param StartAddress The start address of the memory range. \r | |
108 | @param Length The memory range's length. \r | |
88f20127 | 109 | \r |
5f597758 LG |
110 | @retval EFI_SUCCESS The compatible memory range pass the memory test. \r |
111 | @retval EFI_INVALID_PARAMETER The compatible memory range must be below 16M.\r | |
1e354c03 | 112 | \r |
113 | **/\r | |
88f20127 | 114 | typedef\r |
115 | EFI_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 |
122 | struct _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 | |
129 | extern EFI_GUID gEfiGenericMemTestProtocolGuid;\r | |
130 | \r | |
131 | #endif\r | |
132 | \r |