diff options
| author | Bernard Xiong <[email protected]> | 2015-10-14 14:48:22 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-10-14 14:48:22 +0800 |
| commit | 402732ebb92f5b555aff1bf2b4e877007f528d54 (patch) | |
| tree | 96ef6f2dcfc1e10e3a91cde98e31593ac60b3672 /components/libc | |
| parent | 369557a981ec0d4928357b62a7559d51d340a1d6 (diff) | |
| parent | c5fd1aaf5f89e6bcafc620c4dc7be5cb2f42d6d5 (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/armlibc/libc_syms.c | 39 | ||||
| -rw-r--r-- | components/libc/armlibc/mem_std.c | 4 | ||||
| -rw-r--r-- | components/libc/newlib/libc_sym.c | 47 |
3 files changed, 90 insertions, 0 deletions
diff --git a/components/libc/armlibc/libc_syms.c b/components/libc/armlibc/libc_syms.c new file mode 100644 index 0000000000..847c48544a --- /dev/null +++ b/components/libc/armlibc/libc_syms.c @@ -0,0 +1,39 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <time.h> + +#include <rtm.h> + +/* some export routines for module */ + +RTM_EXPORT(strstr); +RTM_EXPORT(strlen); +RTM_EXPORT(strchr); +RTM_EXPORT(strcpy); +RTM_EXPORT(strncpy); +RTM_EXPORT(strcmp); +RTM_EXPORT(strncmp); +RTM_EXPORT(strcat); +RTM_EXPORT(strtol); + +RTM_EXPORT(memcpy); +RTM_EXPORT(memcmp); +RTM_EXPORT(memmove); +RTM_EXPORT(memset); +RTM_EXPORT(memchr); + +RTM_EXPORT(toupper); +RTM_EXPORT(atoi); + +RTM_EXPORT(localtime); +RTM_EXPORT(time); + +/* import the full stdio for printf */ +#ifdef __MICROLIB +#error "[RT_USING_LIBC] Please use standard libc but not microlib." +#endif + +RTM_EXPORT(puts); +RTM_EXPORT(printf); diff --git a/components/libc/armlibc/mem_std.c b/components/libc/armlibc/mem_std.c index 6faf86555f..56aa525df2 100644 --- a/components/libc/armlibc/mem_std.c +++ b/components/libc/armlibc/mem_std.c @@ -22,18 +22,22 @@ void *malloc(int n) { return rt_malloc(n); } +RTM_EXPORT(malloc); void *realloc(void *rmem, rt_size_t newsize) { return rt_realloc(rmem, newsize); } +RTM_EXPORT(realloc); void *calloc(rt_size_t nelem, rt_size_t elsize) { return rt_calloc(nelem, elsize); } +RTM_EXPORT(calloc); void free(void *rmem) { rt_free(rmem); } +RTM_EXPORT(free); diff --git a/components/libc/newlib/libc_sym.c b/components/libc/newlib/libc_sym.c new file mode 100644 index 0000000000..48e488f5d8 --- /dev/null +++ b/components/libc/newlib/libc_sym.c @@ -0,0 +1,47 @@ +#include <rtthread.h> +#include <rtm.h> + +#include <string.h> +#include <stdio.h> +#include <stdlib.h> + +RTM_EXPORT(strcpy); +RTM_EXPORT(strncpy); +RTM_EXPORT(strlen); +RTM_EXPORT(strcat); +RTM_EXPORT(strstr); +RTM_EXPORT(strchr); +RTM_EXPORT(strcmp); +RTM_EXPORT(strtol); +RTM_EXPORT(strtoul); +RTM_EXPORT(strncmp); + +RTM_EXPORT(memcpy); +RTM_EXPORT(memcmp); +RTM_EXPORT(memmove); +RTM_EXPORT(memset); +RTM_EXPORT(memchr); + +RTM_EXPORT(putchar); +RTM_EXPORT(puts); +RTM_EXPORT(printf); +RTM_EXPORT(sprintf); +RTM_EXPORT(snprintf); + +RTM_EXPORT(fwrite); + +#include <time.h> +RTM_EXPORT(localtime); +RTM_EXPORT(time); + +#include <setjmp.h> +RTM_EXPORT(longjmp); +RTM_EXPORT(setjmp); + +RTM_EXPORT(exit); +RTM_EXPORT(abort); + +RTM_EXPORT(rand); + +#include <assert.h> +RTM_EXPORT(__assert_func); |
