summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-01-25 22:03:00 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-02-03 10:00:57 +0100
commitca4602e914d4ec00bf5db51e0830d702d5bc3f4e (patch)
tree9f67d1d8b61d97a50452d6011647bcac0bf5f3aa /cpukit/libcsupport/src
parentUse atexit() handler to close std file descriptors (diff)
downloadrtems-ca4602e914d4ec00bf5db51e0830d702d5bc3f4e.tar.bz2
Use linker set for libio initialization
Update #2408.
Diffstat (limited to 'cpukit/libcsupport/src')
-rw-r--r--cpukit/libcsupport/src/libio_helper_null.c30
-rw-r--r--cpukit/libcsupport/src/libio_init.c15
2 files changed, 14 insertions, 31 deletions
diff --git a/cpukit/libcsupport/src/libio_helper_null.c b/cpukit/libcsupport/src/libio_helper_null.c
deleted file mode 100644
index 947155fc85..0000000000
--- a/cpukit/libcsupport/src/libio_helper_null.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup LibIO
- */
-
-/*
- * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#if HAVE_CONFIG_H
- #include "config.h"
-#endif
-
-#include <rtems/libio.h>
-
-void rtems_libio_helper_null(void)
-{
- /* Do nothing */
-}
diff --git a/cpukit/libcsupport/src/libio_init.c b/cpukit/libcsupport/src/libio_init.c
index 88f5d8cef3..3ac2e3b67d 100644
--- a/cpukit/libcsupport/src/libio_init.c
+++ b/cpukit/libcsupport/src/libio_init.c
@@ -32,6 +32,7 @@
#include <stdlib.h> /* calloc() */
#include <rtems/libio.h> /* libio.h not pulled in by rtems */
+#include <rtems/sysinit.h>
/*
* File descriptor Table Information
@@ -40,7 +41,7 @@
rtems_id rtems_libio_semaphore;
rtems_libio_t *rtems_libio_iop_freelist;
-void rtems_libio_init( void )
+static void rtems_libio_init( void )
{
rtems_status_code rc;
uint32_t i;
@@ -81,3 +82,15 @@ void rtems_libio_init( void )
if ( rc != RTEMS_SUCCESSFUL )
rtems_fatal_error_occurred( rc );
}
+
+RTEMS_SYSINIT_ITEM(
+ rtems_libio_init,
+ RTEMS_SYSINIT_LIBIO,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
+RTEMS_SYSINIT_ITEM(
+ rtems_libio_post_driver,
+ RTEMS_SYSINIT_STD_FILE_DESCRIPTORS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);