2 The generic memory test driver definition
4 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _NULL_MEMORY_TEST_H
16 #define _NULL_MEMORY_TEST_H
22 #include <Protocol/GenericMemoryTest.h>
24 #include <Library/DebugLib.h>
25 #include <Library/UefiDriverEntryPoint.h>
26 #include <Library/DxeServicesTableLib.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/MemoryAllocationLib.h>
31 // attributes for reserved memory before it is promoted to system memory
33 #define EFI_MEMORY_PRESENT 0x0100000000000000ULL
34 #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
35 #define EFI_MEMORY_TESTED 0x0400000000000000ULL
41 #define GENERIC_CACHELINE_SIZE 0x40
44 // The SPARSE_SPAN_SIZE size can not small then the MonoTestSize
46 #define TEST_BLOCK_SIZE 0x2000000
47 #define QUICK_SPAN_SIZE (TEST_BLOCK_SIZE >> 2)
48 #define SPARSE_SPAN_SIZE (TEST_BLOCK_SIZE >> 4)
51 // This structure records every nontested memory range parsed through GCD
54 #define EFI_NONTESTED_MEMORY_RANGE_SIGNATURE EFI_SIGNATURE_32 ('N', 'T', 'M', 'E')
58 EFI_PHYSICAL_ADDRESS StartAddress
;
62 BOOLEAN AlreadyMapped
;
63 } NONTESTED_MEMORY_RANGE
;
65 #define NONTESTED_MEMORY_RANGE_FROM_LINK(link) \
66 CR(link, NONTESTED_MEMORY_RANGE, Link, EFI_NONTESTED_MEMORY_RANGE_SIGNATURE)
69 // This is the memory test driver's structure definition
71 #define EFI_GENERIC_MEMORY_TEST_PRIVATE_SIGNATURE EFI_SIGNATURE_32 ('G', 'E', 'M', 'T')
74 // Function Prototypes
78 InitializeMemoryTest (
79 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
80 IN EXTENDMEM_COVERAGE_LEVEL Level
,
81 OUT BOOLEAN
*RequireSoftECCInit
87 GenPerformMemoryTest (
88 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
89 IN OUT UINT64
*TestedMemorySize
,
90 OUT UINT64
*TotalMemorySize
,
91 OUT BOOLEAN
*ErrorOut
,
98 GenMemoryTestFinished (
99 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
105 GenCompatibleRangeTest (
106 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
107 IN EFI_PHYSICAL_ADDRESS StartAddress
,