This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[libjava] tweak to alpha thread code


I believe 3.4 added __builtin_thread_pointer.  It does the same 
thing as the asm that I'm replacing, so there's zero functional
change.


r~


        * include/posix-threads.h <__alpha__> (_Jv_ThreadId_t): Use void*.
        (_Jv_ThreadSelf): Use __builtin_thread_pointer.

Index: libjava/include/posix-threads.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/posix-threads.h,v
retrieving revision 1.25
diff -c -p -d -u -r1.25 posix-threads.h
--- libjava/include/posix-threads.h	21 Oct 2003 04:46:19 -0000	1.25
+++ libjava/include/posix-threads.h	11 Oct 2004 17:48:24 -0000
@@ -241,23 +241,12 @@ _Jv_ThreadSelf (void)
 
 #ifdef __alpha__
 
-#ifdef __FreeBSD__
-#include <machine/pal.h>
-#define PAL_rduniq PAL_rdunique
-#elif defined (__osf__)
-#include <machine/pal.h>
-#else
-#include <asm/pal.h>
-#endif
-
-typedef unsigned long _Jv_ThreadId_t;
+typedef void *_Jv_ThreadId_t;
 
 inline _Jv_ThreadId_t
 _Jv_ThreadSelf (void)
 {
-  register unsigned long id __asm__("$0");
-  __asm__ ("call_pal %1" : "=r"(id) : "i"(PAL_rduniq));
-  return id;
+  return __builtin_thread_pointer ();
 }
 
 #define JV_SELF_DEFINED


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]