From 4b9ddca40c842fc09ebf164c795b77613d9377a8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 Aug 2010 07:59:38 +0000 Subject: 2010-08-23 Sebastian Huber PR 1671/cpukit * libcsupport/include/rtems/gxx_wrappers.h: New file. * libcsupport/Makefile.am, libcsupport/preinstall.am: Reflect change above. * libcsupport/src/gxx_wrappers.c: Include . Use _Internal_error_Occurred() instead of rtems_panic(). * score/include/rtems/score/interr.h: Added INTERNAL_ERROR_GXX_KEY_ADD_FAILED and INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED. --- cpukit/libcsupport/src/gxx_wrappers.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'cpukit/libcsupport/src/gxx_wrappers.c') diff --git a/cpukit/libcsupport/src/gxx_wrappers.c b/cpukit/libcsupport/src/gxx_wrappers.c index 924b506831..9bd33e29e2 100644 --- a/cpukit/libcsupport/src/gxx_wrappers.c +++ b/cpukit/libcsupport/src/gxx_wrappers.c @@ -25,32 +25,15 @@ #include "config.h" #endif +#include + #include -#include #include -#include -#include -#include /* uncomment this if you need to debug this interface */ /*#define DEBUG_GXX_WRAPPERS 1*/ -/* - * These typedefs should match with the ones defined in the file - * gcc/gthr-rtems.h in the gcc distribution. - * FIXME: T.S, 2007/01/31: -> gcc/gthr-rtems.h still declares - * void * __gthread_key_t; - */ -typedef struct __gthread_key_ { - void *val; /* this is switched with the task */ - void (*dtor)(void*); /* this remains in place for all tasks */ -} __gthread_key, *__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)) { #ifdef DEBUG_GXX_WRAPPERS @@ -145,7 +128,11 @@ void *rtems_gxx_getspecific(__gthread_key_t key) */ status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor ); if ( status != RTEMS_SUCCESSFUL ) { - rtems_panic ("rtems_gxx_getspecific"); + _Internal_error_Occurred( + INTERNAL_ERROR_CORE, + true, + INTERNAL_ERROR_GXX_KEY_ADD_FAILED + ); } key->val = (void *)0; } @@ -212,7 +199,11 @@ void rtems_gxx_mutex_init (__gthread_mutex_t *mutex) status ); #endif - rtems_panic ("rtems_gxx_mutex_init"); + _Internal_error_Occurred( + INTERNAL_ERROR_CORE, + true, + INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED + ); } #ifdef DEBUG_GXX_WRAPPERS printk( "gxx_wrappers: mutex init complete =%X\n", *mutex ); -- cgit v1.2.3