git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Decoupling Architectural-specific Code (#35)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
mm
/
fault.c
diff --git
a/lunaix-os/kernel/mm/fault.c
b/lunaix-os/kernel/mm/fault.c
index f55e489c2368a6a5b879f8fb6a60d0de7f488e04..e840b76a8bd4e7652697df1f4e07307d60d4f858 100644
(file)
--- a/
lunaix-os/kernel/mm/fault.c
+++ b/
lunaix-os/kernel/mm/fault.c
@@
-7,7
+7,7
@@
#include <lunaix/status.h>
#include <lunaix/syslog.h>
#include <lunaix/trace.h>
#include <lunaix/status.h>
#include <lunaix/syslog.h>
#include <lunaix/trace.h>
-#include <lunaix/
pcontext
.h>
+#include <lunaix/
hart_state
.h>
#include <lunaix/failsafe.h>
#include <sys/mm/mm_defs.h>
#include <lunaix/failsafe.h>
#include <sys/mm/mm_defs.h>
@@
-108,7
+108,7
@@
__prepare_fault_context(struct fault_context* fault)
fault->resolving = pte_mkloaded(fault->resolving);
fault->kernel_vmfault = kernel_vmfault;
fault->resolving = pte_mkloaded(fault->resolving);
fault->kernel_vmfault = kernel_vmfault;
- fault->kernel_access = kernel_context(fault->
ictx
);
+ fault->kernel_access = kernel_context(fault->
hstate
);
return true;
}
return true;
}
@@
-265,7
+265,7
@@
__fail_to_resolve(struct fault_context* fault)
failsafe_diagnostic();
}
failsafe_diagnostic();
}
- trace_printstack_isr(fault->
ictx
);
+ trace_printstack_isr(fault->
hstate
);
thread_setsignal(current_thread, _SIGSEGV);
thread_setsignal(current_thread, _SIGSEGV);
@@
-316,15
+316,15
@@
done:
}
void
}
void
-intr_routine_page_fault(const
isr_param* param
)
+intr_routine_page_fault(const
struct hart_state* hstate
)
{
{
- if (
param
->depth > 10) {
+ if (
hstate
->depth > 10) {
// Too many nested fault! we must messed up something
// XXX should we failed silently?
spin();
}
// Too many nested fault! we must messed up something
// XXX should we failed silently?
spin();
}
- struct fault_context fault = { .
ictx = param
};
+ struct fault_context fault = { .
hstate = hstate
};
if (!__prepare_fault_context(&fault)) {
__fail_to_resolve(&fault);
if (!__prepare_fault_context(&fault)) {
__fail_to_resolve(&fault);