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]

[PATCH] vxWorks threads (gthr-vxworks.h)


The __gthread_once_t struct should use aligned ints instead of chars.
This allows the values to be manipulated on PowerPC using the stwcx
and lwarx instructions (as in the vxTas() function call) without
causing alignment issues.  The fix is probably applicable to other
architectures (SH4?) as well.  See the patch below.

Aaron


--- old/gthr-vxworks.h 2006-08-22 09:26:05.000000000 -0400 +++ new/gthr-vxworks.h 2006-08-22 09:26:15.000000000 -0400 @@ -103,8 +103,8 @@

typedef struct
{
-  volatile unsigned char busy;
-  volatile unsigned char done;
+  volatile unsigned int busy;
+  volatile unsigned int done;
}
__gthread_once_t;


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