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