diff options
| author | Meco Man <[email protected]> | 2022-01-05 12:06:34 -0500 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2022-01-09 00:23:18 +0800 |
| commit | dd62b2b10671c2b141ef75b848467d8351b5bfee (patch) | |
| tree | 7de9694bc1d4dd77ee353057ae67bb405233d204 /src | |
| parent | f89a162ea3be6536c340c0010aab41cffe9bfac9 (diff) | |
[kservice] 增加RT_KSERVICE_USING_STDLIB_MEMSET RT_KSERVICE_USING_STDLIB_MEMCPY
Diffstat (limited to 'src')
| -rw-r--r-- | src/Kconfig | 10 | ||||
| -rw-r--r-- | src/kservice.c | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/Kconfig b/src/Kconfig index dda7f08032..69edd20641 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -135,6 +135,16 @@ menu "kservice optimization" bool "Enable kservice to use standard C library" default n + if RT_KSERVICE_USING_STDLIB + config RT_KSERVICE_USING_STDLIB_MEMCPY + bool "Use memcpy to replace rt_memcpy (faster, but not safe)" + default n + + config RT_KSERVICE_USING_STDLIB_MEMSET + bool "Use memset to replace rt_memset (faster, but not safe)" + default n + endif + config RT_KSERVICE_USING_TINY_SIZE bool "Enable kservice to use tiny size" default n diff --git a/src/kservice.c b/src/kservice.c index ca4fb9c088..459109ce75 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -116,6 +116,7 @@ int *_rt_errno(void) } RTM_EXPORT(_rt_errno); +#ifndef RT_KSERVICE_USING_STDLIB_MEMSET /** * This function will set the content of memory to specified value. * @@ -201,7 +202,9 @@ RT_WEAK void *rt_memset(void *s, int c, rt_ubase_t count) #endif /* RT_KSERVICE_USING_TINY_SIZE */ } RTM_EXPORT(rt_memset); +#endif /* RT_KSERVICE_USING_STDLIB_MEMSET */ +#ifndef RT_KSERVICE_USING_STDLIB_MEMCPY /** * This function will copy memory content from source address to destination address. * @@ -285,6 +288,7 @@ RT_WEAK void *rt_memcpy(void *dst, const void *src, rt_ubase_t count) #endif /* RT_KSERVICE_USING_TINY_SIZE */ } RTM_EXPORT(rt_memcpy); +#endif /* RT_KSERVICE_USING_STDLIB_MEMCPY */ #ifndef RT_KSERVICE_USING_STDLIB |
