TianoCore EDK2
master
Loading...
Searching...
No Matches
CpuPageTableLibUnitTest.h
Go to the documentation of this file.
1
8
#ifndef CPU_PAGE_TABLE_SUPPORT_H_
9
#define CPU_PAGE_TABLE_SUPPORT_H_
10
11
#include <stdio.h>
12
#include <stdlib.h>
13
#include <string.h>
14
#include <stdarg.h>
15
#include <stddef.h>
16
#include <setjmp.h>
17
#include <cmocka.h>
18
#include <time.h>
19
20
#include <
Uefi.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"
30
31
#define UNIT_TEST_APP_NAME "Cpu Page Table Lib Unit Tests"
32
#define UNIT_TEST_APP_VERSION "1.0"
33
34
//
35
// Random Options
36
//
37
38
//
39
// Only test one-one mapping case
40
//
41
#define ONLY_ONE_ONE_MAPPING 0x00000001
42
43
//
44
// Change page table without using function PageTableMap, and use the modified page table as input
45
//
46
#define MANUAL_CHANGE_PAGE_TABLE 0x00000002
47
48
//
49
// Use pre-generated random number array to generate random number
50
//
51
#define USE_RANDOM_ARRAY 0x00000004
52
53
typedef
struct
{
54
PAGING_MODE PagingMode;
55
UINTN
TestCount;
56
UINTN
TestRangeCount;
57
UINTN
RandomOption;
58
}
CPU_PAGE_TABLE_LIB_RANDOM_TEST_CONTEXT
;
59
75
UNIT_TEST_STATUS
76
EFIAPI
77
TestCaseforRandomTest
(
78
IN
UNIT_TEST_CONTEXT
Context
79
);
80
86
VOID
87
InitGlobalData
(
88
UINTN
MemorySpace
89
);
90
99
UNIT_TEST_STATUS
100
IsPageTableValid
(
101
IN
UINTN
PageTable,
102
IN
PAGING_MODE PagingMode
103
);
104
112
UINT64
113
GetMaxAddress
(
114
IN
PAGING_MODE Mode
115
);
116
117
#endif
UINTN
UINT64 UINTN
Definition:
ProcessorBind.h:112
BaseCryptLib.h
BaseLib.h
BaseMemoryLib.h
CpuPageTableLib.h
TestCaseforRandomTest
UNIT_TEST_STATUS EFIAPI TestCaseforRandomTest(IN UNIT_TEST_CONTEXT Context)
Definition:
RandomTest.c:1037
IsPageTableValid
UNIT_TEST_STATUS IsPageTableValid(IN UINTN PageTable, IN PAGING_MODE PagingMode)
Definition:
TestHelper.c:170
InitGlobalData
VOID InitGlobalData(UINTN MemorySpace)
Definition:
TestHelper.c:31
GetMaxAddress
UINT64 GetMaxAddress(IN PAGING_MODE Mode)
Definition:
TestHelper.c:306
IN
#define IN
Definition:
Base.h:279
DebugLib.h
MemoryAllocationLib.h
Uefi.h
UnitTestHostBaseLib.h
UnitTestLib.h
UNIT_TEST_CONTEXT
VOID * UNIT_TEST_CONTEXT
Definition:
UnitTestLib.h:54
UNIT_TEST_STATUS
UINT32 UNIT_TEST_STATUS
Definition:
UnitTestLib.h:16
CPU_PAGE_TABLE_LIB_RANDOM_TEST_CONTEXT
Definition:
CpuPageTableLibUnitTest.h:53
UefiCpuPkg
Library
CpuPageTableLib
UnitTest
CpuPageTableLibUnitTest.h
Generated on Fri Nov 15 2024 18:01:26 for TianoCore EDK2 by
1.9.6