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