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]

small RTEMS patch


Hi,

I have been using the CVS head for gcc testing
with only a couple of changes.


I still think that calling the Linux Errno Extensions
isn't right since we have BSD code that uses these.
But this is the constant we have to define whatever
it is called.

The machine/param.h change improves upon one committed
a while back.  We are using a single machine/param.h
implementation across all RTEMS targets.  So we need
a target architecture specific conditional to tune it
a little.  Most targets can get by with int (2 or 4)
as alignment but the SPARC needs it to be double (8)
or we get faults.

2009-10-12 Joel Sherrill <joel.sherrill@oarcorp.com>

   * libc/include/sys/config.h: Turn on errno extensions.
   * libc/sys/rtems/machine/param.h: Use double as alignment
   on SPARC only.  Other targets are OK with int.

--
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


? n.diff
? libc/include/errno.h.diff
Index: libc/include/sys/config.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v
retrieving revision 1.54
diff -u -r1.54 config.h
--- libc/include/sys/config.h	28 Sep 2009 16:42:21 -0000	1.54
+++ libc/include/sys/config.h	12 Oct 2009 20:59:11 -0000
@@ -191,6 +191,7 @@
 #if defined(__rtems__)
 #define __FILENAME_MAX__ 255
 #define _READ_WRITE_RETURN_TYPE _ssize_t
+#define __LINUX_ERRNO_EXTENSIONS__ 1
 #endif
 
 #ifndef __EXPORT
Index: libc/sys/rtems/machine/param.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/rtems/machine/param.h,v
retrieving revision 1.3
diff -u -r1.3 param.h
--- libc/sys/rtems/machine/param.h	19 Jun 2009 18:15:35 -0000	1.3
+++ libc/sys/rtems/machine/param.h	12 Oct 2009 20:59:12 -0000
@@ -19,7 +19,11 @@
  * for all data types (int, long, ...).   The result is unsigned int
  * and must be cast to any desired pointer type.
  */
+#if defined(__sparc__)
 #define ALIGNBYTES	(sizeof(double) - 1)
+#else
+#define ALIGNBYTES	(sizeof(int) - 1)
+#endif
 #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]