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
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.
17 The generic memory test driver definition
21 #ifndef _NULL_MEMORY_TEST_H
22 #define _NULL_MEMORY_TEST_H
25 // The package level header files this module uses
30 // The protocols, PPI and GUID defintions for this module
32 #include <Protocol/GenericMemoryTest.h>
34 // The Library classes this module consumes
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>
43 // attributes for reserved memory before it is promoted to system memory
45 #define EFI_MEMORY_PRESENT 0x0100000000000000ULL
46 #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
47 #define EFI_MEMORY_TESTED 0x0400000000000000ULL
53 #define GENERIC_CACHELINE_SIZE 0x40
56 // The SPARSE_SPAN_SIZE size can not small then the MonoTestSize
58 #define TEST_BLOCK_SIZE 0x2000000
59 #define QUICK_SPAN_SIZE (TEST_BLOCK_SIZE >> 2)
60 #define SPARSE_SPAN_SIZE (TEST_BLOCK_SIZE >> 4)
63 // This structure records every nontested memory range parsed through GCD
66 #define EFI_NONTESTED_MEMORY_RANGE_SIGNATURE EFI_SIGNATURE_32 ('N', 'T', 'M', 'E')
70 EFI_PHYSICAL_ADDRESS StartAddress
;
74 BOOLEAN AlreadyMapped
;
75 } NONTESTED_MEMORY_RANGE
;
77 #define NONTESTED_MEMORY_RANGE_FROM_LINK(link) \
78 CR(link, NONTESTED_MEMORY_RANGE, Link, EFI_NONTESTED_MEMORY_RANGE_SIGNATURE)
81 // This is the memory test driver's structure definition
83 #define EFI_GENERIC_MEMORY_TEST_PRIVATE_SIGNATURE EFI_SIGNATURE_32 ('G', 'E', 'M', 'T')
86 // Function Prototypes
90 InitializeMemoryTest (
91 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
92 IN EXTENDMEM_COVERAGE_LEVEL Level
,
93 OUT BOOLEAN
*RequireSoftECCInit
99 GenPerformMemoryTest (
100 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
101 IN OUT UINT64
*TestedMemorySize
,
102 OUT UINT64
*TotalMemorySize
,
103 OUT BOOLEAN
*ErrorOut
,
110 GenMemoryTestFinished (
111 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
117 GenCompatibleRangeTest (
118 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
119 IN EFI_PHYSICAL_ADDRESS StartAddress
,