summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/libcsupport.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/include/rtems/libcsupport.h')
-rw-r--r--cpukit/include/rtems/libcsupport.h61
1 files changed, 44 insertions, 17 deletions
diff --git a/cpukit/include/rtems/libcsupport.h b/cpukit/include/rtems/libcsupport.h
index f4be4cfc9a..9329b82674 100644
--- a/cpukit/include/rtems/libcsupport.h
+++ b/cpukit/include/rtems/libcsupport.h
@@ -1,8 +1,12 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
- *
+ *
+ * @ingroup libcsupport
+ *
* @brief Standard C Library Support
- *
+ *
* This include file contains the information regarding the
* RTEMS specific support for the standard C library.
*/
@@ -11,9 +15,26 @@
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
- * 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.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RTEMS_RTEMS_LIBCSUPPORT_H
@@ -36,8 +57,8 @@ extern "C" {
*
* @brief RTEMS Specific Support for the Standard C Library
*
+ * @{
*/
-/**@{**/
extern void malloc_dump(void);
@@ -77,27 +98,33 @@ extern int malloc_info(Heap_Information_block *the_info);
/*
* Prototypes required to install newlib reentrancy user extension
*/
+
+#ifdef _REENT_THREAD_LOCAL
+#define _NEWLIB_CREATE_HOOK NULL
+#else
bool newlib_create_hook(
rtems_tcb *current_task,
rtems_tcb *creating_task
);
+#define _NEWLIB_CREATE_HOOK newlib_create_hook
+#endif
void newlib_terminate_hook(
rtems_tcb *current_task
);
#define RTEMS_NEWLIB_EXTENSION \
-{ \
- newlib_create_hook, /* rtems_task_create */ \
- 0, /* rtems_task_start */ \
- 0, /* rtems_task_restart */ \
- 0, /* rtems_task_delete */ \
- 0, /* task_switch */ \
- 0, /* task_begin */ \
- 0, /* task_exitted */ \
- 0, /* fatal */ \
- newlib_terminate_hook /* thread terminate */ \
-}
+ { \
+ _NEWLIB_CREATE_HOOK, /* thread_create */ \
+ NULL, /* thread_start */ \
+ NULL, /* thread_restart */ \
+ NULL, /* thread_delete */ \
+ NULL, /* thread_switch */ \
+ NULL, /* thread_begin */ \
+ NULL, /* thread_exitted */ \
+ NULL, /* fatal */ \
+ newlib_terminate_hook /* thread_terminate */ \
+ }
typedef struct {
uint32_t active_barriers;