]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Include/Protocol/GenericMemoryTest.h
Fixed some issues for IA32 architecture platform build.
[mirror_edk2.git] / EdkModulePkg / Include / Protocol / GenericMemoryTest.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 GenericMemoryTest.h
15
16 Abstract:
17
18 The EFI generic memory test protocol
19 For more information please look at EfiMemoryTest.doc
20
21 --*/
22
23 #ifndef __GENERIC_MEMORY_TEST_H__
24 #define __GENERIC_MEMORY_TEST_H__
25
26 #define EFI_GENERIC_MEMORY_TEST_PROTOCOL_GUID \
27 { 0x309de7f1, 0x7f5e, 0x4ace, {0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef} }
28
29 typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;
30
31 typedef enum {
32 IGNORE,
33 QUICK,
34 SPARSE,
35 EXTENSIVE,
36 MAXLEVEL
37 } EXTENDMEM_COVERAGE_LEVEL;
38
39 typedef
40 EFI_STATUS
41 (EFIAPI *EFI_MEMORY_TEST_INIT) (
42 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
43 IN EXTENDMEM_COVERAGE_LEVEL Level,
44 OUT BOOLEAN *RequireSoftECCInit
45 )
46 /*++
47
48 Routine Description:
49 Initialize the generic memory test.
50
51 Arguments:
52 This - Protocol instance pointer.
53 Level - The coverage level of the memory test.
54 RequireSoftECCInit - Indicate if the memory need software ECC init.
55
56 Returns:
57 EFI_SUCCESS - The generic memory test initialized correctly.
58 EFI_NO_MEDIA - There is not any non-tested memory found, in this
59 function if not any non-tesed memory found means
60 that the memory test driver have not detect any
61 non-tested extended memory of current system.
62
63 --*/
64 ;
65
66 typedef
67 EFI_STATUS
68 (EFIAPI *EFI_PERFORM_MEMORY_TEST) (
69 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
70 OUT UINT64 *TestedMemorySize,
71 OUT UINT64 *TotalMemorySize,
72 OUT BOOLEAN *ErrorOut,
73 IN BOOLEAN IfTestAbort
74 )
75 /*++
76
77 Routine Description:
78 Perform the memory test.
79
80 Arguments:
81 This - Protocol instance pointer.
82 TestedMemorySize - Return the tested extended memory size.
83 TotalMemorySize - Return the whole system physical memory size, this
84 value may be changed if in some case some error
85 DIMMs be disabled.
86 ErrorOut - Any time the memory error occurs, this will be TRUE.
87 IfTestAbort - Indicate if the user press "ESC" to skip the memory
88 test.
89
90 Returns:
91 EFI_SUCCESS - One block of memory test ok, the block size is hide
92 internally.
93 EFI_NOT_FOUND - Indicate all the non-tested memory blocks have
94 already go through.
95
96 --*/
97 ;
98
99 typedef
100 EFI_STATUS
101 (EFIAPI *EFI_MEMORY_TEST_FINISHED) (
102 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This
103 )
104 /*++
105
106 Routine Description:
107 The memory test finished.
108
109 Arguments:
110 This - Protocol instance pointer.
111
112 Returns:
113 EFI_SUCCESS - Successful free all the generic memory test driver
114 allocated resource and notify to platform memory
115 test driver that memory test finished.
116
117 --*/
118 ;
119
120 typedef
121 EFI_STATUS
122 (EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE) (
123 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
124 IN EFI_PHYSICAL_ADDRESS StartAddress,
125 IN UINT64 Length
126 )
127 /*++
128
129 Routine Description:
130 Provide capability to test compatible range which used by some sepcial
131 driver required using memory range before BDS perform memory test.
132
133 Arguments:
134 This - Protocol instance pointer.
135 StartAddress - The start address of the memory range.
136 Length - The memory range's length.
137
138 Return:
139 EFI_SUCCESS - The compatible memory range pass the memory test.
140 EFI_DEVICE_ERROR - The compatible memory range test find memory error
141 and also return return the error address.
142
143 --*/
144 ;
145
146 struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {
147 EFI_MEMORY_TEST_INIT MemoryTestInit;
148 EFI_PERFORM_MEMORY_TEST PerformMemoryTest;
149 EFI_MEMORY_TEST_FINISHED Finished;
150 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest;
151 };
152
153 extern EFI_GUID gEfiGenericMemTestProtocolGuid;
154
155 #endif
156