summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/include/rtems/libcsupport.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-09 18:27:26 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-09 18:27:26 +0000
commitc3db01d0f37921ba809825e9c6b7fbe86b8fae5d (patch)
tree0f7adb0ea85567c63adf99d5cf0e67b7598aa61b /cpukit/libcsupport/include/rtems/libcsupport.h
parent2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-c3db01d0f37921ba809825e9c6b7fbe86b8fae5d.tar.bz2
2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/include/rtems/libcsupport.h, libcsupport/src/newlibc.c, sapi/Makefile.am, sapi/include/confdefs.h, sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, score/include/rtems/score/userext.h, score/src/chain.c, score/src/userext.c: Switch to newlib reentrancy extension being installed in the initial set instead of using rtems_extension_create. While implementing this, noticed that user extensions and chain code had multiple functions in a single file which is not desirable in the SuperCore and API portions of RTEMS, so split these into multiple files with one function per file. Also noticed that some of user extension code was inlined for no particular reason so moved that to C bodies. Split executive shutdown from initialization since not every application shuts down. Moved __fini call to executive shutdown to be more symmetrical with where it is called at startup. * sapi/src/exshutdown.c, score/src/chainappend.c, score/src/chainextract.c, score/src/chainget.c, score/src/chaininsert.c, score/src/userextaddapiset.c, score/src/userextaddset.c, score/src/userextremoveset.c, score/src/userextthreadbegin.c, score/src/userextthreadcreate.c, score/src/userextthreaddelete.c, score/src/userextthreadrestart.c, score/src/userextthreadstart.c, score/src/userextthreadswitch.c: New files. * score/inline/rtems/score/userext.inl: Removed.
Diffstat (limited to 'cpukit/libcsupport/include/rtems/libcsupport.h')
-rw-r--r--cpukit/libcsupport/include/rtems/libcsupport.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/cpukit/libcsupport/include/rtems/libcsupport.h b/cpukit/libcsupport/include/rtems/libcsupport.h
index bdd13c5136..817e9d8a5b 100644
--- a/cpukit/libcsupport/include/rtems/libcsupport.h
+++ b/cpukit/libcsupport/include/rtems/libcsupport.h
@@ -39,6 +39,38 @@ extern int host_errno(void);
extern void fix_syscall_errno(void);
extern size_t malloc_free_space();
+/*
+ * Prototypes required to install newlib reentrancy user extension
+ */
+rtems_boolean libc_create_hook(
+ rtems_tcb *current_task,
+ rtems_tcb *creating_task
+);
+
+#if defined(RTEMS_UNIX) && !defined(hpux)
+ rtems_extension libc_begin_hook(rtems_tcb *current_task);
+ #define __RTEMS_NEWLIB_BEGIN libc_begin_hook
+#else
+ #define __RTEMS_NEWLIB_BEGIN 0
+#endif
+
+rtems_extension libc_delete_hook(
+ rtems_tcb *current_task,
+ rtems_tcb *deleted_task
+);
+
+#define RTEMS_NEWLIB_EXTENSION \
+{ \
+ libc_create_hook, /* rtems_task_create */ \
+ 0, /* rtems_task_start */ \
+ 0, /* rtems_task_restart */ \
+ libc_delete_hook, /* rtems_task_delete */ \
+ 0, /* task_switch */ \
+ __RTEMS_NEWLIB_BEGIN, /* task_begin */ \
+ 0, /* task_exitted */ \
+ 0 /* fatal */ \
+}
+
#ifdef __cplusplus
}
#endif