rtm.c 6.0 KB
Newer Older
1 2 3
/*
 * File      : rtm.c
 * This file is part of RT-Thread RTOS
D
dzzxzz 已提交
4
 * COPYRIGHT (C) 2006 - 2011, RT-Thread Development Team
5 6 7 8 9 10
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rt-thread.org/license/LICENSE
 *
 * Change Logs:
D
dzzxzz 已提交
11 12
 * Date           Author       Notes
 * 2010-04-12     yi.qiu       first version
13 14
 */

D
dzzxzz 已提交
15
#include <rtthread.h>
16 17 18 19 20 21 22 23 24 25 26 27
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

/* some buildin kernel symbol */

#ifdef RT_USING_MODULE
#include <rtm.h>

RTM_EXPORT(rt_object_get_information);

/*
D
dzzxzz 已提交
28
 * thread  interface symbol
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
 */
 
RTM_EXPORT(rt_thread_init);
RTM_EXPORT(rt_thread_detach);
RTM_EXPORT(rt_thread_create);
RTM_EXPORT(rt_thread_self);
RTM_EXPORT(rt_thread_find);
RTM_EXPORT(rt_thread_startup);
RTM_EXPORT(rt_thread_delete);
RTM_EXPORT(rt_thread_yield);
RTM_EXPORT(rt_thread_delay);
RTM_EXPORT(rt_thread_control);
RTM_EXPORT(rt_thread_suspend);
RTM_EXPORT(rt_thread_resume);
RTM_EXPORT(rt_thread_timeout);

#ifdef RT_USING_SEMAPHORE
/*
 * semaphore interface symbol
 */
RTM_EXPORT(rt_sem_init);
RTM_EXPORT(rt_sem_detach);
RTM_EXPORT(rt_sem_create);
RTM_EXPORT(rt_sem_delete);
RTM_EXPORT(rt_sem_take);
RTM_EXPORT(rt_sem_trytake);
RTM_EXPORT(rt_sem_release);
RTM_EXPORT(rt_sem_control);
#endif

#ifdef RT_USING_MUTEX
/*
 * mutex interface symbol
 */
RTM_EXPORT(rt_mutex_init);
RTM_EXPORT(rt_mutex_detach);
RTM_EXPORT(rt_mutex_create);
RTM_EXPORT(rt_mutex_delete);
RTM_EXPORT(rt_mutex_take);
RTM_EXPORT(rt_mutex_release);
RTM_EXPORT(rt_mutex_control);
#endif

#ifdef RT_USING_EVENT
/*
 * event interface symbol
 */
RTM_EXPORT(rt_event_init);
RTM_EXPORT(rt_event_detach);
RTM_EXPORT(rt_event_create);
RTM_EXPORT(rt_event_delete);
RTM_EXPORT(rt_event_send);
RTM_EXPORT(rt_event_recv);
D
dzzxzz 已提交
82
RTM_EXPORT(rt_event_control);
83 84 85 86 87 88 89 90 91 92 93 94
#endif

#ifdef RT_USING_MAILBOX
/*
 * mailbox interface symbol
 */
RTM_EXPORT(rt_mb_init);
RTM_EXPORT(rt_mb_detach);
RTM_EXPORT(rt_mb_create);
RTM_EXPORT(rt_mb_delete);
RTM_EXPORT(rt_mb_send);
RTM_EXPORT(rt_mb_recv);
D
dzzxzz 已提交
95
RTM_EXPORT(rt_mb_control);
96 97 98 99 100 101 102 103 104 105 106 107
#endif

#ifdef RT_USING_MESSAGEQUEUE
/*
 * message queue interface symbol
 */
RTM_EXPORT(rt_mq_init);
RTM_EXPORT(rt_mq_detach);
RTM_EXPORT(rt_mq_create);
RTM_EXPORT(rt_mq_delete);
RTM_EXPORT(rt_mq_send);
RTM_EXPORT(rt_mq_urgent);
D
dzzxzz 已提交
108 109
RTM_EXPORT(rt_mq_recv);
RTM_EXPORT(rt_mq_control);
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
#endif

#ifdef RT_USING_MEMPOOL
/*
 * memory pool interface symbol
 */
RTM_EXPORT(rt_mp_init);
RTM_EXPORT(rt_mp_detach);
RTM_EXPORT(rt_mp_create);
RTM_EXPORT(rt_mp_delete);
RTM_EXPORT(rt_mp_alloc);
RTM_EXPORT(rt_mp_free);
#endif

#ifdef RT_USING_HEAP
/*
 * heap memory interface symbol
 */
RTM_EXPORT(rt_malloc);
RTM_EXPORT(rt_free);
RTM_EXPORT(rt_realloc);
RTM_EXPORT(rt_calloc);
#endif
/*
 * clock & timer interface symbol
 */
