added 1 changeset to branch 'refs/remotes/xyzzy-github/x86_64' old head: 70ee5a7efb6b566d840437a24edf0264e4d6c2ee new head: 25871c6895b536640b3d9f453e95219a54b84d20 ---------------------------------------------------------------------------- 25871c6: Removed Thread::fault_callback, no longer necessary now that vm86 is gone. [ Alex Smith <alex@xxxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- Commit: 25871c6895b536640b3d9f453e95219a54b84d20 Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Sat Aug 4 10:02:54 2012 UTC ---------------------------------------------------------------------------- 2 files changed, 16 insertions(+), 29 deletions(-) headers/private/kernel/thread_types.h | 11 +--------- src/system/kernel/vm/vm.cpp | 34 +++++++++++++---------------- ---------------------------------------------------------------------------- diff --git a/headers/private/kernel/thread_types.h b/headers/private/kernel/thread_types.h index 017da64..78e893d 100644 --- a/headers/private/kernel/thread_types.h +++ b/headers/private/kernel/thread_types.h @@ -187,9 +187,6 @@ private: typedef int32 (*thread_entry_func)(thread_func, void *); -typedef bool (*page_fault_callback)(addr_t address, addr_t faultAddress, - bool isWrite); - namespace BKernel { @@ -477,13 +474,7 @@ struct Thread : TeamThreadIteratorEntry<thread_id>, KernelReferenceable { } msg; // write_sem/read_sem are protected by fLock when accessed by // others, the other fields are protected by write_sem/read_sem - union { - addr_t fault_handler; - page_fault_callback fault_callback; - // TODO: this is a temporary field used for the vm86 implementation - // and should be removed again when that one is moved into the - // kernel entirely. - }; + addr_t fault_handler; int32 page_faults_allowed; /* this field may only stay in debug builds in the future */ diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 7aaafab..79eeb71 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -4130,25 +4130,21 @@ vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite, bool isUser, addressSpace->ReadUnlock(); #endif - // TODO: the fault_callback is a temporary solution for vm86 - if (thread->fault_callback == NULL - || thread->fault_callback(address, faultAddress, isWrite)) { - // If the thread has a signal handler for SIGSEGV, we simply - // send it the signal. Otherwise we notify the user debugger - // first. - struct sigaction action; - if ((sigaction(SIGSEGV, NULL, &action) == 0 - && action.sa_handler != SIG_DFL - && action.sa_handler != SIG_IGN) - || user_debug_exception_occurred(B_SEGMENT_VIOLATION, - SIGSEGV)) { - Signal signal(SIGSEGV, - status == B_PERMISSION_DENIED - ? SEGV_ACCERR : SEGV_MAPERR, - EFAULT, thread->team->id); - signal.SetAddress((void*)address); - send_signal_to_thread(thread, signal, 0); - } + // If the thread has a signal handler for SIGSEGV, we simply + // send it the signal. Otherwise we notify the user debugger + // first. + struct sigaction action; + if ((sigaction(SIGSEGV, NULL, &action) == 0 + && action.sa_handler != SIG_DFL + && action.sa_handler != SIG_IGN) + || user_debug_exception_occurred(B_SEGMENT_VIOLATION, + SIGSEGV)) { + Signal signal(SIGSEGV, + status == B_PERMISSION_DENIED + ? SEGV_ACCERR : SEGV_MAPERR, + EFAULT, thread->team->id); + signal.SetAddress((void*)address); + send_signal_to_thread(thread, signal, 0); } } }