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