3 Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
8 #ifndef CPU_PAGE_TABLE_SUPPORT_H_
9 #define CPU_PAGE_TABLE_SUPPORT_H_
21 #include <Library/BaseLib.h>
22 #include <Library/BaseMemoryLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/UnitTestLib.h>
25 #include <Library/CpuPageTableLib.h>
26 #include <Library/MemoryAllocationLib.h>
27 #include <Library/UnitTestHostBaseLib.h>
28 #include <Library/BaseCryptLib.h>
29 #include "../CpuPageTable.h"
31 #define UNIT_TEST_APP_NAME "Cpu Page Table Lib Unit Tests"
32 #define UNIT_TEST_APP_VERSION "1.0"
39 // Only test one-one mapping case
41 #define ONLY_ONE_ONE_MAPPING 0x00000001
44 // Change page table without using function PageTableMap, and use the modified page table as input
46 #define MANUAL_CHANGE_PAGE_TABLE 0x00000002
49 // Use pre-generated random number array to generate random number
51 #define USE_RANDOM_ARRAY 0x00000004
54 PAGING_MODE PagingMode
;
58 } CPU_PAGE_TABLE_LIB_RANDOM_TEST_CONTEXT
;
63 @param[in] Context [Optional] An optional parameter that enables:
64 1) test-case reuse with varied parameters and
65 2) test-case re-entry for Target tests that need a
66 reboot. This parameter is a VOID* and it is the
67 responsibility of the test author to ensure that the
68 contents are well understood by all test cases that may
71 @retval UNIT_TEST_PASSED The Unit test has completed and the test
73 @retval UNIT_TEST_ERROR_TEST_FAILED A test case assertion has failed.
77 TestCaseforRandomTest (
78 IN UNIT_TEST_CONTEXT Context
84 @param[in] MemorySpace Memory space
92 Check if the Page table is valid
94 @param[in] PageTable The pointer to the page table.
95 @param[in] PagingMode The paging mode.
97 @retval UNIT_TEST_PASSED It is a valid Page Table
102 IN PAGING_MODE PagingMode
106 Get max physical adrress supported by specific page mode
108 @param[in] Mode The paging mode.