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
28 #include <Protocol/GenericMemoryTest.h>
30 #include <Library/DebugLib.h>
31 #include <Library/UefiDriverEntryPoint.h>
32 #include <Library/DxeServicesTableLib.h>
33 #include <Library/UefiBootServicesTableLib.h>
34 #include <Library/MemoryAllocationLib.h>
37 // attributes for reserved memory before it is promoted to system memory
39 #define EFI_MEMORY_PRESENT 0x0100000000000000ULL
40 #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
41 #define EFI_MEMORY_TESTED 0x0400000000000000ULL
47 #define GENERIC_CACHELINE_SIZE 0x40
50 // The SPARSE_SPAN_SIZE size can not small then the MonoTestSize
52 #define TEST_BLOCK_SIZE 0x2000000
53 #define QUICK_SPAN_SIZE (TEST_BLOCK_SIZE >> 2)
54 #define SPARSE_SPAN_SIZE (TEST_BLOCK_SIZE >> 4)
57 // This structure records every nontested memory range parsed through GCD
60 #define EFI_NONTESTED_MEMORY_RANGE_SIGNATURE EFI_SIGNATURE_32 ('N', 'T', 'M', 'E')
64 EFI_PHYSICAL_ADDRESS StartAddress
;
68 BOOLEAN AlreadyMapped
;
69 } NONTESTED_MEMORY_RANGE
;
71 #define NONTESTED_MEMORY_RANGE_FROM_LINK(link) \
72 CR(link, NONTESTED_MEMORY_RANGE, Link, EFI_NONTESTED_MEMORY_RANGE_SIGNATURE)
75 // This is the memory test driver's structure definition
77 #define EFI_GENERIC_MEMORY_TEST_PRIVATE_SIGNATURE EFI_SIGNATURE_32 ('G', 'E', 'M', 'T')
80 // Function Prototypes
84 InitializeMemoryTest (
85 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
86 IN EXTENDMEM_COVERAGE_LEVEL Level
,
87 OUT BOOLEAN
*RequireSoftECCInit
93 GenPerformMemoryTest (
94 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
95 IN OUT UINT64
*TestedMemorySize
,
96 OUT UINT64
*TotalMemorySize
,
97 OUT BOOLEAN
*ErrorOut
,
104 GenMemoryTestFinished (
105 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
111 GenCompatibleRangeTest (
112 IN EFI_GENERIC_MEMORY_TEST_PROTOCOL
*This
,
113 IN EFI_PHYSICAL_ADDRESS StartAddress
,