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