From d3d3596cd68305593347d28e6f1ef9c748b53167 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 21 Aug 2009 09:15:11 +0000 Subject: [PATCH] * accelerated/fixed TLS access on win32 by Pierre Muller git-svn-id: trunk@13571 - --- rtl/win/systhrd.inc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rtl/win/systhrd.inc b/rtl/win/systhrd.inc index a7c1abaa31..b30b97547a 100644 --- a/rtl/win/systhrd.inc +++ b/rtl/win/systhrd.inc @@ -105,13 +105,20 @@ CONST dataindex : pointer; errorsave : dword; begin -{$ifdef dummy} - { I've no clue why this doesn't read dataindex, imo it should (FK) } +{$ifdef win32} asm movl TLSKey,%edx movl $0x2c,%eax movl %fs:(%eax),%eax - movl (%eax,%edx,4),%eax + orl %eax,%eax + jnz .LAddressInEAX + movl $0x18,%eax + movl %fs:(%eax),%eax + movl 0xe10(%eax,%edx,4),%eax + jmp .LToDataIndex + .LAddressInEAX: + movl (%eax,%edx,4),%eax + .LToDataIndex: movl %eax,dataindex end; if DataIndex=nil then