small RTEMS patch

View: New views
2 Messages — Rating Filter:   Alert me  

small RTEMS patch

by Joel Sherrill <joel@OARcorp.com> :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

    * 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@...        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) */

Re: small RTEMS patch

by Ralf Corsepius-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/12/2009 11:05 PM, Joel Sherrill wrote:

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

Both patches are controversial amongst the RTEMS folks.

Jeff, my advice: Do not apply these patches unless Joel can explain in
depth what he is trying to fix and until it clear his patches are "the
way to go" - So far this is not the case.


> 2009-10-12 Joel Sherrill <joel.sherrill@...>
>
> * 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.
>