1 | /** |
---|
2 | * @file rtems/libcsupport.h |
---|
3 | * |
---|
4 | * This include file contains the information regarding the |
---|
5 | * RTEMS specific support for the standard C library. |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2011. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef _RTEMS_RTEMS_LIBCSUPPORT_H |
---|
18 | #define _RTEMS_RTEMS_LIBCSUPPORT_H |
---|
19 | |
---|
20 | #include <sys/types.h> |
---|
21 | #include <stdint.h> |
---|
22 | |
---|
23 | #include <rtems/score/heap.h> |
---|
24 | #include <rtems/rtems/tasks.h> |
---|
25 | |
---|
26 | #ifdef __cplusplus |
---|
27 | extern "C" { |
---|
28 | #endif |
---|
29 | |
---|
30 | void RTEMS_Malloc_Initialize( |
---|
31 | void *heap_begin, |
---|
32 | uintptr_t heap_size, |
---|
33 | size_t sbrk_amount |
---|
34 | ); |
---|
35 | |
---|
36 | extern void malloc_dump(void); |
---|
37 | extern bool malloc_walk(int source, bool printf_enabled); |
---|
38 | void malloc_set_heap_pointer(Heap_Control *new_heap); |
---|
39 | Heap_Control *malloc_get_heap_pointer( void ); |
---|
40 | extern void libc_init(void); |
---|
41 | extern int host_errno(void); |
---|
42 | extern void fix_syscall_errno(void); |
---|
43 | extern size_t malloc_free_space(void); |
---|
44 | extern void open_dev_console(void); |
---|
45 | |
---|
46 | extern int malloc_info(Heap_Information_block *the_info); |
---|
47 | |
---|
48 | /* |
---|
49 | * Prototypes required to install newlib reentrancy user extension |
---|
50 | */ |
---|
51 | bool newlib_create_hook( |
---|
52 | rtems_tcb *current_task, |
---|
53 | rtems_tcb *creating_task |
---|
54 | ); |
---|
55 | |
---|
56 | #define __RTEMS_NEWLIB_BEGIN 0 |
---|
57 | |
---|
58 | void newlib_delete_hook( |
---|
59 | rtems_tcb *current_task, |
---|
60 | rtems_tcb *deleted_task |
---|
61 | ); |
---|
62 | |
---|
63 | #define RTEMS_NEWLIB_EXTENSION \ |
---|
64 | { \ |
---|
65 | newlib_create_hook, /* rtems_task_create */ \ |
---|
66 | 0, /* rtems_task_start */ \ |
---|
67 | 0, /* rtems_task_restart */ \ |
---|
68 | newlib_delete_hook, /* rtems_task_delete */ \ |
---|
69 | 0, /* task_switch */ \ |
---|
70 | __RTEMS_NEWLIB_BEGIN, /* task_begin */ \ |
---|
71 | 0, /* task_exitted */ \ |
---|
72 | 0 /* fatal */ \ |
---|
73 | } |
---|
74 | |
---|
75 | #ifdef __cplusplus |
---|
76 | } |
---|
77 | #endif |
---|
78 | |
---|
79 | #endif |
---|
80 | /* end of include file */ |
---|