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
This commit is contained in:
parent
2740dedc5b
commit
4609c64d48
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user