You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaoxiang781216 (via GitHub)" <gi...@apache.org> on 2023/05/05 19:15:54 UTC
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #9138: libc/string: select arch's libc for kernel/userspace optionally
xiaoxiang781216 commented on code in PR #9138:
URL: https://github.com/apache/nuttx/pull/9138#discussion_r1186422857
##########
libs/libc/libc.h:
##########
@@ -53,6 +55,14 @@
#define LIB_BUFLEN_UNKNOWN INT_MAX
+#if defined(CONFIG_BUILD_PROTECTED) && \
+ ((defined(CONFIG_LIBC_ARCH_PREVENT_USER) && !defined(__KERNEL__)) || \
+ (defined(CONFIG_LIBC_ARCH_PREVENT_KERNEL) && defined(__KERNEL__)))
+# define LIBC_BUILD_FUNCTION 1
+#else
+# define LIBC_BUILD_FUNCTION 0
Review Comment:
remvove, let's check if defined(LIBC_BUILD_FUNCTION)?
##########
libs/libc/machine/arm/armv7-a/gnu/arch_memchr.S:
##########
@@ -66,6 +66,10 @@
*
****************************************************************************/
+#include "libc.h"
+
+#if (LIBC_BUILD_FUNCTION == 0)
Review Comment:
#ifdef LIBC_BUILD_FUNCTION
and other similar place.
Note: LIBC_ARCH_PREVENT_xxx should prevent only the rom function, but not assembler optimized version.
##########
libs/libc/libc.h:
##########
@@ -53,6 +55,14 @@
#define LIB_BUFLEN_UNKNOWN INT_MAX
+#if defined(CONFIG_BUILD_PROTECTED) && \
Review Comment:
#if !defined(CONFIG_BUILD_FLAT)
##########
libs/libc/string/lib_memcpy.c:
##########
@@ -34,7 +36,7 @@
* Name: memcpy
****************************************************************************/
-#ifndef CONFIG_LIBC_ARCH_MEMCPY
+#if !defined(CONFIG_LIBC_ARCH_MEMCPY) || (LIBC_BUILD_FUNCTION)
Review Comment:
#if defined(LIBC_BUILD_FUNCTION) && !defined(CONFIG_LIBC_ARCH_MEMCPY)
and other similar place
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org