]>
Commit | Line | Data |
---|---|---|
d7dec593 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | NullMemoryTest.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | The generic memory test driver definition\r | |
18 | \r | |
19 | --*/\r | |
20 | \r | |
21 | #ifndef _NULL_MEMORY_TEST_H\r | |
22 | #define _NULL_MEMORY_TEST_H\r | |
23 | \r | |
24 | //\r | |
25 | // The package level header files this module uses\r | |
26 | //\r | |
27 | #include <PiDxe.h>\r | |
28 | \r | |
29 | //\r | |
30 | // The protocols, PPI and GUID defintions for this module\r | |
31 | //\r | |
32 | #include <Protocol/GenericMemoryTest.h>\r | |
33 | //\r | |
34 | // The Library classes this module consumes\r | |
35 | //\r | |
36 | #include <Library/DebugLib.h>\r | |
37 | #include <Library/UefiDriverEntryPoint.h>\r | |
38 | #include <Library/DxeServicesTableLib.h>\r | |
39 | #include <Library/UefiBootServicesTableLib.h>\r | |
40 | #include <Library/MemoryAllocationLib.h>\r | |
41 | \r | |
42 | //\r | |
43 | // attributes for reserved memory before it is promoted to system memory\r | |
44 | //\r | |
45 | #define EFI_MEMORY_PRESENT 0x0100000000000000ULL\r | |
46 | #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL\r | |
47 | #define EFI_MEMORY_TESTED 0x0400000000000000ULL\r | |
48 | \r | |
49 | \r | |
50 | //\r | |
51 | // Some global define\r | |
52 | //\r | |
53 | #define GENERIC_CACHELINE_SIZE 0x40\r | |
54 | \r | |
55 | //\r | |
56 | // The SPARSE_SPAN_SIZE size can not small then the MonoTestSize\r | |
57 | //\r | |
58 | #define TEST_BLOCK_SIZE 0x2000000\r | |
59 | #define QUICK_SPAN_SIZE (TEST_BLOCK_SIZE >> 2)\r | |
60 | #define SPARSE_SPAN_SIZE (TEST_BLOCK_SIZE >> 4)\r | |
61 | \r | |
62 | //\r | |
63 | // This structure records every nontested memory range parsed through GCD\r | |
64 | // service.\r | |
65 | //\r | |
66 | #define EFI_NONTESTED_MEMORY_RANGE_SIGNATURE EFI_SIGNATURE_32 ('N', 'T', 'M', 'E')\r | |
67 | typedef struct {\r | |
68 | UINTN Signature;\r | |
69 | LIST_ENTRY Link;\r | |
70 | EFI_PHYSICAL_ADDRESS StartAddress;\r | |
71 | UINT64 Length;\r | |
72 | UINT64 Capabilities;\r | |
73 | BOOLEAN Above4G;\r | |
74 | BOOLEAN AlreadyMapped;\r | |
75 | } NONTESTED_MEMORY_RANGE;\r | |
76 | \r | |
77 | #define NONTESTED_MEMORY_RANGE_FROM_LINK(link) \\r | |
78 | CR(link, NONTESTED_MEMORY_RANGE, Link, EFI_NONTESTED_MEMORY_RANGE_SIGNATURE)\r | |
79 | \r | |
80 | //\r | |
81 | // This is the memory test driver's structure definition\r | |
82 | //\r | |
83 | #define EFI_GENERIC_MEMORY_TEST_PRIVATE_SIGNATURE EFI_SIGNATURE_32 ('G', 'E', 'M', 'T')\r | |
84 | \r | |
85 | //\r | |
86 | // Function Prototypes\r | |
87 | //\r | |
88 | EFI_STATUS\r | |
89 | EFIAPI\r | |
90 | InitializeMemoryTest (\r | |
91 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r | |
92 | IN EXTENDMEM_COVERAGE_LEVEL Level,\r | |
93 | OUT BOOLEAN *RequireSoftECCInit\r | |
94 | )\r | |
95 | ;\r | |
96 | \r | |
97 | EFI_STATUS\r | |
98 | EFIAPI\r | |
99 | GenPerformMemoryTest (\r | |
100 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r | |
101 | IN OUT UINT64 *TestedMemorySize,\r | |
102 | OUT UINT64 *TotalMemorySize,\r | |
103 | OUT BOOLEAN *ErrorOut,\r | |
104 | IN BOOLEAN TestAbort\r | |
105 | )\r | |
106 | ;\r | |
107 | \r | |
108 | EFI_STATUS\r | |
109 | EFIAPI\r | |
110 | GenMemoryTestFinished (\r | |
111 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This\r | |
112 | )\r | |
113 | ;\r | |
114 | \r | |
115 | EFI_STATUS\r | |
116 | EFIAPI\r | |
117 | GenCompatibleRangeTest (\r | |
118 | IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,\r | |
119 | IN EFI_PHYSICAL_ADDRESS StartAddress,\r | |
120 | IN UINT64 Length\r | |
121 | )\r | |
122 | ;\r | |
123 | \r | |
124 | #endif\r |