mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
libc/string: prevent libc in the kernel/userspace optionally
Add the `LIBC_PREVENT_STRING_KERNEL` and `LIBC_PREVENT_STRING_USER` that are meant to be selected by the chip if no libc implementation is going to be built. If selected, neither NuttX's software version of the libc nor any architecture-specific implementation will be built in the kernel or in the userspace, respectively. In this case, the linker may provide a ROM-defined version of the libc functions instead.
This commit is contained in:
committed by
Xiang Xiao
parent
6be363ff35
commit
58e97e521c
@@ -18,6 +18,14 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef LIBC_BUILD_STRING
|
||||
|
||||
/************************************************************************************
|
||||
* Public Symbols
|
||||
************************************************************************************/
|
||||
@@ -128,3 +136,5 @@ memcpy:
|
||||
bltu a1, a3, 5b
|
||||
6:
|
||||
ret
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef LIBC_BUILD_STRING
|
||||
|
||||
.text
|
||||
.global memset
|
||||
.type memset, @function
|
||||
@@ -104,3 +108,5 @@ memset:
|
||||
bleu a2, t1, .Ltiny
|
||||
j .Laligned
|
||||
.size memset, .-memset
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef LIBC_BUILD_STRING
|
||||
|
||||
#include "asm.h"
|
||||
|
||||
.text
|
||||
@@ -185,3 +189,5 @@ strcmp:
|
||||
mask:
|
||||
.dword 0x7f7f7f7f7f7f7f7f
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user