[PATCH] Remove obsolete rtems_gxx_*() implementation
Joel Sherrill
joel at rtems.org
Wed Jan 26 18:43:32 UTC 2022
Looks ok to me especially since it doesn't appear to add anything. :)
--joel
On Wed, Jan 26, 2022 at 4:05 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> 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 <sys/lock.h> for the
> RTEMS thread model.
>
> Remove the obsolete implementation.
>
> Close #3143.
> ---
> cpukit/include/rtems/gxx_wrappers.h | 80 ------
> cpukit/include/rtems/score/interr.h | 4 +-
> cpukit/libcsupport/src/gxx_wrappers.c | 261 --------------------
> spec/build/testsuites/libtests/grp.yml | 2 -
> spec/build/testsuites/libtests/gxx01.yml | 19 --
> spec/build/testsuites/sptests/grp.yml | 4 -
> spec/build/testsuites/sptests/spfatal24.yml | 19 --
> spec/build/testsuites/sptests/spfatal25.yml | 19 --
> testsuites/libtests/gxx01/gxx01.doc | 33 ---
> testsuites/libtests/gxx01/gxx01.scn | 35 ---
> testsuites/libtests/gxx01/init.c | 228 -----------------
> testsuites/sptests/spfatal24/init.c | 31 ---
> testsuites/sptests/spfatal24/spfatal24.doc | 19 --
> testsuites/sptests/spfatal24/spfatal24.scn | 3 -
> testsuites/sptests/spfatal25/init.c | 33 ---
> testsuites/sptests/spfatal25/spfatal25.doc | 19 --
> testsuites/sptests/spfatal25/spfatal25.scn | 3 -
> 17 files changed, 2 insertions(+), 810 deletions(-)
> delete mode 100644 cpukit/include/rtems/gxx_wrappers.h
> delete mode 100644 cpukit/libcsupport/src/gxx_wrappers.c
> delete mode 100644 spec/build/testsuites/libtests/gxx01.yml
> delete mode 100644 spec/build/testsuites/sptests/spfatal24.yml
> delete mode 100644 spec/build/testsuites/sptests/spfatal25.yml
> delete mode 100644 testsuites/libtests/gxx01/gxx01.doc
> delete mode 100644 testsuites/libtests/gxx01/gxx01.scn
> delete mode 100644 testsuites/libtests/gxx01/init.c
> delete mode 100644 testsuites/sptests/spfatal24/init.c
> delete mode 100644 testsuites/sptests/spfatal24/spfatal24.doc
> delete mode 100644 testsuites/sptests/spfatal24/spfatal24.scn
> delete mode 100644 testsuites/sptests/spfatal25/init.c
> delete mode 100644 testsuites/sptests/spfatal25/spfatal25.doc
> delete mode 100644 testsuites/sptests/spfatal25/spfatal25.scn
>
> diff --git a/cpukit/include/rtems/gxx_wrappers.h b/cpukit/include/rtems/gxx_wrappers.h
> deleted file mode 100644
> index e462d27d66..0000000000
> --- a/cpukit/include/rtems/gxx_wrappers.h
> +++ /dev/null
> @@ -1,80 +0,0 @@
> -/**
> - * @file
> - *
> - * RTEMS threads compatibility routines for libgcc2.
> - */
> -
> -/*
> - * by: Rosimildo da Silva (rdasilva at connecttel.com)
> - *
> - * Used ideas from:
> - * W. Eric Norum
> - * Canadian Light Source
> - * University of Saskatchewan
> - * Saskatoon, Saskatchewan, CANADA
> - * eric at cls.usask.ca
> - *
> - * Eric sent some e-mail in the rtems-list as a start point for this
> - * module implementation.
> - */
> -
> -#ifndef __GCC_WRAPPERS_h
> -#define __GCC_WRAPPERS_h
> -
> -#ifdef __cplusplus
> -extern "C" {
> -#endif /* __cplusplus */
> -
> -/**
> - * @defgroup GxxWrappersSupport Gxx Wrappers Support
> - *
> - * @ingroup libcsupport
> - *
> - * @brief RTEMS Threads Compatibility Routines for Libgcc2
> - */
> -
> -/*
> - * These typedefs should match with the ones defined in the file
> - * gcc/gthr-rtems.h in the gcc distribution.
> - */
> -typedef void *__gthread_key_t;
> -typedef int __gthread_once_t;
> -typedef void *__gthread_mutex_t;
> -typedef void *__gthread_recursive_mutex_t;
> -
> -int rtems_gxx_once(__gthread_once_t *once, void (*func) (void));
> -
> -int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *));
> -
> -int rtems_gxx_key_delete (__gthread_key_t key);
> -
> -void *rtems_gxx_getspecific(__gthread_key_t key);
> -
> -int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr);
> -
> -/*
> - * MUTEX support
> - */
> -void rtems_gxx_mutex_init (__gthread_mutex_t *mutex);
> -
> -int rtems_gxx_mutex_lock (__gthread_mutex_t *mutex);
> -
> -int rtems_gxx_mutex_destroy (__gthread_mutex_t *mutex);
> -
> -int rtems_gxx_mutex_trylock (__gthread_mutex_t *mutex);
> -
> -int rtems_gxx_mutex_unlock (__gthread_mutex_t *mutex);
> -
> -void rtems_gxx_recursive_mutex_init(__gthread_recursive_mutex_t *mutex);
> -
> -int rtems_gxx_recursive_mutex_lock(__gthread_recursive_mutex_t *mutex);
> -
> -int rtems_gxx_recursive_mutex_trylock(__gthread_recursive_mutex_t *mutex);
> -
> -int rtems_gxx_recursive_mutex_unlock(__gthread_recursive_mutex_t *mutex);
> -
> -#ifdef __cplusplus
> -}
> -#endif /* __cplusplus */
> -
> -#endif /* __GCC_WRAPPERS_h */
> diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h
> index 65cac29500..4054e21253 100644
> --- a/cpukit/include/rtems/score/interr.h
> +++ b/cpukit/include/rtems/score/interr.h
> @@ -188,8 +188,8 @@ typedef enum {
> /* INTERNAL_ERROR_THREAD_QUEUE_ENQUEUE_FROM_BAD_STATE = 18, */
> /* INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0 = 19, */
> /* INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP = 20, */
> - INTERNAL_ERROR_GXX_KEY_ADD_FAILED = 21,
> - INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED = 22,
> + /* INTERNAL_ERROR_GXX_KEY_ADD_FAILED = 21, */
> + /* INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED = 22, */
> INTERNAL_ERROR_NO_MEMORY_FOR_HEAP = 23,
> INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR = 24,
> INTERNAL_ERROR_RESOURCE_IN_USE = 25,
> diff --git a/cpukit/libcsupport/src/gxx_wrappers.c b/cpukit/libcsupport/src/gxx_wrappers.c
> deleted file mode 100644
> index b81d82d454..0000000000
> --- a/cpukit/libcsupport/src/gxx_wrappers.c
> +++ /dev/null
> @@ -1,261 +0,0 @@
> -/**
> - * @file
> - *
> - * @brief RTEMS Threads Compatibility Routines for Libgcc2
> - * @ingroup GxxWrappersSupport
> - */
> -
> -/*
> - * by: Rosimildo da Silva (rdasilva at connecttel.com)
> - *
> - * Used ideas from:
> - * W. Eric Norum
> - * Canadian Light Source
> - * University of Saskatchewan
> - * Saskatoon, Saskatchewan, CANADA
> - * eric at cls.usask.ca
> - *
> - * Eric sent some e-mail in the rtems-list as a start point for this
> - * module implementation.
> - */
> -
> -/*
> - * This file is only used if using gcc
> - */
> -#if defined(__GNUC__)
> -
> -#ifdef HAVE_CONFIG_H
> -#include "config.h"
> -#endif
> -
> -#include <rtems/gxx_wrappers.h>
> -#include <rtems/score/onceimpl.h>
> -
> -#include <errno.h>
> -#include <stdlib.h>
> -#include <pthread.h>
> -
> -#include <rtems.h>
> -
> -/* uncomment this if you need to debug this interface */
> -/*#define DEBUG_GXX_WRAPPERS 1*/
> -
> -int rtems_gxx_once(__gthread_once_t *once, void (*func) (void))
> -{
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk( "gxx_wrappers: once=%x, func=%x\n", *once, func );
> - #endif
> -
> - return _Once( (unsigned char *) once, func );
> -}
> -
> -int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
> -{
> - int eno;
> - pthread_key_t *pkey;
> -
> - pkey = malloc( sizeof( *pkey ) );
> - *key = pkey;
> - if ( pkey == NULL )
> - {
> - return ENOMEM;
> - }
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk(
> - "gxx_wrappers: create key=%x, dtor=%x, pkey=%x\n", key, dtor, pkey
> - );
> - #endif
> -
> - eno = pthread_key_create(pkey, dtor);
> - if ( eno != 0 ) {
> - free( pkey );
> - *key = NULL;
> - }
> -
> - return eno;
> -}
> -
> -int rtems_gxx_key_delete (__gthread_key_t key)
> -{
> - int eno = 0;
> - pthread_key_t *pkey = key;
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk( "gxx_wrappers: delete key=%x\n", pkey );
> - #endif
> -
> - if ( pkey == NULL ) {
> - return EINVAL;
> - }
> -
> - eno = pthread_key_delete(*pkey);
> - if ( eno == 0 ) {
> - free( pkey );
> - }
> - return eno;
> -}
> -
> -void *rtems_gxx_getspecific(__gthread_key_t key)
> -{
> - pthread_key_t *pkey = key;
> - void *p = NULL;
> -
> - if ( pkey != NULL ) {
> - p = pthread_getspecific( *pkey );
> - }
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk(
> - "gxx_wrappers: getspecific key=%x, ptr=%x, id=%x\n",
> - pkey,
> - p,
> - rtems_task_self()
> - );
> - #endif
> - return p;
> -}
> -
> -int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr)
> -{
> - pthread_key_t *pkey = key;
> - int eno;
> -
> - if ( pkey == NULL ) {
> - return EINVAL;
> - }
> -
> - eno = pthread_setspecific( *pkey, ptr );
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk(
> - "gxx_wrappers: setspecific key=%x, ptr=%x, id=%x\n",
> - pkey,
> - ptr,
> - rtems_task_self()
> - );
> - #endif
> -
> - if ( eno != 0 ) {
> - _Internal_error( INTERNAL_ERROR_GXX_KEY_ADD_FAILED );
> - }
> -
> - return 0;
> -}
> -
> -
> -/*
> - * MUTEX support
> - */
> -void rtems_gxx_mutex_init (__gthread_mutex_t *mutex)
> -{
> - rtems_status_code status;
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk( "gxx_wrappers: mutex init =%X\n", *mutex );
> - #endif
> -
> - status = rtems_semaphore_create(
> - rtems_build_name ('G', 'C', 'C', '2'),
> - 1,
> - RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|
> - RTEMS_INHERIT_PRIORITY|RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
> - 0,
> - (rtems_id *)mutex
> - );
> - if ( status != RTEMS_SUCCESSFUL ) {
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk(
> - "gxx_wrappers: mutex init failed %s (%d)\n",
> - rtems_status_text(status),
> - status
> - );
> - #endif
> - _Internal_error( INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED );
> - }
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk( "gxx_wrappers: mutex init complete =%X\n", *mutex );
> - #endif
> -}
> -
> -int rtems_gxx_mutex_lock (__gthread_mutex_t *mutex)
> -{
> - rtems_status_code status;
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk( "gxx_wrappers: lock mutex=%X\n", *mutex );
> - #endif
> -
> - status = rtems_semaphore_obtain(
> - *(rtems_id *)mutex,
> - RTEMS_WAIT,
> - RTEMS_NO_TIMEOUT
> - );
> - if ( status == RTEMS_SUCCESSFUL )
> - return 0;
> - return -1;
> -}
> -
> -int rtems_gxx_mutex_destroy (__gthread_mutex_t *mutex)
> -{
> - rtems_status_code status;
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk( "gxx_wrappers: destroy mutex=%X\n", *mutex );
> - #endif
> -
> - status = rtems_semaphore_delete(*(rtems_id *)mutex);
> - if ( status == RTEMS_SUCCESSFUL )
> - return 0;
> - return -1;
> -}
> -
> -int rtems_gxx_mutex_trylock (__gthread_mutex_t *mutex)
> -{
> - rtems_status_code status;
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk( "gxx_wrappers: trylock mutex=%X\n", *mutex );
> - #endif
> -
> - status = rtems_semaphore_obtain (*(rtems_id *)mutex, RTEMS_NO_WAIT, 0);
> - if ( status == RTEMS_SUCCESSFUL )
> - return 0;
> - return -1;
> -}
> -
> -int rtems_gxx_mutex_unlock (__gthread_mutex_t *mutex)
> -{
> - rtems_status_code status;
> -
> - #ifdef DEBUG_GXX_WRAPPERS
> - printk( "gxx_wrappers: unlock mutex=%X\n", *mutex );
> - #endif
> -
> - status = rtems_semaphore_release( *(rtems_id *)mutex );
> - if ( status == RTEMS_SUCCESSFUL )
> - return 0;
> - return -1;
> -}
> -
> -void rtems_gxx_recursive_mutex_init(__gthread_recursive_mutex_t *mutex)
> -{
> - rtems_gxx_mutex_init(mutex);
> -}
> -
> -int rtems_gxx_recursive_mutex_lock(__gthread_recursive_mutex_t *mutex)
> -{
> - return rtems_gxx_mutex_lock(mutex);
> -}
> -
> -int rtems_gxx_recursive_mutex_trylock(__gthread_recursive_mutex_t *mutex)
> -{
> - return rtems_gxx_mutex_trylock(mutex);
> -}
> -
> -int rtems_gxx_recursive_mutex_unlock(__gthread_recursive_mutex_t *mutex)
> -{
> - return rtems_gxx_mutex_unlock(mutex);
> -}
> -
> -#endif /* __GNUC__ */
> diff --git a/spec/build/testsuites/libtests/grp.yml b/spec/build/testsuites/libtests/grp.yml
> index cd5cc210e2..fdb9e4fede 100644
> --- a/spec/build/testsuites/libtests/grp.yml
> +++ b/spec/build/testsuites/libtests/grp.yml
> @@ -141,8 +141,6 @@ links:
> uid: gettimeofday
> - role: build-dependency
> uid: getuid
> -- role: build-dependency
> - uid: gxx01
> - role: build-dependency
> uid: heapwalk
> - role: build-dependency
> diff --git a/spec/build/testsuites/libtests/gxx01.yml b/spec/build/testsuites/libtests/gxx01.yml
> deleted file mode 100644
> index 1027db9b9a..0000000000
> --- a/spec/build/testsuites/libtests/gxx01.yml
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> -build-type: test-program
> -cflags: []
> -copyrights:
> -- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> -cppflags: []
> -cxxflags: []
> -enabled-by: true
> -features: c cprogram
> -includes: []
> -ldflags: []
> -links: []
> -source:
> -- testsuites/libtests/gxx01/init.c
> -stlib: []
> -target: testsuites/libtests/gxx01.exe
> -type: build
> -use-after: []
> -use-before: []
> diff --git a/spec/build/testsuites/sptests/grp.yml b/spec/build/testsuites/sptests/grp.yml
> index b2278a60fe..740684a0e4 100644
> --- a/spec/build/testsuites/sptests/grp.yml
> +++ b/spec/build/testsuites/sptests/grp.yml
> @@ -237,10 +237,6 @@ links:
> uid: spfatal14
> - role: build-dependency
> uid: spfatal15
> -- role: build-dependency
> - uid: spfatal24
> -- role: build-dependency
> - uid: spfatal25
> - role: build-dependency
> uid: spfatal26
> - role: build-dependency
> diff --git a/spec/build/testsuites/sptests/spfatal24.yml b/spec/build/testsuites/sptests/spfatal24.yml
> deleted file mode 100644
> index 22eefa9de5..0000000000
> --- a/spec/build/testsuites/sptests/spfatal24.yml
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> -build-type: test-program
> -cflags: []
> -copyrights:
> -- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> -cppflags: []
> -cxxflags: []
> -enabled-by: true
> -features: c cprogram
> -includes: []
> -ldflags: []
> -links: []
> -source:
> -- testsuites/sptests/spfatal24/init.c
> -stlib: []
> -target: testsuites/sptests/spfatal24.exe
> -type: build
> -use-after: []
> -use-before: []
> diff --git a/spec/build/testsuites/sptests/spfatal25.yml b/spec/build/testsuites/sptests/spfatal25.yml
> deleted file mode 100644
> index f80f26abfa..0000000000
> --- a/spec/build/testsuites/sptests/spfatal25.yml
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> -build-type: test-program
> -cflags: []
> -copyrights:
> -- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> -cppflags: []
> -cxxflags: []
> -enabled-by: true
> -features: c cprogram
> -includes: []
> -ldflags: []
> -links: []
> -source:
> -- testsuites/sptests/spfatal25/init.c
> -stlib: []
> -target: testsuites/sptests/spfatal25.exe
> -type: build
> -use-after: []
> -use-before: []
> 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 <errno.h>
> -#include <tmacros.h>
> -#include "test_support.h"
> -#include <rtems/gxx_wrappers.h>
> -
> -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 <rtems/confdefs.h>
> -/* end of file */
> diff --git a/testsuites/sptests/spfatal24/init.c b/testsuites/sptests/spfatal24/init.c
> deleted file mode 100644
> index 6522ef7be2..0000000000
> --- a/testsuites/sptests/spfatal24/init.c
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -#ifdef HAVE_CONFIG_H
> -#include "config.h"
> -#endif
> -
> -#include "../spfatal_support/spfatal.h"
> -
> -/*
> - * 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.
> - */
> -
> -#include <rtems/gxx_wrappers.h>
> -#include <rtems/malloc.h>
> -
> -#define FATAL_ERROR_TEST_NAME "GXX KEY ADD FAILURE"
> -#define FATAL_ERROR_DESCRIPTION "GXX KEY ADD FAILURE"
> -#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
> -#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_GXX_KEY_ADD_FAILED
> -
> -static void force_error(void)
> -{
> - pthread_key_t key = -1;
> -
> - rtems_gxx_setspecific( &key, NULL );
> -}
> -
> -#include "../spfatal_support/spfatalimpl.h"
> diff --git a/testsuites/sptests/spfatal24/spfatal24.doc b/testsuites/sptests/spfatal24/spfatal24.doc
> deleted file mode 100644
> index b697770085..0000000000
> --- a/testsuites/sptests/spfatal24/spfatal24.doc
> +++ /dev/null
> @@ -1,19 +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: spfatal24
> -
> -directives:
> -
> - rtems_gxx_setspecific();
> -
> -concepts:
> -
> -+ Trigger fatal error.
> diff --git a/testsuites/sptests/spfatal24/spfatal24.scn b/testsuites/sptests/spfatal24/spfatal24.scn
> deleted file mode 100644
> index 46a4f20409..0000000000
> --- a/testsuites/sptests/spfatal24/spfatal24.scn
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -*** TEST FATAL GXX KEY ADD FAILURE ***
> -Fatal error (GXX KEY ADD FAILURE) hit
> -*** END OF TEST FATAL GXX KEY ADD FAILURE ***
> diff --git a/testsuites/sptests/spfatal25/init.c b/testsuites/sptests/spfatal25/init.c
> deleted file mode 100644
> index 83042557e5..0000000000
> --- a/testsuites/sptests/spfatal25/init.c
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -#ifdef HAVE_CONFIG_H
> -#include "config.h"
> -#endif
> -
> -#include "../spfatal_support/spfatal.h"
> -
> -/*
> - * 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.
> - */
> -
> -#include <rtems/gxx_wrappers.h>
> -
> -#define FATAL_ERROR_TEST_NAME "GXX MUTEX INIT FAILED"
> -#define FATAL_ERROR_DESCRIPTION "GXX MUTEX INIT FAILED"
> -#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
> -#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED
> -
> -static void force_error(void)
> -{
> - __gthread_mutex_t mutex;
> -
> - while ( true ) {
> - rtems_gxx_mutex_init( &mutex );
> - rtems_test_assert( mutex != 0 );
> - }
> -}
> -
> -#include "../spfatal_support/spfatalimpl.h"
> diff --git a/testsuites/sptests/spfatal25/spfatal25.doc b/testsuites/sptests/spfatal25/spfatal25.doc
> deleted file mode 100644
> index e30241bc8b..0000000000
> --- a/testsuites/sptests/spfatal25/spfatal25.doc
> +++ /dev/null
> @@ -1,19 +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: spfatal24
> -
> -directives:
> -
> - rtems_gxx_getspecific();
> -
> -concepts:
> -
> -+ Trigger fatal error.
> diff --git a/testsuites/sptests/spfatal25/spfatal25.scn b/testsuites/sptests/spfatal25/spfatal25.scn
> deleted file mode 100644
> index 93a6b729b8..0000000000
> --- a/testsuites/sptests/spfatal25/spfatal25.scn
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -*** TEST FATAL GXX MUTEX INIT FAILED ***
> -Fatal error (GXX MUTEX INIT FAILED) hit
> -*** END OF TEST FATAL GXX MUTEX INIT FAILED ***
> --
> 2.31.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
More information about the devel
mailing list