]>
Commit | Line | Data |
---|---|---|
674dced3 | 1 | /** @file\r |
b3764698 | 2 | Include file of the NULL memory test driver.\r |
05177bef | 3 | \r |
d1102dba | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
e5eed7d3 | 5 | This program and the accompanying materials\r |
674dced3 | 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 | |
9 | \r | |
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 | |
12 | \r | |
13 | **/\r | |
05177bef | 14 | \r |
b3764698 | 15 | #ifndef _NULL_MEMORY_TEST_H_\r |
16 | #define _NULL_MEMORY_TEST_H_\r | |
05177bef | 17 | \r |
ed7748fe | 18 | \r |
39099938 | 19 | #include <PiDxe.h>\r |
05177bef | 20 | \r |
ed7748fe | 21 | \r |
05177bef | 22 | #include <Protocol/GenericMemoryTest.h>\r |
ed7748fe | 23 | \r |
05177bef | 24 | #include <Library/DebugLib.h>\r |
25 | #include <Library/UefiDriverEntryPoint.h>\r | |
26 | #include <Library/DxeServicesTableLib.h>\r | |
27 | #include <Library/UefiBootServicesTableLib.h>\r | |
28 | #include <Library/MemoryAllocationLib.h>\r | |
29 | \r | |
30 | //\r | |
b3764698 | 31 | // Definition of memory status.\r |
05177bef | 32 | //\r |
33 | #define EFI_MEMORY_PRESENT 0x0100000000000000ULL\r | |
34 | #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL\r | |
35 | #define EFI_MEMORY_TESTED 0x0400000000000000ULL\r | |
36 | \r | |
b3764698 | 37 | /**\r |
38 | Initialize the generic memory test.\r | |
05177bef | 39 | \r |
b3764698 | 40 | This function implements EFI_GENERIC_MEMORY_TEST_PROTOCOL.MemoryTestInit.\r |
41 | It simply promotes untested reserved memory to system memory without real test.\r | |
05177bef | 42 | \r |
d1102dba LG |
43 | @param This Protocol instance pointer.\r |
44 | @param Level The coverage level of the memory test.\r | |
45 | @param RequireSoftECCInit Indicate if the memory need software ECC init.\r | |
05177bef | 46 | \r |
d1102dba LG |
47 | @retval EFI_SUCCESS The generic memory test initialized correctly.\r |
48 | @retval EFI_NO_MEDIA There is not any non-tested memory found, in this\r | |
49 | function if not any non-tesed memory found means\r | |
50 | that the memory test driver have not detect any\r | |
51 | non-tested extended memory of current system.\r | |
05177bef | 52 | \r |
b3764698 | 53 | **/\r |
05177bef | 54 | EFI_STATUS\r |
55 | EFIAPI\r | |
56 | InitializeMemoryTest (\r | |
57 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r | |
58 | IN EXTENDMEM_COVERAGE_LEVEL Level,\r | |
59 | OUT BOOLEAN *RequireSoftECCInit\r | |
ed66e1bc | 60 | );\r |
05177bef | 61 | \r |
b3764698 | 62 | /**\r |
63 | Perform the memory test.\r | |
64 | \r | |
65 | This function implements EFI_GENERIC_MEMORY_TEST_PROTOCOL.PerformMemoryTest.\r | |
66 | It simply returns EFI_NOT_FOUND.\r | |
67 | \r | |
d1102dba LG |
68 | @param This Protocol instance pointer.\r |
69 | @param TestedMemorySize Return the tested extended memory size.\r | |
70 | @param TotalMemorySize Return the whole system physical memory size, this\r | |
71 | value may be changed if in some case some error\r | |
72 | DIMMs be disabled.\r | |
73 | @param ErrorOut Any time the memory error occurs, this will be\r | |
74 | TRUE.\r | |
75 | @param IfTestAbort Indicate if the user press "ESC" to skip the memory\r | |
76 | test.\r | |
77 | \r | |
78 | @retval EFI_SUCCESS One block of memory test ok, the block size is hide\r | |
79 | internally.\r | |
80 | @retval EFI_NOT_FOUND Indicate all the non-tested memory blocks have\r | |
81 | already go through.\r | |
b3764698 | 82 | @retval EFI_DEVICE_ERROR Mis-compare error, and no agent can handle it\r |
83 | \r | |
84 | **/\r | |
05177bef | 85 | EFI_STATUS\r |
86 | EFIAPI\r | |
87 | GenPerformMemoryTest (\r | |
88 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r | |
89 | IN OUT UINT64 *TestedMemorySize,\r | |
90 | OUT UINT64 *TotalMemorySize,\r | |
91 | OUT BOOLEAN *ErrorOut,\r | |
92 | IN BOOLEAN TestAbort\r | |
ed66e1bc | 93 | );\r |
05177bef | 94 | \r |
b3764698 | 95 | /**\r |
96 | The memory test finished.\r | |
97 | \r | |
98 | This function implements EFI_GENERIC_MEMORY_TEST_PROTOCOL.Finished.\r | |
99 | It simply returns EFI_SUCCESS.\r | |
100 | \r | |
d1102dba | 101 | @param This Protocol instance pointer.\r |
b3764698 | 102 | \r |
d1102dba LG |
103 | @retval EFI_SUCCESS Successful free all the generic memory test driver\r |
104 | allocated resource and notify to platform memory\r | |
105 | test driver that memory test finished.\r | |
b3764698 | 106 | \r |
107 | **/\r | |
05177bef | 108 | EFI_STATUS\r |
109 | EFIAPI\r | |
110 | GenMemoryTestFinished (\r | |
111 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This\r | |
ed66e1bc | 112 | );\r |
05177bef | 113 | \r |
b3764698 | 114 | /**\r |
115 | Provide capability to test compatible range which used by some special\r | |
116 | driver required using memory range before BDS perform memory test.\r | |
117 | \r | |
118 | This function implements EFI_GENERIC_MEMORY_TEST_PROTOCOL.CompatibleRangeTest.\r | |
119 | It simply set the memory range to system memory.\r | |
120 | \r | |
d1102dba LG |
121 | @param This Protocol instance pointer.\r |
122 | @param StartAddress The start address of the memory range.\r | |
123 | @param Length The memory range's length.\r | |
124 | \r | |
125 | @retval EFI_SUCCESS The compatible memory range pass the memory test.\r | |
b3764698 | 126 | @retval EFI_INVALID_PARAMETER The compatible memory range must be below 16M.\r |
127 | \r | |
128 | **/\r | |
05177bef | 129 | EFI_STATUS\r |
130 | EFIAPI\r | |
131 | GenCompatibleRangeTest (\r | |
132 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r | |
133 | IN EFI_PHYSICAL_ADDRESS StartAddress,\r | |
134 | IN UINT64 Length\r | |
ed66e1bc | 135 | );\r |
05177bef | 136 | \r |
137 | #endif\r |