We must not do any kernel exit work when we originally didn't come from
userland. E.g. preparing a signal handler would terribly go wrong, since we don't have a userland iframe. This fixes bug #2562 and maybe also #2522. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26810 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -299,10 +299,18 @@ int_bottom_user:
|
|||||||
movl IFRAME_vector(%ebp), %eax
|
movl IFRAME_vector(%ebp), %eax
|
||||||
call *gInterruptHandlerTable(, %eax, 4)
|
call *gInterruptHandlerTable(, %eax, 4)
|
||||||
|
|
||||||
|
// Don't do any kernel exit work, if we actually came from the kernel (but
|
||||||
|
// were already/still prepared for userland), since the iframe in this case
|
||||||
|
// will be a kernel iframe and e.g. trying to set up a signal stack will not
|
||||||
|
// be a very healthy endeavor.
|
||||||
|
cmp $USER_CODE_SEG, IFRAME_cs(%ebp)
|
||||||
|
jne 1f
|
||||||
|
|
||||||
testl $(THREAD_FLAGS_DEBUGGER_INSTALLED | THREAD_FLAGS_SIGNALS_PENDING \
|
testl $(THREAD_FLAGS_DEBUGGER_INSTALLED | THREAD_FLAGS_SIGNALS_PENDING \
|
||||||
| THREAD_FLAGS_DEBUG_THREAD | THREAD_FLAGS_BREAKPOINTS_DEFINED) \
|
| THREAD_FLAGS_DEBUG_THREAD | THREAD_FLAGS_BREAKPOINTS_DEFINED) \
|
||||||
, THREAD_flags(%edi)
|
, THREAD_flags(%edi)
|
||||||
jnz kernel_exit_work
|
jnz kernel_exit_work
|
||||||
|
1:
|
||||||
|
|
||||||
cli // disable interrupts
|
cli // disable interrupts
|
||||||
|
|
||||||
@@ -630,14 +638,14 @@ FUNCTION(x86_vm86_return):
|
|||||||
cli
|
cli
|
||||||
movl %esi, %esp
|
movl %esi, %esp
|
||||||
addl $VM86_IFRAME_sizeof, %esp
|
addl $VM86_IFRAME_sizeof, %esp
|
||||||
|
|
||||||
// save old iframe
|
// save old iframe
|
||||||
popl %eax // old kernel stack top
|
popl %eax // old kernel stack top
|
||||||
popl %edi
|
popl %edi
|
||||||
movl $(VM86_IFRAME_sizeof >> 2), %ecx
|
movl $(VM86_IFRAME_sizeof >> 2), %ecx
|
||||||
cld
|
cld
|
||||||
rep movsl
|
rep movsl
|
||||||
|
|
||||||
// adjust kernel_stack_top and tss.esp0
|
// adjust kernel_stack_top and tss.esp0
|
||||||
movl %dr3, %edi
|
movl %dr3, %edi
|
||||||
movl %eax, THREAD_kernel_stack_top(%edi)
|
movl %eax, THREAD_kernel_stack_top(%edi)
|
||||||
|
|||||||
Reference in New Issue
Block a user