]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[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
d1102dba 4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
88f20127 6\r
1e354c03 7**/\r
88f20127 8\r
9#ifndef __GENERIC_MEMORY_TEST_H__\r
10#define __GENERIC_MEMORY_TEST_H__\r
11\r
12#define EFI_GENERIC_MEMORY_TEST_PROTOCOL_GUID \\r
13 { 0x309de7f1, 0x7f5e, 0x4ace, {0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef} }\r
14\r
1436aea4 15typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;\r
88f20127 16\r
346cf9ac 17///\r
64a80549 18/// Memory test coverage level.\r
19/// Ignore chooses not to test memory. Quick and Sparse test some memory, and Extensive performs a detailed memory test.\r
346cf9ac 20///\r
88f20127 21typedef enum {\r
22 IGNORE,\r
23 QUICK,\r
24 SPARSE,\r
25 EXTENSIVE,\r
26 MAXLEVEL\r
27} EXTENDMEM_COVERAGE_LEVEL;\r
28\r
1e354c03 29/**\r
30 Initialize the generic memory test.\r
31\r
d1102dba
LG
32 @param This The protocol instance pointer.\r
33 @param Level The coverage level of the memory test.\r
34 @param RequireSoftECCInit Indicate if the memory need software ECC init.\r
1e354c03 35\r
d1102dba
LG
36 @retval EFI_SUCCESS The generic memory test is initialized correctly.\r
37 @retval EFI_NO_MEDIA The system had no memory to be tested.\r
1e354c03 38\r
39**/\r
88f20127 40typedef\r
41EFI_STATUS\r
7d839888 42(EFIAPI *EFI_MEMORY_TEST_INIT)(\r
5f597758 43 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 44 IN EXTENDMEM_COVERAGE_LEVEL Level,\r
45 OUT BOOLEAN *RequireSoftECCInit\r
ed66e1bc 46 );\r
88f20127 47\r
1e354c03 48/**\r
49 Perform the memory test.\r
88f20127 50\r
d1102dba
LG
51 @param This The protocol instance pointer.\r
52 @param TestedMemorySize Return the tested extended memory size.\r
53 @param TotalMemorySize Return the whole system physical memory size.\r
54 The total memory size does not include memory in a slot with a disabled DIMM.\r
d181539b 55 @param ErrorOut TRUE if the memory error occurred.\r
d1102dba 56 @param IfTestAbort Indicates that the user pressed "ESC" to skip the memory test.\r
346cf9ac 57\r
e9b67286 58 @retval EFI_SUCCESS One block of memory passed the test.\r
59 @retval EFI_NOT_FOUND All memory blocks have already been tested.\r
d181539b 60 @retval EFI_DEVICE_ERROR Memory device error occurred, and no agent can handle it.\r
88f20127 61\r
1e354c03 62**/\r
88f20127 63typedef\r
64EFI_STATUS\r
7d839888 65(EFIAPI *EFI_PERFORM_MEMORY_TEST)(\r
346cf9ac 66 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 67 OUT UINT64 *TestedMemorySize,\r
68 OUT UINT64 *TotalMemorySize,\r
69 OUT BOOLEAN *ErrorOut,\r
70 IN BOOLEAN IfTestAbort\r
ed66e1bc 71 );\r
88f20127 72\r
1e354c03 73/**\r
346cf9ac 74 Finish the memory test.\r
1e354c03 75\r
d1102dba 76 @param This The protocol instance pointer.\r
1e354c03 77\r
e9b67286 78 @retval EFI_SUCCESS Success. All resources used in the memory test are freed.\r
1e354c03 79\r
80**/\r
88f20127 81typedef\r
82EFI_STATUS\r
7d839888 83(EFIAPI *EFI_MEMORY_TEST_FINISHED)(\r
88f20127 84 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This\r
ed66e1bc 85 );\r
88f20127 86\r
1e354c03 87/**\r
e40b7d5d 88 Provides the capability to test the compatible range used by some special drivers.\r
88f20127 89\r
d1102dba 90 @param This The protocol instance pointer.\r
346cf9ac
LG
91 @param StartAddress The start address of the compatible memory range that\r
92 must be below 16M.\r
d1102dba
LG
93 @param Length The compatible memory range's length.\r
94\r
95 @retval EFI_SUCCESS The compatible memory range pass the memory test.\r
b9982883 96 @retval EFI_INVALID_PARAMETER The compatible memory range are not below Low 16M.\r
1e354c03 97\r
98**/\r
88f20127 99typedef\r
100EFI_STATUS\r
7d839888 101(EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE)(\r
5f597758 102 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
88f20127 103 IN EFI_PHYSICAL_ADDRESS StartAddress,\r
104 IN UINT64 Length\r
ed66e1bc 105 );\r
88f20127 106\r
107struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {\r
1436aea4
MK
108 EFI_MEMORY_TEST_INIT MemoryTestInit;\r
109 EFI_PERFORM_MEMORY_TEST PerformMemoryTest;\r
110 EFI_MEMORY_TEST_FINISHED Finished;\r
111 EFI_MEMORY_TEST_COMPATIBLE_RANGE CompatibleRangeTest;\r
88f20127 112};\r
113\r
1436aea4 114extern EFI_GUID gEfiGenericMemTestProtocolGuid;\r
88f20127 115\r
116#endif\r