RTM_EXPORT(rt_tick_get);
RTM_EXPORT(rt_tick_from_millisecond);
RTM_EXPORT(rt_system_timer_init);
RTM_EXPORT(rt_system_timer_thread_init);
RTM_EXPORT(rt_timer_init);
RTM_EXPORT(rt_timer_detach);
RTM_EXPORT(rt_timer_create);
RTM_EXPORT(rt_timer_delete);
RTM_EXPORT(rt_timer_start);
RTM_EXPORT(rt_timer_stop);
RTM_EXPORT(rt_timer_control);

/* 
 * kservice interface symbol
 */
RTM_EXPORT(rt_memcpy);
RTM_EXPORT(rt_memcmp);
RTM_EXPORT(rt_memset);
RTM_EXPORT(rt_kprintf);
RTM_EXPORT(rt_sprintf);
RTM_EXPORT(rt_strstr);
RTM_EXPORT(rt_snprintf);

/* 
 * misc interface symbol
 */
D
dzzxzz 已提交
162 163
extern int __aeabi_idiv;
extern int __aeabi_ddiv;
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
extern int __aeabi_dmul;
extern int __aeabi_i2d;
extern int __aeabi_uidiv;
extern int __aeabi_uidivmod;
extern int __aeabi_idivmod;
extern int __aeabi_d2iz;

RTM_EXPORT(__aeabi_ddiv);
RTM_EXPORT(__aeabi_dmul);
RTM_EXPORT(__aeabi_i2d);
RTM_EXPORT(__aeabi_uidiv);
RTM_EXPORT(__aeabi_idiv);
RTM_EXPORT(__aeabi_idivmod);
RTM_EXPORT(__aeabi_uidivmod);
RTM_EXPORT(__aeabi_d2iz);
RTM_EXPORT(strcmp);
RTM_EXPORT(strcpy);
RTM_EXPORT(strlen);
RTM_EXPORT(rand);
RTM_EXPORT(memset);
RTM_EXPORT(memcpy);

#ifdef RT_USING_NEWLIB

#include <unistd.h>
#include <assert.h>

RTM_EXPORT(snprintf);
RTM_EXPORT(access);
RTM_EXPORT(__assert_func);

#include <time.h>
RTM_EXPORT(localtime);
RTM_EXPORT(time);

#endif

#ifdef RT_USING_DFS
#include <dfs_posix.h>

RTM_EXPORT(open);
RTM_EXPORT(close);
RTM_EXPORT(read);
RTM_EXPORT(write);
RTM_EXPORT(stat);
#endif

#ifdef RT_USING_RTGUI
/* FIX ME , should be removed from here */
#include <rtgui/dc.h>
#include <rtgui/rtgui_server.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/view.h>
#include <rtgui/widgets/workbench.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/button.h>
#include <rtgui/widgets/label.h>
#include <rtgui/widgets/list_view.h>
#include <rtgui/widgets/listctrl.h>
#include <rtgui/widgets/filelist_view.h>

RTM_EXPORT(rtgui_label_create);
RTM_EXPORT(rtgui_view_show);
RTM_EXPORT(rtgui_view_create);
RTM_EXPORT(rtgui_view_destroy);
RTM_EXPORT(rtgui_view_event_handler);
RTM_EXPORT(rtgui_dc_draw_text);
RTM_EXPORT(rtgui_dc_begin_drawing);
RTM_EXPORT(rtgui_dc_end_drawing);
RTM_EXPORT(rtgui_workbench_event_loop);
RTM_EXPORT(rtgui_workbench_event_handler);
RTM_EXPORT(rtgui_workbench_add_view);
RTM_EXPORT(rtgui_workbench_create);
RTM_EXPORT(rtgui_workbench_destroy);
RTM_EXPORT(rtgui_workbench_close);
RTM_EXPORT(rtgui_timer_start);
RTM_EXPORT(rtgui_timer_create);
RTM_EXPORT(rtgui_timer_destory);
RTM_EXPORT(rtgui_timer_stop);
RTM_EXPORT(rtgui_thread_register);
RTM_EXPORT(rtgui_thread_deregister);
RTM_EXPORT(rtgui_widget_focus);
RTM_EXPORT(rtgui_widget_set_event_handler);
RTM_EXPORT(rtgui_widget_rect_to_device);
RTM_EXPORT(rtgui_widget_update);
RTM_EXPORT(rtgui_widget_get_rect);
RTM_EXPORT(rtgui_widget_set_rect);
RTM_EXPORT(rtgui_widget_get_toplevel);
RTM_EXPORT(rtgui_panel_register);
RTM_EXPORT(rtgui_panel_set_default_focused);
RTM_EXPORT(rtgui_button_create);
RTM_EXPORT(rtgui_button_destroy);
RTM_EXPORT(rtgui_button_set_onbutton);
RTM_EXPORT(rtgui_container_add_child);
RTM_EXPORT(rtgui_filelist_view_create);
RTM_EXPORT(rtgui_filelist_view_get_fullpath);
RTM_EXPORT(rtgui_list_view_create);
RTM_EXPORT(rtgui_list_view_destroy);
RTM_EXPORT(rtgui_listctrl_set_onitem);
RTM_EXPORT(rtgui_image_create_from_mem);
RTM_EXPORT(rtgui_listctrl_create);

#endif
#endif