1 #ifndef __LUNAIX_FAULT_H
2 #define __LUNAIX_FAULT_H
4 #include <lunaix/mm/mm.h>
5 #include <lunaix/mm/page.h>
6 #include <lunaix/mm/procvm.h>
7 #include <lunaix/pcontext.h>
9 #define RESOLVE_OK ( 0b000001 )
10 #define NO_PREALLOC ( 0b000010 )
22 }; // arch-dependent fault state
24 pte_t fault_pte; // the fault-causing pte
25 ptr_t fault_refva; // referneced va, for ptep fault, equals to fault_va otherwise
26 pte_t resolving; // the pte that will resolve the fault
28 struct leaflet* prealloc; // preallocated physical page in-case of empty fault-pte
32 bool kernel_vmfault:1; // faulting address that is kernel
33 bool ptep_fault:1; // faulting address is a ptep
34 bool remote_fault:1; // referenced faulting address is remote vms
35 bool kernel_access:1; // kernel mem access causing the fault
38 struct proc_mm* mm; // process memory space associated with fault, might be remote
39 struct mm_region* vmr;
45 __arch_prepare_fault_context(struct fault_context* context);
48 fault_resolved(struct fault_context* fault, int flags)
50 fault->resolve_type |= (flags | RESOLVE_OK);
52 #endif /* __LUNAIX_FAULT_H */