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]

Re: Patch - Add pthread affinity for RTEMS


On 11/25/2013 1:35 AM, Sebastian Huber wrote:
> 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

Yep. cdefs.h defines all of these and it should be correct
as it came from FreeBSD and is sufficient to compile their
TCP/IP and USB stacks plus user space library support code for RTEMS.

We have the infrastructure to use the BSD style names. Can we
use them?

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

That's a separate issue for another patch.

-- 
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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]