From 4609c64d484e182c8a49be440e06e855c8a856b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 12 Oct 2004 22:42:22 +0000 Subject: [PATCH] The %fs register is used by user space TLS - it is CPU dependent, and must not be restored from the iframe; it will be set by the scheduling code. This is only of concern on SMP machines and could prevent TLS from working. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9310 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/arch/x86/arch_interrupts.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kernel/core/arch/x86/arch_interrupts.S b/src/kernel/core/arch/x86/arch_interrupts.S index 9af9619601..252c96b826 100755 --- a/src/kernel/core/arch/x86/arch_interrupts.S +++ b/src/kernel/core/arch/x86/arch_interrupts.S @@ -94,12 +94,12 @@ int_bottom: movl %eax,%es movl %ss,%ebx movl %esp,%esi - cmpl %eax,%ebx // check if we changed the stack + cmpl %eax,%ebx // check if we changed the stack jne custom_stack kernel_stack: call i386_handle_trap pop %gs - pop %fs + pop %fs // kernel stacks don't care about TLS (which uses %fs) pop %es pop %ds popa @@ -124,7 +124,7 @@ int_bottom: call i386_handle_trap lss 84(%esp),%esp // reload custom stack address pop %gs - pop %fs + addl $4, %esp // we skip %fs, as this contains the CPU dependent TLS segment pop %es pop %ds popa @@ -193,7 +193,7 @@ FUNCTION(i386_restore_frame_from_syscall): add $4, %esp // make the iframe our current stack position (we don't need the // return address anymore, as we will use the one of the frame) pop %gs // recreate the frame environment - pop %fs + addl $4, %esp // we skip %fs, as this contains the CPU dependent TLS segment pop %es pop %ds popa