From 2145e0c7bf31c681a745eeee57f4e889d7587ecc Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 26 Jan 2022 11:01:44 +0100 Subject: Remove obsolete rtems_gxx_*() implementation GCC versions prior to 6.1 used a RTEMS thread model based on rtems_gxx_*() functions. GCC version 6.1 or later uses the self-contained synchronization objects of Newlib for the RTEMS thread model. Remove the obsolete implementation. Close #3143. --- testsuites/libtests/gxx01/gxx01.doc | 33 ------ testsuites/libtests/gxx01/gxx01.scn | 35 ------ testsuites/libtests/gxx01/init.c | 228 ------------------------------------ 3 files changed, 296 deletions(-) delete mode 100644 testsuites/libtests/gxx01/gxx01.doc delete mode 100644 testsuites/libtests/gxx01/gxx01.scn delete mode 100644 testsuites/libtests/gxx01/init.c (limited to 'testsuites/libtests') diff --git a/testsuites/libtests/gxx01/gxx01.doc b/testsuites/libtests/gxx01/gxx01.doc deleted file mode 100644 index 568e26f49a..0000000000 --- a/testsuites/libtests/gxx01/gxx01.doc +++ /dev/null @@ -1,33 +0,0 @@ -# COPYRIGHT (c) 1989-2010. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.rtems.org/license/LICENSE. -# - -This file describes the directives and concepts tested by this test set. - -test set name: gxx01 - -directives: - - rtems_gxx_once - rtems_gxx_key_create - rtems_gxx_key_delete - rtems_gxx_getspecific - rtems_gxx_setspecific - rtems_gxx_mutex_init - rtems_gxx_mutex_lock - rtems_gxx_mutex_destroy - rtems_gxx_mutex_trylock - rtems_gxx_mutex_unlock - rtems_gxx_recursive_mutex_init - rtems_gxx_recursive_mutex_lock - rtems_gxx_recursive_mutex_trylock - rtems_gxx_recursive_mutex_unlock - -concepts: - -+ Fully exercise wrappers provided by RTEMS for GCC's C++ library's - mutual exclusion implementation. diff --git a/testsuites/libtests/gxx01/gxx01.scn b/testsuites/libtests/gxx01/gxx01.scn deleted file mode 100644 index f831881fa3..0000000000 --- a/testsuites/libtests/gxx01/gxx01.scn +++ /dev/null @@ -1,35 +0,0 @@ -*** TEST GXX 01 *** -rtems_gxx_mutex_init() - OK -rtems_gxx_mutex_trylock() - OK -rtems_gxx_mutex_unlock() - OK -rtems_gxx_mutex_lock() - OK -rtems_gxx_mutex_unlock() - OK - -rtems_gxx_recursive_mutex_init() - OK -rtems_gxx_recursive_mutex_trylock() - OK -rtems_gxx_recursive_mutex_trylock() - Nest -rtems_gxx_recursive_mutex_unlock() - Unnest -rtems_gxx_recursive_mutex_unlock() - OK -rtems_gxx_recursive_mutex_lock() - OK -rtems_gxx_recursive_mutex_unlock() - OK -rtems_gxx_mutex_destroy(mutex) - OK -rtems_gxx_mutex_destroy(mutex) - NOT OK - -Call once method the first time -Running once method -Call once method the second time - -rtems_gxx_key_create(&key, NULL) - OK -rtems_gxx_key_delete(key) - OK -rtems_gxx_key_create(&key, key_dtor) - OK -rtems_gxx_getspecific(key) not set - OK -rtems_gxx_setspecific(key, 0x1234) - OK -rtems_gxx_getspecific(key) already existing - OK -rtems_gxx_key_delete(key) - OK -rtems_gxx_getspecific(key) non-existent - OK -rtems_gxx_key_delete(key) - NOT OK -rtems_gxx_setspecific(NULL, 0x1234) - NOT OK -rtems_gxx_getspecific(NULL) - OK -rtems_gxx_key_delete(NULL) - NOT OK - -*** END OF TEST GXX 01 *** diff --git a/testsuites/libtests/gxx01/init.c b/testsuites/libtests/gxx01/init.c deleted file mode 100644 index 306e4f1f0b..0000000000 --- a/testsuites/libtests/gxx01/init.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * COPYRIGHT (c) 1989-2012. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include "test_support.h" -#include - -const char rtems_test_name[] = "GXX 1"; - -/* forward declarations to avoid warnings */ -rtems_task Init(rtems_task_argument argument); -void test_recursive_mutex(void); -void test_mutex(void); -void once_function(void); -void test_once(void); -void key_dtor(void *ptr); -void test_key(void); - -void test_recursive_mutex(void) -{ - int sc; - __gthread_mutex_t mutex; - - mutex = 0; - puts( "rtems_gxx_recursive_mutex_init() - OK" ); - rtems_gxx_recursive_mutex_init(&mutex); - rtems_test_assert( mutex != 0 ); - - puts( "rtems_gxx_recursive_mutex_trylock() - OK" ); - sc = rtems_gxx_recursive_mutex_trylock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_trylock() - Nest" ); - sc = rtems_gxx_recursive_mutex_trylock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_unlock() - Unnest" ); - sc = rtems_gxx_recursive_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_unlock() - OK" ); - sc = rtems_gxx_recursive_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_lock() - OK" ); - sc = rtems_gxx_recursive_mutex_lock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_unlock() - OK" ); - sc = rtems_gxx_recursive_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_destroy(mutex) - OK" ); - sc = rtems_gxx_mutex_destroy(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_destroy(mutex) - NOT OK" ); - sc = rtems_gxx_mutex_destroy(&mutex); - rtems_test_assert( sc == -1 ); -} - -void test_mutex(void) -{ - int sc; - __gthread_mutex_t mutex; - - mutex = 0; - puts( "rtems_gxx_mutex_init() - OK" ); - rtems_gxx_mutex_init(&mutex); - rtems_test_assert( mutex != 0 ); - - puts( "rtems_gxx_mutex_trylock() - OK" ); - sc = rtems_gxx_mutex_trylock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_unlock() - OK" ); - sc = rtems_gxx_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_lock() - OK" ); - sc = rtems_gxx_mutex_lock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_unlock() - OK" ); - sc = rtems_gxx_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); -} - -void once_function(void) -{ - puts( "Running once method" ); -} - -void test_once(void) -{ - __gthread_once_t once; - int sc; - - once = 0; - - puts( "Call once method the first time" ); - sc = rtems_gxx_once(&once, once_function); - rtems_test_assert( sc == 0 ); - - puts( "Call once method the second time" ); - sc = rtems_gxx_once(&once, once_function); - rtems_test_assert( sc == 0 ); -} - -volatile bool key_dtor_ran; - -void key_dtor(void *ptr) -{ - key_dtor_ran = true; -} - -void test_key(void) -{ - int sc; - __gthread_key_t key; - void *p; - - puts( "rtems_gxx_key_create(&key, NULL) - OK" ); - sc = rtems_gxx_key_create(&key, NULL); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_key_delete(key) - OK" ); - sc = rtems_gxx_key_delete(key); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_key_create(&key, key_dtor) - OK" ); - sc = rtems_gxx_key_create(&key, key_dtor); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_getspecific(key) not set - OK" ); - p = rtems_gxx_getspecific(key); - rtems_test_assert( p == NULL ); - - puts( "rtems_gxx_setspecific(key, 0x1234) - OK" ); - sc = rtems_gxx_setspecific(key, (void *)0x1234); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_getspecific(key) already existing - OK" ); - p = rtems_gxx_getspecific(key); - rtems_test_assert( p == (void *)0x1234 ); - - puts( "rtems_gxx_key_delete(key) - OK" ); - sc = rtems_gxx_key_delete(key); - rtems_test_assert( sc == 0 ); - /* pthread_key man-page: the dtor should _not_ be called */ - rtems_test_assert( key_dtor_ran != true ); - - key = calloc( 1, sizeof( *key ) ); - rtems_test_assert( key != NULL ); - - puts( "rtems_gxx_getspecific(key) non-existent - OK" ); - p = rtems_gxx_getspecific( key ); - rtems_test_assert( p == NULL ); - - puts( "rtems_gxx_key_delete(key) - NOT OK" ); - sc = rtems_gxx_key_delete( key ); - rtems_test_assert( sc != 0 ); - - puts( "rtems_gxx_setspecific(NULL, 0x1234) - NOT OK" ); - sc = rtems_gxx_setspecific( NULL, (void *)0x1234 ); - rtems_test_assert( sc == EINVAL ); - - puts( "rtems_gxx_getspecific(NULL) - OK" ); - p = rtems_gxx_getspecific( NULL ); - rtems_test_assert( p == NULL ); - - puts( "rtems_gxx_key_delete(NULL) - NOT OK" ); - sc = rtems_gxx_key_delete( NULL ); - rtems_test_assert( sc == EINVAL ); -} - -rtems_task Init( - rtems_task_argument argument -) -{ - TEST_BEGIN(); - - test_mutex(); - puts( "" ); - - test_recursive_mutex(); - puts( "" ); - - test_once(); - puts( "" ); - - test_key(); - puts( "" ); - - TEST_END(); - - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_KEYS 1 -#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1 - -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 2 -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include -/* end of file */ -- cgit v1.2.3