]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
Committing changes to the comments, to improve code documentation.
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / GenericMemoryTest.h
CommitLineData
1e354c03 1/** @file\r
346cf9ac 2 This protocol defines the generic memory test interfaces in Dxe phase.\r
88f20127 3\r
1e354c03 4Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
88f20127 9\r
1e354c03 10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
88f20127 12\r
1e354c03 13**/\r
88f20127 14\r
15#ifndef __GENERIC_MEMORY_TEST_H__\r
16#define __GENERIC_MEMORY_TEST_H__\r
17\r
18#define EFI_GENERIC_MEMORY_TEST_PROTOCOL_GUID \\r
19 { 0x309de7f1, 0x7f5e, 0x4ace, {0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef} }\r
20\r
21typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;\r
22\r
346cf9ac
LG
23///\r
24/// Memory test coverage level\r
e9b67286 25/// Ignore chooses not to test memory, Quick and Sparse test some memory, and Extensive performs a detailed memory test.\r
346cf9ac 26///\r
88f20127 27typedef enum {\r
28 IGNORE,\r
29 QUICK,\r
30 SPARSE,\r
31 EXTENSIVE,\r
32 MAXLEVEL\r
33} EXTENDMEM_COVERAGE_LEVEL;\r
34\r
1e354c03 35\r
36/**\r
37 Initialize the generic memory test.\r
38\r
39 @param This Protocol instance pointer. \r
40 @param Level The coverage level of the memory test. \r
41 @param RequireSoftECCInit Indicate if the memory need software ECC init. \r
42\r
346cf9ac 43 @retval EFI_SUCCESS The generic memory test is initialized correctly. \r
e9b67286 44 @retval EFI_NO_MEDIA The system had no memory to be tested. \r
1e354c03 45\r
46**/\r
88f20127 47typedef\r
48EFI_STATUS\r
7d839888 49(EFIAPI *EFI_MEMORY_TEST_INIT)(\r
5f597758 50 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 51 IN EXTENDMEM_COVERAGE_LEVEL Level,\r
52 OUT BOOLEAN *RequireSoftECCInit\r
ed66e1bc 53 );\r
88f20127 54\r
88f20127 55\r
1e354c03 56/**\r
57 Perform the memory test.\r
88f20127 58\r
1e354c03 59 @param This Protocol instance pointer. \r
60 @param TestedMemorySize Return the tested extended memory size. \r
e9b67286 61 @param TotalMemorySize Return the whole system physical memory size. \r
62 The total memory size does not include memory in a slot with a disabled DIMM. \r
63 @param ErrorOut TRUE if the memory error occured.\r
64 @param IfTestAbort Indicates that the user pressed "ESC" to skip the memory test. \r
346cf9ac 65\r
e9b67286 66 @retval EFI_SUCCESS One block of memory passed the test.\r
67 @retval EFI_NOT_FOUND All memory blocks have already been tested.\r
68 @retval EFI_DEVICE_ERROR Memory device error occured, and no agent can handle it.\r
88f20127 69\r
1e354c03 70**/\r
88f20127 71typedef\r
72EFI_STATUS\r
7d839888 73(EFIAPI *EFI_PERFORM_MEMORY_TEST)(\r
346cf9ac 74 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 75 OUT UINT64 *TestedMemorySize,\r
76 OUT UINT64 *TotalMemorySize,\r
77 OUT BOOLEAN *ErrorOut,\r
78 IN BOOLEAN IfTestAbort\r
ed66e1bc 79 );\r
88f20127 80\r
1e354c03 81\r
82/**\r
346cf9ac 83 Finish the memory test.\r
1e354c03 84\r
85 @param This Protocol instance pointer. \r
86\r
e9b67286 87 @retval EFI_SUCCESS Success. All resources used in the memory test are freed.\r
1e354c03 88\r
89**/\r
88f20127 90typedef\r
91EFI_STATUS\r
7d839888 92(EFIAPI *EFI_MEMORY_TEST_FINISHED)(\r
88f20127 93 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This\r
ed66e1bc 94 );\r
88f20127 95\r
1e354c03 96/**\r
e9b67286 97 Provides the capability to test the compatible range used by a special\r
98 driver.\r
88f20127 99\r
1e354c03 100 @param This Protocol instance pointer. \r
346cf9ac
LG
101 @param StartAddress The start address of the compatible memory range that\r
102 must be below 16M.\r
103 @param Length The compatible memory range's length. \r
88f20127 104 \r
5f597758 105 @retval EFI_SUCCESS The compatible memory range pass the memory test. \r
b9982883 106 @retval EFI_INVALID_PARAMETER The compatible memory range are not below Low 16M.\r
1e354c03 107\r
108**/\r
88f20127 109typedef\r
110EFI_STATUS\r
7d839888 111(EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE)(\r
5f597758 112 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 113 IN EFI_PHYSICAL_ADDRESS StartAddress,\r
114 IN UINT64 Length\r
ed66e1bc 115 );\r
88f20127 116\r
117struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {\r
118 EFI_MEMORY_TEST_INIT MemoryTestInit;\r
119 EFI_PERFORM_MEMORY_TEST PerformMemoryTest;\r
120 EFI_MEMORY_TEST_FINISHED Finished;\r
121 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest;\r
122};\r
123\r
124extern EFI_GUID gEfiGenericMemTestProtocolGuid;\r
125\r
126#endif\r
127\r