CVS: winex/scheduler process.c,1.56,1.57

[email protected] 31 Jul 2007 18:01:06 -0000
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/scheduler process.c,1.56,1.57Update of /var/lib/cvsd/cvsroot/winex/scheduler
In directory agravaine:/tmp/cvs-serv24929/scheduler

Modified Files:
	process.c 
Log Message:

- add assembly version of TlsGetValue() for performance



Index: process.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/scheduler/process.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- process.c	30 Mar 2007 18:58:41 -0000	1.56
+++ process.c	31 Jul 2007 18:01:04 -0000	1.57
@@ -2096,6 +2096,21 @@
  *    Success: Value stored in calling thread's TLS slot for index
  *    Failure: 0 and GetLastError returns NO_ERROR
  */
+#ifdef __i386__
+__ASM_GLOBAL_FUNC(TlsGetValue,
+                  "mov 0x4(%esp),%edx\n\t"
+                  "cmp $0x3f,%edx\n\t"
+                  "ja 1f\n\t"
+                  "xor %eax,%eax\n\t"
+                  "mov %eax,%fs:0x60\n\t"
+                  "mov %fs:0x18,%eax\n\t"
+                  "mov 0xe10(%eax,%edx,4),%eax\n\t"
+                  "ret $0x4\n\t"
+                  "1: mov $0x57,%eax\n\t"
+                  "mov %eax,%fs:0x60\n\t"
+                  "xor %eax,%eax\n\t"
+                  "ret $0x4\n");
+#else
 LPVOID WINAPI TlsGetValue(
     DWORD index) /* [in] TLS index to retrieve value for */
 {
@@ -2107,6 +2122,7 @@
     SetLastError( ERROR_SUCCESS );
     return NtCurrentTeb()->tls_array[index];
 }
+#endif
 
 
 /**********************************************************************