summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/gxx_wrappers.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2010-08-23 07:59:38 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2010-08-23 07:59:38 +0000
commit4b9ddca40c842fc09ebf164c795b77613d9377a8 (patch)
tree789aea46a16061b2f84372c01190ffa501c1bf27 /cpukit/libcsupport/src/gxx_wrappers.c
parent2010-08-23 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-4b9ddca40c842fc09ebf164c795b77613d9377a8.tar.bz2
2010-08-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
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 <rtems/gxx_wrappers.h>. 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.
Diffstat (limited to 'cpukit/libcsupport/src/gxx_wrappers.c')
-rw-r--r--cpukit/libcsupport/src/gxx_wrappers.c33
1 files changed, 12 insertions, 21 deletions
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 <rtems/gxx_wrappers.h>
+
#include <stdlib.h>
-#include <stdio.h>
#include <rtems.h>
-#include <rtems/system.h>
-#include <rtems/error.h>
-#include <rtems/rtems/tasks.h>
/* 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 );