This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

change RTEMS definition of ALIGNBYTES


Hi,

The definition of ALIGNBYTES for RTEMS was not strict
enough.  If you use it to align a double or structure
gcc wants to use "load two word" instructions
(e.g. SPARC ldd), then you will get a fault.
I saw this with a port of BSD ls to RTEMS.

FWIW the linux version uses the sizeof(int) also.
I don't know if it will potentially trip the same
issue.

Please apply. Thanks.

2009-06-19 Joel Sherrill <joel.sherrill@oarcorp.com>

   * libc/sys/rtems/machine/param.h: Change ALIGNBYTES
   so it can point to an aligned structure or double.

--
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
  Support Available             (256) 722-9985


Index: libc/sys/rtems/machine/param.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/rtems/machine/param.h,v
retrieving revision 1.2
diff -u -r1.2 param.h
--- libc/sys/rtems/machine/param.h	28 Aug 2006 17:17:24 -0000	1.2
+++ libc/sys/rtems/machine/param.h	19 Jun 2009 14:32:53 -0000
@@ -19,7 +19,7 @@
  * for all data types (int, long, ...).   The result is unsigned int
  * and must be cast to any desired pointer type.
  */
-#define ALIGNBYTES	(sizeof(int) - 1)
+#define ALIGNBYTES	(sizeof(double) - 1)
 #define ALIGN(p)	(((unsigned)(p) + ALIGNBYTES) & ~ALIGNBYTES)
 
 #define PAGE_SHIFT	12		/* LOG2(PAGE_SIZE) */

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