From d296d770a3637e6a248eb2ca4fe35a5d78e515ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 15 Oct 2004 15:47:34 +0000 Subject: [PATCH] %fs won't be adopted from the iframe anymore, we don't need to change it there. We also should disable interrupts in arch_restore_fork_frame(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9368 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/arch/x86/arch_thread.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/kernel/core/arch/x86/arch_thread.c b/src/kernel/core/arch/x86/arch_thread.c index 98c706f609..366d1e6fce 100755 --- a/src/kernel/core/arch/x86/arch_thread.c +++ b/src/kernel/core/arch/x86/arch_thread.c @@ -60,16 +60,6 @@ i386_get_current_iframe(void) } -static inline uint32 -get_fs_register(void) -{ - uint32 fs; - - asm("movl %%fs,%0" : "=r" (fs)); - return fs; -} - - static inline void set_fs_register(uint32 segment) { @@ -391,6 +381,7 @@ arch_check_syscall_restart(struct thread *t) frame->eax = frame->orig_eax; frame->edx = frame->orig_edx; frame->eip -= 2; + // undos the "int $99" syscall interrupt (so that it'll be called again) } } @@ -426,13 +417,12 @@ arch_restore_fork_frame(struct arch_fork_arg *arg) { struct thread *thread = thread_get_current_thread(); + disable_interrupts(); + i386_set_tss_and_kstack(thread->kernel_stack_base + KSTACK_SIZE); // set the CPU dependent GDT entry for TLS (set the current %fs register) set_tls_context(thread); - - // patch up %fs register of the frame - arg->iframe.fs = get_fs_register(); i386_restore_frame_from_syscall(arg->iframe); }