diff options
| author | Rasmus Villemoes <[email protected]> | 2025-09-19 12:10:01 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-09-26 11:55:13 -0600 |
| commit | d95706158203db0b2281e134e8dfbad87e3d668c (patch) | |
| tree | 8ae889112abfd841b05d2c35f509e47ed233212d /include | |
| parent | 2ef6c17f7f46a908e99e24de53d2c153dc1972ab (diff) | |
_exports.h: export standard memory/string handling functions
The current list of exported functions lacks quite a few bog-standard C
library functions that we might as well expose, since U-Boot certainly
has them implemented anyway. There's no reason a standalone
application should have its own strlen() implementation or link in a
copy from some tiny libc.
For a customer's standalone app, this means it goes from 95K to 10K.
More importantly, we can ditch the custom toolchain including a
newlibc used to build the standalone app and just use the same
toolchain as used to build u-boot itself.
Signed-off-by: Rasmus Villemoes <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/_exports.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/_exports.h b/include/_exports.h index f1b11c1e380..a23fc001421 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -23,6 +23,8 @@ EXPORT_FUNC(irq_free_handler, void, free_hdlr, int) #endif EXPORT_FUNC(malloc, void *, malloc, size_t) + EXPORT_FUNC(realloc, void *, realloc, void *, size_t) + EXPORT_FUNC(calloc, void *, calloc, size_t, size_t) #if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE) EXPORT_FUNC(free, void, free, void *) #endif @@ -43,9 +45,21 @@ const char *, char **, unsigned int) EXPORT_FUNC(ustrtoull, unsigned long long, ustrtoull, const char *, char **, unsigned int) + EXPORT_FUNC(memcmp, int, memcmp, const void *, const void *, size_t) + EXPORT_FUNC(memcpy, void *, memcpy, void *, const void *, size_t) + EXPORT_FUNC(memmove, void *, memmove, void *, const void *, size_t) EXPORT_FUNC(memset, void *, memset, void *, int, size_t) + EXPORT_FUNC(strchr, char *, strchr, const char *cs, int c) + EXPORT_FUNC(strlen, size_t, strlen, const char *s) + EXPORT_FUNC(strncmp, int, strncmp, const char *cs, const char *ct, size_t n) + EXPORT_FUNC(strncpy, char *, strncpy, char *dest, const char *src, size_t n) + EXPORT_FUNC(strnlen, size_t, strnlen, const char *s, size_t n) EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct) EXPORT_FUNC(strcpy, char *, strcpy, char *dest, const char *src) + EXPORT_FUNC(sprintf, int, sprintf, char *, const char *, ...) + EXPORT_FUNC(snprintf, int, snprintf, char *, size_t, const char *, ...) + EXPORT_FUNC(vsprintf, int, vsprintf, char *, const char *, va_list) + EXPORT_FUNC(vsnprintf, int, vsnprintf, char *, size_t, const char *, va_list) #if defined(CONFIG_CMD_I2C) && CONFIG_IS_ENABLED(SYS_I2C_LEGACY) EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int) EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int) |
