rtm.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /*
  2. * File : rtm.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2010-04-12 yi.qiu first version
  13. */
  14. #include <rtthread.h>
  15. /* some buildin kernel symbol */
  16. #ifdef RT_USING_MODULE
  17. #include <rtm.h>
  18. /*
  19. * thread interface symbol
  20. */
  21. RTM_EXPORT(rt_thread_init)
  22. RTM_EXPORT(rt_thread_detach)
  23. RTM_EXPORT(rt_thread_create)
  24. RTM_EXPORT(rt_thread_self)
  25. RTM_EXPORT(rt_thread_find)
  26. RTM_EXPORT(rt_thread_startup)
  27. RTM_EXPORT(rt_thread_delete)
  28. RTM_EXPORT(rt_thread_yield)
  29. RTM_EXPORT(rt_thread_delay)
  30. RTM_EXPORT(rt_thread_control)
  31. RTM_EXPORT(rt_thread_suspend)
  32. RTM_EXPORT(rt_thread_resume)
  33. RTM_EXPORT(rt_thread_timeout)
  34. #ifdef RT_USING_SEMAPHORE
  35. /*
  36. * semaphore interface symbol
  37. */
  38. RTM_EXPORT(rt_sem_init)
  39. RTM_EXPORT(rt_sem_detach)
  40. RTM_EXPORT(rt_sem_create)
  41. RTM_EXPORT(rt_sem_delete)
  42. RTM_EXPORT(rt_sem_take)
  43. RTM_EXPORT(rt_sem_trytake)
  44. RTM_EXPORT(rt_sem_release)
  45. RTM_EXPORT(rt_sem_control)
  46. #endif
  47. #ifdef RT_USING_MUTEX
  48. /*
  49. * mutex interface symbol
  50. */
  51. RTM_EXPORT(rt_mutex_init)
  52. RTM_EXPORT(rt_mutex_detach)
  53. RTM_EXPORT(rt_mutex_create)
  54. RTM_EXPORT(rt_mutex_delete)
  55. RTM_EXPORT(rt_mutex_take)
  56. RTM_EXPORT(rt_mutex_release)
  57. RTM_EXPORT(rt_mutex_control)
  58. #endif
  59. #ifdef RT_USING_EVENT
  60. /*
  61. * event interface symbol
  62. */
  63. RTM_EXPORT(rt_event_init)
  64. RTM_EXPORT(rt_event_detach)
  65. RTM_EXPORT(rt_event_create)
  66. RTM_EXPORT(rt_event_delete)
  67. RTM_EXPORT(rt_event_send)
  68. RTM_EXPORT(rt_event_recv)
  69. RTM_EXPORT(rt_event_control)
  70. #endif
  71. #ifdef RT_USING_MAILBOX
  72. /*
  73. * mailbox interface symbol
  74. */
  75. RTM_EXPORT(rt_mb_init)
  76. RTM_EXPORT(rt_mb_detach)
  77. RTM_EXPORT(rt_mb_create)
  78. RTM_EXPORT(rt_mb_delete)
  79. RTM_EXPORT(rt_mb_send)
  80. RTM_EXPORT(rt_mb_recv)
  81. RTM_EXPORT(rt_mb_control)
  82. #endif
  83. #ifdef RT_USING_MESSAGEQUEUE
  84. /*
  85. * message queue interface symbol
  86. */
  87. RTM_EXPORT(rt_mq_init)
  88. RTM_EXPORT(rt_mq_detach)
  89. RTM_EXPORT(rt_mq_create)
  90. RTM_EXPORT(rt_mq_delete)
  91. RTM_EXPORT(rt_mq_send)
  92. RTM_EXPORT(rt_mq_urgent)
  93. RTM_EXPORT(rt_mq_recv)
  94. RTM_EXPORT(rt_mq_control)
  95. #endif
  96. #ifdef RT_USING_MEMPOOL
  97. /*
  98. * memory pool interface symbol
  99. */
  100. RTM_EXPORT(rt_mp_init)
  101. RTM_EXPORT(rt_mp_detach)
  102. RTM_EXPORT(rt_mp_create)
  103. RTM_EXPORT(rt_mp_delete)
  104. RTM_EXPORT(rt_mp_alloc)
  105. RTM_EXPORT(rt_mp_free)
  106. #endif
  107. #ifdef RT_USING_HEAP
  108. /*
  109. * heap memory interface symbol
  110. */
  111. RTM_EXPORT(rt_malloc)
  112. RTM_EXPORT(rt_free)
  113. RTM_EXPORT(rt_realloc)
  114. RTM_EXPORT(rt_calloc)
  115. #endif
  116. /*
  117. * clock & timer interface symbol
  118. */
  119. RTM_EXPORT(rt_tick_get)
  120. RTM_EXPORT(rt_tick_from_millisecond)
  121. RTM_EXPORT(rt_system_timer_init)
  122. RTM_EXPORT(rt_system_timer_thread_init)
  123. RTM_EXPORT(rt_timer_init)
  124. RTM_EXPORT(rt_timer_detach)
  125. RTM_EXPORT(rt_timer_create)
  126. RTM_EXPORT(rt_timer_delete)
  127. RTM_EXPORT(rt_timer_start)
  128. RTM_EXPORT(rt_timer_stop)
  129. RTM_EXPORT(rt_timer_control)
  130. /*
  131. * kservice interface symbol
  132. */
  133. extern int __aeabi_ddiv;
  134. extern int __aeabi_dmul;
  135. extern int __aeabi_i2d;
  136. extern int __aeabi_uidiv;
  137. extern int __aeabi_uidivmod;
  138. extern int __aeabi_d2iz;
  139. extern int rand;
  140. RTM_EXPORT(rt_kprintf)
  141. RTM_EXPORT(rt_memcpy)
  142. RTM_EXPORT(rt_memset)
  143. RTM_EXPORT(rt_sprintf)
  144. RTM_EXPORT(__aeabi_ddiv)
  145. RTM_EXPORT(__aeabi_dmul)
  146. RTM_EXPORT(__aeabi_i2d)
  147. RTM_EXPORT(__aeabi_uidiv)
  148. RTM_EXPORT(__aeabi_uidivmod)
  149. RTM_EXPORT(__aeabi_d2iz)
  150. RTM_EXPORT(rand)
  151. #ifdef RT_USING_RTGUI
  152. /* FIX ME , should be removed from here */
  153. #include <rtgui/dc.h>
  154. #include <rtgui/rtgui_system.h>
  155. #include <rtgui/widgets/view.h>
  156. #include <rtgui/widgets/workbench.h>
  157. #include <rtgui/widgets/widget.h>
  158. RTM_EXPORT(rtgui_view_show)
  159. RTM_EXPORT(rtgui_view_create)
  160. RTM_EXPORT(rtgui_view_destroy)
  161. RTM_EXPORT(rtgui_view_event_handler)
  162. RTM_EXPORT(rtgui_dc_draw_text)
  163. RTM_EXPORT(rtgui_dc_begin_drawing)
  164. RTM_EXPORT(rtgui_dc_end_drawing)
  165. RTM_EXPORT(rtgui_workbench_event_loop)
  166. RTM_EXPORT(rtgui_workbench_event_handler)
  167. RTM_EXPORT(rtgui_workbench_add_view)
  168. RTM_EXPORT(rtgui_workbench_create)
  169. RTM_EXPORT(rtgui_workbench_destroy)
  170. RTM_EXPORT(rtgui_workbench_close)
  171. RTM_EXPORT(rtgui_timer_start)
  172. RTM_EXPORT(rtgui_timer_create)
  173. RTM_EXPORT(rtgui_timer_stop)
  174. RTM_EXPORT(rtgui_widget_focus)
  175. RTM_EXPORT(rtgui_widget_set_event_handler)
  176. RTM_EXPORT(rtgui_thread_register)
  177. RTM_EXPORT(rtgui_thread_deregister)
  178. #endif
  179. #endif