summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/newlibc.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-11-23 19:07:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-11-23 19:07:58 +0000
commit07a3253de2c3f9bc2d96a351680ec72548dadd2d (patch)
treeb4f85e78927202cffe01b194c708c3dd800d8e57 /cpukit/libcsupport/src/newlibc.c
parentAdded new tests in support of the file system infrastructure. (diff)
downloadrtems-07a3253de2c3f9bc2d96a351680ec72548dadd2d.tar.bz2
Added base version of file system infrastructure. This includes a major
overhaul of the RTEMS system call interface. This base file system is the "In-Memory File System" aka IMFS. The design and implementation was done by the following people: + Joel Sherrill (joel@OARcorp.com) + Jennifer Averett (jennifer@OARcorp.com) + Steve "Mr Mount" Salitasc (salitasc@OARcorp.com) + Kerwin Wade (wade@OARcorp.com) PROBLEMS ======== + It is VERY likely that merging this will break the UNIX port. This can/will be fixed. + There is likely some reentrancy/mutual exclusion needed. + Eventually, there should be a "mini-IMFS" description table to eliminate links, symlinks, etc to save memory. All you need to have "classic RTEMS" functionality is technically directories and device IO. All the rest could be left out to save memory.
Diffstat (limited to 'cpukit/libcsupport/src/newlibc.c')
-rw-r--r--cpukit/libcsupport/src/newlibc.c78
1 files changed, 65 insertions, 13 deletions
diff --git a/cpukit/libcsupport/src/newlibc.c b/cpukit/libcsupport/src/newlibc.c
index a6acc1c8d7..bea592a46e 100644
--- a/cpukit/libcsupport/src/newlibc.c
+++ b/cpukit/libcsupport/src/newlibc.c
@@ -1,21 +1,14 @@
-
/*
+ * Implementation of hooks for the CYGNUS newlib libc
+ * These hooks set things up so that:
+ * + '_REENT' is switched at task switch time.
+ *
* COPYRIGHT (c) 1994 by Division Incorporated
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
- * Description:
- * Implementation of hooks for the CYGNUS newlib libc
- * These hooks set things up so that:
- * '_REENT' is switched at task switch time.
- *
- *
- * TODO:
- *
- * NOTE:
- *
* $Id$
*
*/
@@ -47,7 +40,21 @@
#include <stdio.h>
#endif
-#include "internal.h"
+/*
+ * Private routines
+ */
+
+void MY_task_set_note(
+ rtems_tcb *tcb,
+ rtems_unsigned32 notepad,
+ rtems_unsigned32 note
+);
+
+rtems_unsigned32 MY_task_get_note(
+ rtems_tcb *tcb,
+ rtems_unsigned32 notepad
+);
+
#define LIBC_NOTEPAD RTEMS_NOTEPAD_LAST
@@ -304,7 +311,7 @@ libc_init(int reentrant)
rc = rtems_extension_create(rtems_build_name('L', 'I', 'B', 'C'),
&libc_extension, &extension_id);
if (rc != RTEMS_SUCCESSFUL)
- rtems_fatal_error_occurred(rc);
+ rtems_fatal_error_occurred( rc );
libc_reentrant = reentrant;
}
@@ -353,11 +360,14 @@ int get_errno()
/* #if !defined(RTEMS_UNIX) && !defined(__GO32__) && !defined(_AM29K) */
#if !defined(RTEMS_UNIX) && !defined(_AM29K)
+#if !defined(pc386)
void _exit(int status)
{
libc_wrapup(); /* Why? XXX */
rtems_shutdown_executive(status);
}
+#endif
+
#else
void exit(int status)
@@ -426,4 +436,46 @@ unsigned int sleep(
#endif
+/*
+ * Newlib Interface Support
+ *
+ * Routines to Access Internal RTEMS Resources without violating
+ * kernel visibility.
+ *
+ */
+
+void MY_task_set_note(
+ Thread_Control *the_thread,
+ unsigned32 notepad,
+ unsigned32 note
+)
+{
+ RTEMS_API_Control *api;
+
+ api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
+
+ if ( api )
+ api->Notepads[ notepad ] = note;
+}
+
+
+unsigned32 MY_task_get_note(
+ Thread_Control *the_thread,
+ unsigned32 notepad
+)
+{
+ RTEMS_API_Control *api;
+
+ api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
+
+ return api->Notepads[ notepad ];
+}
+
+void *MY_CPU_Context_FP_start(
+ void *base,
+ unsigned32 offset
+)
+{
+ return _CPU_Context_Fp_start( base, offset );
+}
#endif