Patch - Add pthread affinity for RTEMS

Sebastian Huber sebastian.huber@embedded-brains.de
Mon Nov 25 07:35:00 GMT 2013


On 2013-11-22 20:20, Joel Sherrill wrote:
>>> >>2013-11-22  Jennifer Averett<jennifer.averett@oarcorp.com>
>>> >>
>>> >>          * libc/include/pthread.h (pthread_attr_setaffinity_np,
>>> >>          pthread_attr_getaffinity_np, pthread_setaffinity_np,
>>> >>          pthread_getaffinity_np, pthread_getattr_np): Add pthread obtain
>>> >>          attribute and SMP affinity methods to RTEMS for compatibility
>>> >>          with GNU/Linux.
>>> >>          * libc/include/sys/types.h: Add cpuset to pthread_attr_t for RTEMS.
>>> >>
>>> >>-- 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
>>> >>
>>> >>
>>> >>pthread-affinity.diff
>>> >>
>>> >>
>>> >>? newlib/libc/include/sys/.types.h.swp
>>> >>? newlib/libc/sys/rtems/sys/cpuset.h
>>> >>Index: newlib/libc/include/pthread.h
>>> >>===================================================================
>>> >>RCS file: /cvs/src/src/newlib/libc/include/pthread.h,v
>>> >>retrieving revision 1.10
>>> >>diff -u -r1.10 pthread.h
>>> >>--- newlib/libc/include/pthread.h	22 Jan 2013 21:20:08 -0000	1.10
>>> >>+++ newlib/libc/include/pthread.h	11 Nov 2013 19:51:02 -0000
>>> >>@@ -2,7 +2,7 @@
>>> >>    *
>>> >>    *  Written by Joel Sherrill<joel@OARcorp.com>.
>>> >>    *
>>> >>- *  COPYRIGHT (c) 1989-2010.
>>> >>+ *  COPYRIGHT (c) 1989-2013.
>>> >>    *  On-Line Applications Research Corporation (OAR).
>>> >>    *
>>> >>    *  Permission to use, copy, modify, and distribute this software for any
>>> >>@@ -206,6 +206,24 @@
>>> >>   int	_EXFUN(pthread_attr_setguardsize,
>>> >>   	(pthread_attr_t *__attr, size_t __guardsize));
>>> >>
>>> >>+#if defined(__USE_GNU) && defined(__rtems__)
>> >
>> >I would rather use
>> >
>> >#ifdef _GNU_SOURCE
> This is translated to "__USE_GNU" in <sys/cdefs.h> in the
> new version and the guard on specific code blocks is
> "__USE_GNU". I think this is what you and Corinna suggested.
>
>>From new cdefs.h
>
> +#ifdef  _GNU_SOURCE
> +# define __USE_GNU      1
> +#endif
>
>

I don't see a patch for cdefs.h and this is not in the latest cdefs.h.  In case 
you would like to use cdefs.h, then I would rather use

#ifdef _GNU_SOURCE
#define __GNU_VISIBLE 1
#endif

to be in line with the other FreeBSD names, e.g.

__XSI_VISIBLE
__BSD_VISIBLE
__ISO_C_VISIBLE

The current cdefs.h has the problem that it includes <stdint.h>.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the Newlib mailing list