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