1 #ifndef __LUNAIX_FAULT_H
2 #define __LUNAIX_FAULT_H
4 #include <lunaix/mm/mm.h>
5 #include <lunaix/pcontext.h>
6 #include <lunaix/mm/procvm.h>
8 #define RESOLVE_OK ( 0b000001 )
9 #define NO_PREALLOC ( 0b000010 )
21 }; // arch-dependent fault state
23 pte_t fault_pte; // the fault-causing pte
24 ptr_t fault_refva; // referneced va, for ptep fault, equals to fault_va otherwise
25 pte_t resolving; // the pte that will resolve the fault
27 ptr_t prealloc_pa; // preallocated physical page in-case of empty fault-pte
29 bool kernel_vmfault:1; // faulting address that is kernel
30 bool ptep_fault:1; // faulting address is a ptep
31 bool remote_fault:1; // referenced faulting address is remote vms
32 bool kernel_access:1; // kernel mem access causing the fault
34 struct proc_mm* mm; // process memory space associated with fault, might be remote
35 struct mm_region* vmr;
41 __arch_prepare_fault_context(struct fault_context* context);
44 fault_resolved(struct fault_context* fault, pte_t resolved, int flags)
46 fault->resolving = resolved;
47 fault->resolve_type |= (flags | RESOLVE_OK);
49 #endif /* __LUNAIX_FAULT_H */