]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Include/Protocol/GenericMemoryTest.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / GenericMemoryTest.h
... / ...
CommitLineData
1/** @file\r
2 This protocol defines the generic memory test interfaces in Dxe phase.\r
3\r
4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
5SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
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
15typedef struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL EFI_GENERIC_MEMORY_TEST_PROTOCOL;\r
16\r
17///\r
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
20///\r
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
29/**\r
30 Initialize the generic memory test.\r
31\r
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
35\r
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
38\r
39**/\r
40typedef\r
41EFI_STATUS\r
42(EFIAPI *EFI_MEMORY_TEST_INIT)(\r
43 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
44 IN EXTENDMEM_COVERAGE_LEVEL Level,\r
45 OUT BOOLEAN *RequireSoftECCInit\r
46 );\r
47\r
48/**\r
49 Perform the memory test.\r
50\r
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
55 @param ErrorOut TRUE if the memory error occurred.\r
56 @param IfTestAbort Indicates that the user pressed "ESC" to skip the memory test.\r
57\r
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
60 @retval EFI_DEVICE_ERROR Memory device error occurred, and no agent can handle it.\r
61\r
62**/\r
63typedef\r
64EFI_STATUS\r
65(EFIAPI *EFI_PERFORM_MEMORY_TEST)(\r
66 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
67 OUT UINT64 *TestedMemorySize,\r
68 OUT UINT64 *TotalMemorySize,\r
69 OUT BOOLEAN *ErrorOut,\r
70 IN BOOLEAN IfTestAbort\r
71 );\r
72\r
73/**\r
74 Finish the memory test.\r
75\r
76 @param This The protocol instance pointer.\r
77\r
78 @retval EFI_SUCCESS Success. All resources used in the memory test are freed.\r
79\r
80**/\r
81typedef\r
82EFI_STATUS\r
83(EFIAPI *EFI_MEMORY_TEST_FINISHED)(\r
84 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This\r
85 );\r
86\r
87/**\r
88 Provides the capability to test the compatible range used by some special drivers.\r
89\r
90 @param This The protocol instance pointer.\r
91 @param StartAddress The start address of the compatible memory range that\r
92 must be below 16M.\r
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
96 @retval EFI_INVALID_PARAMETER The compatible memory range are not below Low 16M.\r
97\r
98**/\r
99typedef\r
100EFI_STATUS\r
101(EFIAPI *EFI_MEMORY_TEST_COMPATIBLE_RANGE)(\r
102 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r
103 IN EFI_PHYSICAL_ADDRESS StartAddress,\r
104 IN UINT64 Length\r
105 );\r
106\r
107struct _EFI_GENERIC_MEMORY_TEST_PROTOCOL {\r
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
112};\r
113\r
114extern EFI_GUID gEfiGenericMemTestProtocolGuid;\r
115\r
116#endif\r