]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
Remove the tailing ',' to ensure the code pass EBC's -Za option (Enforces strict...
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / GenericMemoryTest.h
1 /** @file
2 The EFI generic memory test protocol interface.
3 For more information please look at EfiMemoryTest.doc
4
5 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __GENERIC_MEMORY_TEST_H__
17 #define __GENERIC_MEMORY_TEST_H__
18
19 #define EFI_GENERIC_MEMORY_TEST_PROTOCOL_GUID \
20 { 0x309de7f1, 0x7f5e, 0x4ace, {0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef} }
21
22 typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;
23
24 typedef enum {
25 IGNORE,
26 QUICK,
27 SPARSE,
28 EXTENSIVE,
29 MAXLEVEL
30 } EXTENDMEM_COVERAGE_LEVEL;
31
32
33 /**
34 Initialize the generic memory test.
35
36 @param This Protocol instance pointer.
37 @param Level The coverage level of the memory test.
38 @param RequireSoftECCInit Indicate if the memory need software ECC init.
39
40 @retval EFI_SUCCESS The generic memory test initialized correctly.
41 @retval EFI_NO_MEDIA There is not any non-tested memory found, in this
42 function if not any non-tesed memory found means
43 that the memory test driver have not detect any
44 non-tested extended memory of current system.
45
46 **/
47 typedef
48 EFI_STATUS
49 (EFIAPI *EFI_MEMORY_TEST_INIT) (
50 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
51 IN EXTENDMEM_COVERAGE_LEVEL Level,
52 OUT BOOLEAN *RequireSoftECCInit
53 )
54 ;
55
56
57 /**
58 Perform the memory test.
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
75 **/
76 typedef
77 EFI_STATUS
78 (EFIAPI *EFI_PERFORM_MEMORY_TEST) (
79 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
80 OUT UINT64 *TestedMemorySize,
81 OUT UINT64 *TotalMemorySize,
82 OUT BOOLEAN *ErrorOut,
83 IN BOOLEAN IfTestAbort
84 )
85 ;
86
87
88 /**
89 The memory test finished.
90
91 @param This Protocol instance pointer.
92
93 @retval EFI_SUCCESS Successful free all the generic memory test driver
94 allocated resource and notify to platform memory
95 test driver that memory test finished.
96
97 **/
98 typedef
99 EFI_STATUS
100 (EFIAPI *EFI_MEMORY_TEST_FINISHED) (
101 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This
102 )
103 ;
104
105 /**
106 Provide capability to test compatible range which used by some sepcial
107 driver required using memory range before BDS perform memory test.
108
109 @param This Protocol instance pointer.
110 @param StartAddress The start address of the memory range.
111 @param Length The memory range's length.
112
113 @retval EFI_SUCCESS The compatible memory range pass the memory test.
114 @retval EFI_DEVICE_ERROR The compatible memory range test find memory error
115 and also return return the error address.
116
117 **/
118 typedef
119 EFI_STATUS
120 (EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE) (
121 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
122 IN EFI_PHYSICAL_ADDRESS StartAddress,
123 IN UINT64 Length
124 )
125 ;
126
127 struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {
128 EFI_MEMORY_TEST_INIT MemoryTestInit;
129 EFI_PERFORM_MEMORY_TEST PerformMemoryTest;
130 EFI_MEMORY_TEST_FINISHED Finished;
131 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest;
132 };
133
134 extern EFI_GUID gEfiGenericMemTestProtocolGuid;
135
136 #endif
137