]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
Code scrube for MdeModule Definitions.
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / GenericMemoryTest.h
1 /** @file
2 This protocol defines the EFI generic memory test interfaces in Dxe phase.
3
4 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __GENERIC_MEMORY_TEST_H__
16 #define __GENERIC_MEMORY_TEST_H__
17
18 #define EFI_GENERIC_MEMORY_TEST_PROTOCOL_GUID \
19 { 0x309de7f1, 0x7f5e, 0x4ace, {0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef} }
20
21 typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;
22
23 typedef enum {
24 IGNORE,
25 QUICK,
26 SPARSE,
27 EXTENSIVE,
28 MAXLEVEL
29 } EXTENDMEM_COVERAGE_LEVEL;
30
31
32 /**
33 Initialize the generic memory 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 typedef
47 EFI_STATUS
48 (EFIAPI *EFI_MEMORY_TEST_INIT) (
49 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
50 IN EXTENDMEM_COVERAGE_LEVEL Level,
51 OUT BOOLEAN *RequireSoftECCInit
52 )
53 ;
54
55
56 /**
57 Perform the memory test.
58
59 @param This Protocol instance pointer.
60 @param TestedMemorySize Return the tested extended memory size.
61 @param TotalMemorySize Return the whole system physical memory size, this
62 value may be changed if in some case some error
63 DIMMs be disabled.
64 @param ErrorOut Any time the memory error occurs, this will be
65 TRUE.
66 @param IfTestAbort Indicate if the user press "ESC" to skip the memory
67 test.
68
69 @retval EFI_SUCCESS One block of memory test ok, the block size is hide
70 internally.
71 @retval EFI_NOT_FOUND Indicate all the non-tested memory blocks have
72 already go through.
73 @retval EFI_DEVICE_ERROR Mis-compare error, and no agent can handle it
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_INVALID_PARAMETER The compatible memory range must be below 16M.
115
116 **/
117 typedef
118 EFI_STATUS
119 (EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE) (
120 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
121 IN EFI_PHYSICAL_ADDRESS StartAddress,
122 IN UINT64 Length
123 )
124 ;
125
126 struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {
127 EFI_MEMORY_TEST_INIT MemoryTestInit;
128 EFI_PERFORM_MEMORY_TEST PerformMemoryTest;
129 EFI_MEMORY_TEST_FINISHED Finished;
130 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest;
131 };
132
133 extern EFI_GUID gEfiGenericMemTestProtocolGuid;
134
135 #endif
136