]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
3b0614ad82b88c647f30fb1f39e4f1bed76451af
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / GenericMemoryTest.h
1 /** @file
2 This protocol defines the 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 ///
24 /// Memory test coverage level
25 /// Ignore op not test memory, Quick and Sparse op test memory quickly, Extensive op test memory detailedly.
26 ///
27 typedef enum {
28 IGNORE,
29 QUICK,
30 SPARSE,
31 EXTENSIVE,
32 MAXLEVEL
33 } EXTENDMEM_COVERAGE_LEVEL;
34
35
36 /**
37 Initialize the generic memory test.
38
39 @param This Protocol instance pointer.
40 @param Level The coverage level of the memory test.
41 @param RequireSoftECCInit Indicate if the memory need software ECC init.
42
43 @retval EFI_SUCCESS The generic memory test is initialized correctly.
44 @retval EFI_NO_MEDIA There is not any non-tested memory found, which means
45 that the memory test driver have not detect any
46 non-tested extended memory in current system.
47
48 **/
49 typedef
50 EFI_STATUS
51 (EFIAPI *EFI_MEMORY_TEST_INIT)(
52 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
53 IN EXTENDMEM_COVERAGE_LEVEL Level,
54 OUT BOOLEAN *RequireSoftECCInit
55 );
56
57
58 /**
59 Perform the memory test.
60
61 @param This Protocol instance pointer.
62 @param TestedMemorySize Return the tested extended memory size.
63 @param TotalMemorySize Return the whole system physical memory size, this
64 value may be changed if some error DIMMs is disabled in some case.
65 @param ErrorOut TRUE if the memory error occurs.
66 @param IfTestAbort Indicate if the user press "ESC" to skip the memory test.
67
68 @retval EFI_SUCCESS One block of memory pass test.
69 @retval EFI_NOT_FOUND Indicate all the non-tested memory blocks have been
70 already gone through.
71 @retval EFI_DEVICE_ERROR Memory device error occurs and no agent can handle it.
72
73 **/
74 typedef
75 EFI_STATUS
76 (EFIAPI *EFI_PERFORM_MEMORY_TEST)(
77 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
78 OUT UINT64 *TestedMemorySize,
79 OUT UINT64 *TotalMemorySize,
80 OUT BOOLEAN *ErrorOut,
81 IN BOOLEAN IfTestAbort
82 );
83
84
85 /**
86 Finish the memory test.
87
88 @param This Protocol instance pointer.
89
90 @retval EFI_SUCCESS Successful.
91
92 **/
93 typedef
94 EFI_STATUS
95 (EFIAPI *EFI_MEMORY_TEST_FINISHED)(
96 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This
97 );
98
99 /**
100 Provide capability to test compatible range used by some sepcial
101 driver before BDS perform memory test.
102
103 @param This Protocol instance pointer.
104 @param StartAddress The start address of the compatible memory range that
105 must be below 16M.
106 @param Length The compatible memory range's length.
107
108 @retval EFI_SUCCESS The compatible memory range pass the memory test.
109 @retval EFI_INVALID_PARAMETER The compatible memory range must be below 16M.
110
111 **/
112 typedef
113 EFI_STATUS
114 (EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE)(
115 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
116 IN EFI_PHYSICAL_ADDRESS StartAddress,
117 IN UINT64 Length
118 );
119
120 struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {
121 EFI_MEMORY_TEST_INIT MemoryTestInit;
122 EFI_PERFORM_MEMORY_TEST PerformMemoryTest;
123 EFI_MEMORY_TEST_FINISHED Finished;
124 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest;
125 };
126
127 extern EFI_GUID gEfiGenericMemTestProtocolGuid;
128
129 #endif
130