#2171 new enhancement

new function for declaring a POSIX thread to be floating point or not via attribute

Reported by: steve.helmer Owned by: Joel Sherrill
Priority: low Milestone: Indefinite
Component: score Version:
Severity: minor Keywords:
Cc: sebastian.huber@… Blocked By:
Blocking:

Description (last modified by Sebastian Huber)

For those processors which have a builtin floating point unit there needs to be a way to specify whether or not posix threads (created with pthread_create) need to to save/restore the floating point context during a context switch. This is already the case for RTEMS tasks. I am submitting a patch for both rtems-4.10.2 and newlib-1.19.0 to accommodate a new field is_fp to the pthread_attr_t structure declared in newlib-1.19.0/newlib/libc/include/sys/types.h, declarations for 2 new functions in newlib-1.19.0/newlib/libc/include/pthread.h.

And the functions themselves to be added to rtems-4.10.2/cpukit/posix/src.

Attachments (4)

types.h (13.4 KB) - added by steve.helmer on Feb 14, 2014 at 2:55:58 PM.
sys/types.h header for newlib
pthread.h (12.2 KB) - added by steve.helmer on Feb 14, 2014 at 2:57:48 PM.
pthread.h for newlib
pthreadattrsetis_fp.c (716 bytes) - added by steve.helmer on Feb 14, 2014 at 2:59:01 PM.
new function pthread_attr_getis_fp
pthreadattrsetis_fp_v1.c (716 bytes) - added by steve.helmer on Feb 14, 2014 at 2:59:52 PM.
new function pthread_attr_setis_fp

Download all attachments as: .zip

Change History (8)

Changed on Feb 14, 2014 at 2:55:58 PM by steve.helmer

Attachment: types.h added

sys/types.h header for newlib

Changed on Feb 14, 2014 at 2:57:48 PM by steve.helmer

Attachment: pthread.h added

pthread.h for newlib

Changed on Feb 14, 2014 at 2:59:01 PM by steve.helmer

Attachment: pthreadattrsetis_fp.c added

new function pthread_attr_getis_fp

Changed on Feb 14, 2014 at 2:59:52 PM by steve.helmer

Attachment: pthreadattrsetis_fp_v1.c added

new function pthread_attr_setis_fp

comment:1 Changed on Feb 14, 2014 at 3:04:28 PM by Sebastian Huber

Cc: Sebastian Huber added

comment:2 Changed on Feb 14, 2014 at 3:48:53 PM by Joel Sherrill

This is not defined in any standard. Community would have to agree to add it, review of other OSes for similar pthread APIs, and they must end in _np.

I am not opposed to the functionality, just have to be careful when extending pthreads.

comment:3 Changed on Dec 18, 2014 at 12:34:35 PM by Sebastian Huber

Description: modified (diff)
Milestone: 4.115.0
Priority: normallow

comment:4 Changed on Aug 14, 2017 at 12:50:04 AM by Chris Johns

Milestone: 5.0Indefinite
Version: 4.10
Note: See TracTickets for help on using tickets.