From 4f9ed26655c2659fcf697a281cb401aa919849bf Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 10 Oct 2017 07:13:37 +0200 Subject: posix: Constify default thread processor affinity Set default thread processor affinity to all processors of the pre-allocated set. This allows to constify the _POSIX_Threads_Default_attributes. Update #2514. --- testsuites/psxtests/psxgetattrnp01/init.c | 7 +++++++ testsuites/psxtests/psxgetattrnp01/psxgetattrnp01.scn | 1 + 2 files changed, 8 insertions(+) (limited to 'testsuites') diff --git a/testsuites/psxtests/psxgetattrnp01/init.c b/testsuites/psxtests/psxgetattrnp01/init.c index 2b7d699abd..afde4a210e 100644 --- a/testsuites/psxtests/psxgetattrnp01/init.c +++ b/testsuites/psxtests/psxgetattrnp01/init.c @@ -190,6 +190,7 @@ void *POSIX_Init( size_t stacksize; size_t guardsize; struct sched_param param; + cpu_set_t set; TEST_BEGIN(); @@ -211,6 +212,12 @@ void *POSIX_Init( sc = pthread_attr_init(&Thread_attr); rtems_test_assert(!sc); + puts("Init - pthread_attr_setaffinity_np"); + CPU_ZERO( &set ); + CPU_SET( 0, &set ); + sc = pthread_attr_setaffinity_np( &Thread_attr, sizeof( set ), &set ); + rtems_test_assert(!sc); + puts("Init - pthread_attr_setinheritsched - PTHREAD_EXPLICIT_SCHED"); sc = pthread_attr_setinheritsched( &Thread_attr, PTHREAD_EXPLICIT_SCHED ); rtems_test_assert(!sc); diff --git a/testsuites/psxtests/psxgetattrnp01/psxgetattrnp01.scn b/testsuites/psxtests/psxgetattrnp01/psxgetattrnp01.scn index ab09630f75..0ca49a5e81 100644 --- a/testsuites/psxtests/psxgetattrnp01/psxgetattrnp01.scn +++ b/testsuites/psxtests/psxgetattrnp01/psxgetattrnp01.scn @@ -2,6 +2,7 @@ Init - pthread_getattr_np - attr NULL - EINVAL Init - pthread_getattr_np - invalid id - ESRCH Init - pthread_attr_init +Init - pthread_attr_setaffinity_np Init - pthread_attr_setinheritsched - PTHREAD_EXPLICIT_SCHED Init - pthread_attr_setschedpolicy to SCHED_RR Init - pthread_attr_setschedparam to minimum priority + 2 -- cgit v1.2.3