summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/shared
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-15 22:09:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-15 22:09:17 +0000
commitc0daf8072fcb762447bb6018b047ad299b00ebd6 (patch)
treec36ff3afa25a8b275f7cfc9f3d2591d0929a7467 /c/src/lib/libbsp/shared
parentNumerous changes which in total greatly reduced the amount of source (diff)
downloadrtems-c0daf8072fcb762447bb6018b047ad299b00ebd6.tar.bz2
New file created by extracting common initialization from every BSP's
bspstart.c file.
Diffstat (limited to 'c/src/lib/libbsp/shared')
-rw-r--r--c/src/lib/libbsp/shared/bsplibc.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/shared/bsplibc.c b/c/src/lib/libbsp/shared/bsplibc.c
new file mode 100644
index 0000000000..13f1f06f15
--- /dev/null
+++ b/c/src/lib/libbsp/shared/bsplibc.c
@@ -0,0 +1,38 @@
+/*
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <libcsupport.h>
+
+extern rtems_configuration_table BSP_Configuration;
+
+void bsp_libc_init(
+ void *heap_start,
+ unsigned32 heap_size,
+ int use_sbrk
+)
+{
+ RTEMS_Malloc_Initialize( heap_start, heap_size, use_sbrk);
+
+ /*
+ * Init the RTEMS libio facility to provide UNIX-like system
+ * calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
+ * Uses malloc() to get area for the iops, so must be after malloc init
+ */
+
+ rtems_libio_init();
+
+ /*
+ * Set up for the libc handling.
+ */
+
+ if (BSP_Configuration.ticks_per_timeslice > 0)
+ libc_init(1); /* reentrant if possible */
+ else
+ libc_init(0); /* non-reentrant */
+}