ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
PageFaultVector.h
Go to the documentation of this file.
1 
53 #ifndef ETISS_INCLUDE_MM_PAGEFAULTVECTOR_H_
54 #define ETISS_INCLUDE_MM_PAGEFAULTVECTOR_H_
55 #include <iostream>
56 
57 namespace etiss
58 {
59 namespace mm
60 {
61 
63 {
67 };
68 
69 class MMU;
70 void DUMP_MMU(MMU *mmu);
71 
72 typedef int32_t (*handler_ptr)(int32_t fault, MMU *mmu, uint64_t vma, MM_ACCESS access);
73 
74 #define MAX_PAGE_FAULT_NUM 20
75 
76 #ifndef PAGE_FAULT
77 #define PAGE_FAULT(val, fault) const int32_t fault = val;
78 #endif
79 
80 #ifndef REGISTER_PAGE_FAULT_HANDLER
81 #define REGISTER_PAGE_FAULT_HANDLER(fault, handler) page_fault_handler[fault] = handler
82 #endif
83 
84 #ifndef HANDLE_PAGE_FAULT
85 #define HANDLE_PAGE_FAULT(fault, mmu, vma, access) (*page_fault_handler[fault])(fault, mmu, vma, access)
86 #endif
87 
88 #ifdef _WIN32
89  #ifdef ETISS_PLUGIN_IMPORTS
90  #define MM_EXPORT __declspec(dllimport)
91  #else
92  #define MM_EXPORT __declspec(dllexport)
93  #endif
94 #else
95  #define MM_EXPORT
96 #endif
97 
98 extern MM_EXPORT const int32_t NOERROR;
99 extern MM_EXPORT const int32_t PTEOVERLAP;
100 extern MM_EXPORT const int32_t TLBMISS;
101 extern MM_EXPORT const int32_t PTENOTEXISTED;
102 extern MM_EXPORT const int32_t TLBISFULL;
104 
105 extern MM_EXPORT std::string PAGE_FAULT_MSG[];
107 
108 } // namespace mm
109 } // namespace etiss
110 
111 #endif
#define MM_EXPORT
static __inline__ uint64_t
Definition: arm_cde.h:31
static __inline__ int32_t
Definition: arm_mve.h:51
MM_EXPORT const int32_t PTENOTEXISTED
MM_EXPORT handler_ptr page_fault_handler[]
void DUMP_MMU(MMU *mmu)
Definition: MMU.cpp:244
MM_EXPORT const int32_t TLBISFULL
MM_EXPORT const int32_t PROTECTIONVIALATION
MM_EXPORT const int32_t TLBMISS
MM_EXPORT const int32_t NOERROR
int32_t(* handler_ptr)(int32_t fault, MMU *mmu, uint64_t vma, MM_ACCESS access)
MM_EXPORT const int32_t PTEOVERLAP
MM_EXPORT std::string PAGE_FAULT_MSG[]
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition: Benchmark.h:53