mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
split export symbols from rtm.c to each file
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2263 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
1 parent
907e1703e6
commit
a73abdccf5
11 files changed
+108
-259
No files matched your search
@@ -52,6 +52,7 @@ rt_tick_t rt_tick_get(void)
|
||||
/* return the global tick */
|
||||
return rt_tick;
|
||||
}
|
||||
RTM_EXPORT(rt_tick_get);
|
||||
|
||||
/**
|
||||
* This function will set current tick
|
||||
@@ -105,6 +106,7 @@ rt_tick_t rt_tick_from_millisecond(rt_uint32_t ms)
|
||||
/* return the calculated tick */
|
||||
return (RT_TICK_PER_SECOND * ms + 999) / 1000;
|
||||
}
|
||||
RTM_EXPORT(rt_tick_from_millisecond);
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -58,6 +58,7 @@ rt_err_t rt_get_errno(void)
|
||||
|
||||
return tid->error;
|
||||
}
|
||||
RTM_EXPORT(rt_get_errno);
|
||||
|
||||
/*
|
||||
* This function will set errno
|
||||
@@ -86,6 +87,7 @@ void rt_set_errno(rt_err_t error)
|
||||
|
||||
tid->error = error;
|
||||
}
|
||||
RTM_EXPORT(rt_set_errno);
|
||||
|
||||
/**
|
||||
* This function returns errno.
|
||||
@@ -105,6 +107,7 @@ int *_rt_errno(void)
|
||||
|
||||
return (int *)&_errno;
|
||||
}
|
||||
RTM_EXPORT(_rt_errno);
|
||||
|
||||
/**
|
||||
* This function will set the content of memory to specified value
|
||||
@@ -186,6 +189,7 @@ void *rt_memset(void *s, int c, rt_ubase_t count)
|
||||
#undef TOO_SMALL
|
||||
#endif
|
||||
}
|
||||
RTM_EXPORT(rt_memset);
|
||||
|
||||
/**
|
||||
* This function will copy memory content from source address to destination
|
||||
@@ -259,6 +263,7 @@ void *rt_memcpy(void *dst, const void *src, rt_ubase_t count)
|
||||
#undef TOO_SMALL
|
||||
#endif
|
||||
}
|
||||
RTM_EXPORT(rt_memcpy);
|
||||
|
||||
/**
|
||||
* This function will move memory content from source address to destination
|
||||
@@ -290,6 +295,7 @@ void *rt_memmove(void *dest, const void *src, rt_ubase_t n)
|
||||
|
||||
return dest;
|
||||
}
|
||||
RTM_EXPORT(rt_memmove);
|
||||
|
||||
/**
|
||||
* This function will compare two areas of memory
|
||||
@@ -311,6 +317,7 @@ rt_int32_t rt_memcmp(const void *cs, const void *ct, rt_ubase_t count)
|
||||
|
||||
return res;
|
||||
}
|
||||
RTM_EXPORT(rt_memcmp);
|
||||
|
||||
/**
|
||||
* This function will return the first occurrence of a string.
|
||||
@@ -338,6 +345,7 @@ char *rt_strstr(const char *s1, const char *s2)
|
||||
|
||||
return RT_NULL;
|
||||
}
|
||||
RTM_EXPORT(rt_strstr);
|
||||
|
||||
/**
|
||||
* This function will compare two strings while ignoring differences in case
|
||||
@@ -364,6 +372,7 @@ rt_uint32_t rt_strcasecmp(const char *a, const char *b)
|
||||
|
||||
return ca - cb;
|
||||
}
|
||||
RTM_EXPORT(rt_strcasecmp);
|
||||
|
||||
/**
|
||||
* This function will copy string no more than n bytes.
|
||||
@@ -395,6 +404,7 @@ char *rt_strncpy(char *dst, const char *src, rt_ubase_t n)
|
||||
|
||||
return (dst);
|
||||
}
|
||||
RTM_EXPORT(rt_strncpy);
|
||||
|
||||
/**
|
||||
* This function will compare two strings with specified maximum length
|
||||
@@ -418,6 +428,7 @@ rt_ubase_t rt_strncmp(const char *cs, const char *ct, rt_ubase_t count)
|
||||
|
||||
return __res;
|
||||
}
|
||||
RTM_EXPORT(rt_strncmp);
|
||||
|
||||
/**
|
||||
* This function will compare two strings without specified length
|
||||
@@ -434,6 +445,7 @@ rt_ubase_t rt_strcmp(const char *cs, const char *ct)
|
||||
|
||||
return (*cs - *ct);
|
||||
}
|
||||
RTM_EXPORT(rt_strcmp);
|
||||
|
||||
/**
|
||||
* This function will return the length of a string, which terminate will
|
||||
@@ -452,6 +464,7 @@ rt_ubase_t rt_strlen(const char *s)
|
||||
|
||||
return sc - s;
|
||||
}
|
||||
RTM_EXPORT(rt_strlen);
|
||||
|
||||
#ifdef RT_USING_HEAP
|
||||
/**
|
||||
@@ -473,6 +486,7 @@ char *rt_strdup(const char *s)
|
||||
|
||||
return tmp;
|
||||
}
|
||||
RTM_EXPORT(rt_strdup);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -485,6 +499,7 @@ void rt_show_version(void)
|
||||
rt_kprintf(" / | \\ %d.%d.%d build %s\n", RT_VERSION, RT_SUBVERSION, RT_REVISION, __DATE__);
|
||||
rt_kprintf(" 2006 - 2012 Copyright by rt-thread team\n");
|
||||
}
|
||||
RTM_EXPORT(rt_show_version);
|
||||
|
||||
/* private function */
|
||||
#define isdigit(c) ((unsigned)((c) - '0') < 10)
|
||||
@@ -947,6 +962,7 @@ rt_int32_t rt_snprintf(char *buf, rt_size_t size, const char *fmt, ...)
|
||||
|
||||
return n;
|
||||
}
|
||||
RTM_EXPORT(rt_snprintf);
|
||||
|
||||
/**
|
||||
* This function will fill a formatted string to buffer
|
||||
@@ -959,6 +975,7 @@ rt_int32_t rt_vsprintf(char *buf, const char *format, va_list arg_ptr)
|
||||
{
|
||||
return vsnprintf(buf, (rt_size_t) -1, format, arg_ptr);
|
||||
}
|
||||
RTM_EXPORT(rt_vsprintf);
|
||||
|
||||
/**
|
||||
* This function will fill a formatted string to buffer
|
||||
@@ -977,6 +994,7 @@ rt_int32_t rt_sprintf(char *buf, const char *format, ...)
|
||||
|
||||
return n;
|
||||
}
|
||||
RTM_EXPORT(rt_sprintf);
|
||||
|
||||
#ifdef RT_USING_CONSOLE
|
||||
|
||||
@@ -990,6 +1008,7 @@ rt_device_t rt_console_get_device(void)
|
||||
{
|
||||
return _console_device;
|
||||
}
|
||||
RTM_EXPORT(rt_console_get_device);
|
||||
|
||||
/**
|
||||
* This function will set a device as console device.
|
||||
@@ -1024,6 +1043,7 @@ rt_device_t rt_console_set_device(const char *name)
|
||||
|
||||
return old;
|
||||
}
|
||||
RTM_EXPORT(rt_console_set_device);
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__ADSPBLACKFIN__)
|
||||
@@ -1040,6 +1060,7 @@ void rt_hw_console_output(const char *str)
|
||||
{
|
||||
/* empty console output */
|
||||
}
|
||||
RTM_EXPORT(rt_hw_console_output);
|
||||
|
||||
/**
|
||||
* This function will print a formatted string on system console
|
||||
@@ -1068,10 +1089,13 @@ void rt_kprintf(const char *fmt, ...)
|
||||
#endif
|
||||
va_end(args);
|
||||
}
|
||||
RTM_EXPORT(rt_kprintf);
|
||||
#else
|
||||
void rt_kprintf(const char *fmt, ...)
|
||||
{
|
||||
}
|
||||
RTM_EXPORT(rt_kprintf);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_HEAP
|
||||
@@ -1116,6 +1140,7 @@ void* rt_malloc_align(rt_size_t size, rt_size_t align)
|
||||
|
||||
return ptr;
|
||||
}
|
||||
RTM_EXPORT(rt_malloc_align);
|
||||
|
||||
/**
|
||||
* This function release the memory block, which is allocated by rt_malloc_align
|
||||
@@ -1130,6 +1155,7 @@ void rt_free_align(void *ptr)
|
||||
real_ptr = (void*)*(rt_uint32_t*)((rt_uint32_t)ptr - sizeof(void*));
|
||||
rt_free(real_ptr);
|
||||
}
|
||||
RTM_EXPORT(rt_free_align);
|
||||
#endif
|
||||
|
||||
#if !defined (RT_USING_NEWLIB) && defined (RT_USING_MINILIBC) && defined (__GNUC__)
|
||||
|
||||
@@ -350,6 +350,7 @@ void *rt_malloc(rt_size_t size)
|
||||
|
||||
return RT_NULL;
|
||||
}
|
||||
RTM_EXPORT(rt_malloc);
|
||||
|
||||
/**
|
||||
* This function will change the previously allocated memory block.
|
||||
@@ -441,6 +442,7 @@ void *rt_realloc(void *rmem, rt_size_t newsize)
|
||||
|
||||
return nmem;
|
||||
}
|
||||
RTM_EXPORT(rt_realloc);
|
||||
|
||||
/**
|
||||
* This function will contiguously allocate enough space for count objects
|
||||
@@ -469,6 +471,7 @@ void *rt_calloc(rt_size_t count, rt_size_t size)
|
||||
|
||||
return p;
|
||||
}
|
||||
RTM_EXPORT(rt_calloc);
|
||||
|
||||
/**
|
||||
* This function will release the previously allocated memory block by rt_malloc.
|
||||
@@ -529,6 +532,7 @@ void rt_free(void *rmem)
|
||||
plug_holes(mem);
|
||||
rt_sem_release(&heap_sem);
|
||||
}
|
||||
RTM_EXPORT(rt_free);
|
||||
|
||||
#ifdef RT_MEM_STATS
|
||||
void rt_memory_info(rt_uint32_t *total, rt_uint32_t *used, rt_uint32_t *max_used)
|
||||
|
||||
@@ -101,6 +101,7 @@ rt_err_t rt_memheap_init(struct rt_memheap *memheap, const char *name,
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_memheap_init);
|
||||
|
||||
rt_err_t rt_memheap_detach(struct rt_memheap *heap)
|
||||
{
|
||||
@@ -109,6 +110,7 @@ rt_err_t rt_memheap_detach(struct rt_memheap *heap)
|
||||
/* Return a successful completion. */
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_memheap_detach);
|
||||
|
||||
void *rt_memheap_alloc(struct rt_memheap *pool_ptr, rt_uint32_t size)
|
||||
{
|
||||
@@ -219,6 +221,7 @@ void *rt_memheap_alloc(struct rt_memheap *pool_ptr, rt_uint32_t size)
|
||||
/* Return the completion status. */
|
||||
return RT_NULL;
|
||||
}
|
||||
RTM_EXPORT(rt_memheap_alloc);
|
||||
|
||||
void rt_memheap_free(void *ptr)
|
||||
{
|
||||
@@ -297,5 +300,6 @@ void rt_memheap_free(void *ptr)
|
||||
header_ptr->next_free, header_ptr->prev_free));
|
||||
}
|
||||
}
|
||||
RTM_EXPORT(rt_memheap_free);
|
||||
|
||||
#endif
|
||||
@@ -119,6 +119,7 @@ rt_err_t rt_mp_init(struct rt_mempool *mp, const char *name, void *start, rt_siz
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_mp_init);
|
||||
|
||||
/**
|
||||
* This function will detach a memory pool from system object management.
|
||||
@@ -165,6 +166,7 @@ rt_err_t rt_mp_detach(struct rt_mempool *mp)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_mp_detach);
|
||||
|
||||
#ifdef RT_USING_HEAP
|
||||
/**
|
||||
@@ -225,6 +227,7 @@ rt_mp_t rt_mp_create(const char *name, rt_size_t block_count, rt_size_t block_si
|
||||
|
||||
return mp;
|
||||
}
|
||||
RTM_EXPORT(rt_mp_create);
|
||||
|
||||
/**
|
||||
* This function will delete a memory pool and release the object memory.
|
||||
@@ -283,6 +286,7 @@ rt_err_t rt_mp_delete(rt_mp_t mp)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_mp_delete);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -373,6 +377,7 @@ void *rt_mp_alloc(rt_mp_t mp, rt_int32_t time)
|
||||
|
||||
return (rt_uint8_t *)(block_ptr + sizeof(rt_uint8_t *));
|
||||
}
|
||||
RTM_EXPORT(rt_mp_alloc);
|
||||
|
||||
/**
|
||||
* This function will release a memory block
|
||||
@@ -428,6 +433,7 @@ void rt_mp_free(void *block)
|
||||
/* enable interrupt */
|
||||
rt_hw_interrupt_enable(level);
|
||||
}
|
||||
RTM_EXPORT(rt_mp_free);
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ struct rt_object_information *rt_object_get_information(enum rt_object_class_typ
|
||||
{
|
||||
return &rt_object_container[type];
|
||||
}
|
||||
RTM_EXPORT(rt_object_get_information);
|
||||
|
||||
/**
|
||||
* This function will initialize an object and add it to object system management.
|
||||
|
||||
@@ -83,6 +83,7 @@ void rt_malloc_sethook(void (*hook)(void *ptr, rt_size_t size))
|
||||
{
|
||||
rt_malloc_hook = hook;
|
||||
}
|
||||
RTM_EXPORT(rt_malloc_sethook);
|
||||
|
||||
/**
|
||||
* This function will set a hook function, which will be invoked when a memory
|
||||
@@ -94,6 +95,7 @@ void rt_free_sethook(void (*hook)(void *ptr))
|
||||
{
|
||||
rt_free_hook = hook;
|
||||
}
|
||||
RTM_EXPORT(rt_free_sethook);
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -665,6 +667,7 @@ fail:
|
||||
|
||||
return RT_NULL;
|
||||
}
|
||||
RTM_EXPORT(rt_malloc);
|
||||
|
||||
/**
|
||||
* This function will change the size of previously allocated memory block.
|
||||
@@ -736,6 +739,7 @@ void *rt_realloc(void *ptr, rt_size_t size)
|
||||
|
||||
return RT_NULL;
|
||||
}
|
||||
RTM_EXPORT(rt_realloc);
|
||||
|
||||
/**
|
||||
* This function will contiguously allocate enough space for count objects
|
||||
@@ -762,6 +766,7 @@ void *rt_calloc(rt_size_t count, rt_size_t size)
|
||||
|
||||
return p;
|
||||
}
|
||||
RTM_EXPORT(rt_calloc);
|
||||
|
||||
/**
|
||||
* This function will release the previously allocated memory block by rt_malloc.
|
||||
@@ -908,6 +913,7 @@ void rt_free(void *ptr)
|
||||
/* unlock heap */
|
||||
rt_sem_release(&heap_sem);
|
||||
}
|
||||
RTM_EXPORT(rt_free);
|
||||
|
||||
#ifdef RT_MEM_STATS
|
||||
void rt_memory_info(rt_uint32_t *total, rt_uint32_t *used, rt_uint32_t *max_used)
|
||||
|
||||
@@ -158,6 +158,7 @@ rt_err_t rt_thread_init(struct rt_thread *thread,
|
||||
stack_start, stack_size,
|
||||
priority, tick);
|
||||
}
|
||||
RTM_EXPORT(rt_thread_init);
|
||||
|
||||
/**
|
||||
* This function will return self thread object
|
||||
@@ -168,6 +169,7 @@ rt_thread_t rt_thread_self(void)
|
||||
{
|
||||
return rt_current_thread;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_self);
|
||||
|
||||
/**
|
||||
* This function will start a thread and put it to system ready queue
|
||||
@@ -208,6 +210,7 @@ rt_err_t rt_thread_startup(rt_thread_t thread)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_startup);
|
||||
|
||||
/**
|
||||
* This function will detach a thread. The thread object will be removed from
|
||||
@@ -250,6 +253,8 @@ rt_err_t rt_thread_detach(rt_thread_t thread)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_detach);
|
||||
|
||||
|
||||
#ifdef RT_USING_HEAP
|
||||
/**
|
||||
@@ -293,6 +298,7 @@ rt_thread_t rt_thread_create(const char *name,
|
||||
|
||||
return thread;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_create);
|
||||
|
||||
/**
|
||||
* This function will delete a thread. The thread object will be removed from
|
||||
@@ -329,6 +335,7 @@ rt_err_t rt_thread_delete(rt_thread_t thread)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_delete);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -372,6 +379,7 @@ rt_err_t rt_thread_yield(void)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_yield);
|
||||
|
||||
/**
|
||||
* This function will let current thread sleep for some ticks.
|
||||
@@ -421,6 +429,7 @@ rt_err_t rt_thread_delay(rt_tick_t tick)
|
||||
{
|
||||
return rt_thread_sleep(tick);
|
||||
}
|
||||
RTM_EXPORT(rt_thread_delay);
|
||||
|
||||
/**
|
||||
* This function will control thread behaviors according to control command.
|
||||
@@ -500,6 +509,7 @@ rt_err_t rt_thread_control(rt_thread_t thread, rt_uint8_t cmd, void *arg)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_control);
|
||||
|
||||
/**
|
||||
* This function will suspend the specified thread.
|
||||
@@ -540,6 +550,7 @@ rt_err_t rt_thread_suspend(rt_thread_t thread)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_suspend);
|
||||
|
||||
/**
|
||||
* This function will resume a thread and put it to system ready queue.
|
||||
@@ -585,6 +596,7 @@ rt_err_t rt_thread_resume(rt_thread_t thread)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_resume);
|
||||
|
||||
/**
|
||||
* This function is the timeout function for thread, normally which is invoked
|
||||
@@ -614,6 +626,7 @@ void rt_thread_timeout(void *parameter)
|
||||
/* do schedule */
|
||||
rt_schedule();
|
||||
}
|
||||
RTM_EXPORT(rt_thread_timeout);
|
||||
|
||||
/**
|
||||
* This function will find the specified thread.
|
||||
@@ -658,5 +671,6 @@ rt_thread_t rt_thread_find(char *name)
|
||||
/* not found */
|
||||
return RT_NULL;
|
||||
}
|
||||
RTM_EXPORT(rt_thread_find);
|
||||
|
||||
/*@}*/
|
||||
@@ -120,6 +120,7 @@ void rt_timer_init(rt_timer_t timer,
|
||||
|
||||
_rt_timer_init(timer, timeout, parameter, time, flag);
|
||||
}
|
||||
RTM_EXPORT(rt_timer_init);
|
||||
|
||||
/**
|
||||
* This function will detach a timer from timer management.
|
||||
@@ -148,6 +149,7 @@ rt_err_t rt_timer_detach(rt_timer_t timer)
|
||||
|
||||
return -RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_timer_detach);
|
||||
|
||||
#ifdef RT_USING_HEAP
|
||||
/**
|
||||
@@ -177,6 +179,7 @@ rt_timer_t rt_timer_create(const char *name, void (*timeout)(void *parameter),
|
||||
|
||||
return timer;
|
||||
}
|
||||
RTM_EXPORT(rt_timer_create);
|
||||
|
||||
/**
|
||||
* This function will delete a timer and release timer memory
|
||||
@@ -205,6 +208,7 @@ rt_err_t rt_timer_delete(rt_timer_t timer)
|
||||
|
||||
return -RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_timer_delete);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -287,6 +291,7 @@ rt_err_t rt_timer_start(rt_timer_t timer)
|
||||
|
||||
return -RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_timer_start);
|
||||
|
||||
/**
|
||||
* This function will stop the timer
|
||||
@@ -320,6 +325,7 @@ rt_err_t rt_timer_stop(rt_timer_t timer)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_timer_stop);
|
||||
|
||||
/**
|
||||
* This function will get or set some options of the timer
|
||||
@@ -356,6 +362,7 @@ rt_err_t rt_timer_control(rt_timer_t timer, rt_uint8_t cmd, void *arg)
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
RTM_EXPORT(rt_timer_control);
|
||||
|
||||
/**
|
||||
* This function will check timer list, if a timeout event happens, the
|
||||
|
||||
Reference in new issue
Block a user