Provide flat mode the chip string customization.

Signed-off-by: yangdongdong <yangdongdong@xiaomi.com>
This commit is contained in:
yangdongdong 2023-09-13 17:47:12 +08:00 committed by Xiang Xiao
parent 1b1b1a025d
commit fa620dee9d

View File

@ -55,122 +55,102 @@
#define LIB_BUFLEN_UNKNOWN INT_MAX #define LIB_BUFLEN_UNKNOWN INT_MAX
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_MEMCHR_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_MEMCHR_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_MEMCHR_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_MEMCHR_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_MEMCHR # define LIBC_BUILD_MEMCHR
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_MEMCMP_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_MEMCMP_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_MEMCMP_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_MEMCMP_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_MEMCMP # define LIBC_BUILD_MEMCMP
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_MEMCPY_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_MEMCPY_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_MEMCPY_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_MEMCPY_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_MEMCPY # define LIBC_BUILD_MEMCPY
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_MEMMOVE_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_MEMMOVE_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_MEMMOVE_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_MEMMOVE_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_MEMMOVE # define LIBC_BUILD_MEMMOVE
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_MEMSET_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_MEMSET_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_MEMSET_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_MEMSET_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_MEMSET # define LIBC_BUILD_MEMSET
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRCAT_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRCAT_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRCAT_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRCAT_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRCAT # define LIBC_BUILD_STRCAT
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRCASECMP_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRCASECMP_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRCASECMP_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRCASECMP_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRCASECMP # define LIBC_BUILD_STRCASECMP
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRCHR_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRCHR_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRCHR_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRCHR_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRCHR # define LIBC_BUILD_STRCHR
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRCHRNUL_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRCHRNUL_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRCHRNUL_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRCHRNUL_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRCHRNUL # define LIBC_BUILD_STRCHRNUL
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRCMP_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRCMP_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRCMP_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRCMP_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRCMP # define LIBC_BUILD_STRCMP
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRCPY_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRCPY_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRCPY_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRCPY_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRCPY # define LIBC_BUILD_STRCPY
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRLCAT_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRLCAT_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRLCAT_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRLCAT_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRLCAT # define LIBC_BUILD_STRLCAT
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRLEN_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRLEN_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRLEN_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRLEN_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRLEN # define LIBC_BUILD_STRLEN
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRLCPY_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRLCPY_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRLCPY_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRLCPY_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRLCPY # define LIBC_BUILD_STRLCPY
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRNCASECMP_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRNCASECMP_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRNCASECMP_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRNCASECMP_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRNCASECMP # define LIBC_BUILD_STRNCASECMP
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRNCAT_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRNCAT_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRNCAT_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRNCAT_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRNCAT # define LIBC_BUILD_STRNCAT
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRNLEN_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRNLEN_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRNLEN_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRNLEN_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRNLEN # define LIBC_BUILD_STRNLEN
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRNCMP_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRNCMP_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRNCMP_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRNCMP_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRNCMP # define LIBC_BUILD_STRNCMP
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRNCPY_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRNCPY_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRNCPY_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRNCPY_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRNCPY # define LIBC_BUILD_STRNCPY
#endif #endif
#if defined(CONFIG_BUILD_FLAT) || \ #if ((!defined(CONFIG_LIBC_PREVENT_STRRCHR_USER) && !defined(__KERNEL__)) || \
((!defined(CONFIG_LIBC_PREVENT_STRRCHR_USER) && !defined(__KERNEL__)) || \
(!defined(CONFIG_LIBC_PREVENT_STRRCHR_KERNEL) && defined(__KERNEL__))) (!defined(CONFIG_LIBC_PREVENT_STRRCHR_KERNEL) && defined(__KERNEL__)))
# define LIBC_BUILD_STRRCHR # define LIBC_BUILD_STRRCHR
#endif #endif