Now panics if page faults are forbidden and happen anyway.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2142 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -158,7 +158,9 @@ arch_int_is_interrupts_enabled(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void i386_handle_trap(struct iframe frame); /* keep the compiler happy, this function must be called only from assembly */
|
/* keep the compiler happy, this function must be called only from assembly */
|
||||||
|
void i386_handle_trap(struct iframe frame);
|
||||||
|
|
||||||
void
|
void
|
||||||
i386_handle_trap(struct iframe frame)
|
i386_handle_trap(struct iframe frame)
|
||||||
{
|
{
|
||||||
@@ -188,8 +190,10 @@ i386_handle_trap(struct iframe frame)
|
|||||||
// if the interrupts were disabled, and we are not running the kernel startup
|
// if the interrupts were disabled, and we are not running the kernel startup
|
||||||
// the page fault was not allowed to happen and we must panic
|
// the page fault was not allowed to happen and we must panic
|
||||||
if (0 == (frame.flags & 0x200) && !kernel_startup) {
|
if (0 == (frame.flags & 0x200) && !kernel_startup) {
|
||||||
panic("page_fault, but interrupts were disabled. Touching address %p from eip %p\n", (void *)cr2, (void *)frame.eip);
|
panic("page fault, but interrupts were disabled. Touching address %p from eip %p\n", (void *)cr2, (void *)frame.eip);
|
||||||
}
|
} else if (thread != NULL && thread->page_faults_allowed < 1)
|
||||||
|
panic("page fault not allowed at this place. Touching address %p from eip %p\n", (void *)cr2, (void *)frame.eip);
|
||||||
|
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
|
|
||||||
ret = vm_page_fault(cr2, frame.eip,
|
ret = vm_page_fault(cr2, frame.eip,
|
||||||
@@ -262,9 +266,8 @@ i386_handle_trap(struct iframe frame)
|
|||||||
restore_interrupts(state);
|
restore_interrupts(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame.cs == USER_CODE_SEG || frame.vector == 99) {
|
if (frame.cs == USER_CODE_SEG || frame.vector == 99)
|
||||||
thread_atkernel_exit();
|
thread_atkernel_exit();
|
||||||
}
|
|
||||||
|
|
||||||
// dprintf("0x%x cpu %d!\n", thread_get_current_thread_id(), smp_get_current_cpu());
|
// dprintf("0x%x cpu %d!\n", thread_get_current_thread_id(), smp_get_current_cpu());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user