Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: gcc/gcc/gthr-vxworks.h

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/gcc/gthr-tpf.h ('k') | gcc/gcc/haifa-sched.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/gthr-vxworks.h
diff --git a/gcc/gcc/gthr-vxworks.h b/gcc/gcc/gthr-vxworks.h
index c2fb8e6729f019a4928f4cd4ce7bf7b2890a3db4..d4da14ef49295674f6dfc9fd87436223764f5f49 100644
--- a/gcc/gcc/gthr-vxworks.h
+++ b/gcc/gcc/gthr-vxworks.h
@@ -115,17 +115,32 @@ __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
typedef struct
{
-#ifndef __RTP__
+#if !defined(__RTP__)
+#if defined(__PPC__)
+ __attribute ((aligned (__alignof (unsigned))))
+#endif
volatile unsigned char busy;
#endif
volatile unsigned char done;
+#if !defined(__RTP__) && defined(__PPC__)
+ /* PPC's test-and-set implementation requires a 4 byte aligned
+ object, of which it only sets the first byte. We use padding
+ here, in order to maintain some amount of backwards
+ compatibility. Without this padding, gthread_once objects worked
+ by accident because they happen to be static objects and the ppc
+ port automatically increased their alignment to 4 bytes. */
+ unsigned char pad1;
+ unsigned char pad2;
+#endif
}
__gthread_once_t;
-#ifndef __RTP__
-# define __GTHREAD_ONCE_INIT { 0, 0 }
-#else
+#if defined (__RTP__)
# define __GTHREAD_ONCE_INIT { 0 }
+#elif defined (__PPC__)
+# define __GTHREAD_ONCE_INIT { 0, 0, 0, 0 }
+#else
+# define __GTHREAD_ONCE_INIT { 0, 0 }
#endif
extern int __gthread_once (__gthread_once_t *__once, void (*__func)(void));
« no previous file with comments | « gcc/gcc/gthr-tpf.h ('k') | gcc/gcc/haifa-sched.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698