mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
string: add strdup_const and kstrdup_const
Extend Linux compat by adding kstrdup_const(), backed by lib/string.c. This leverages U-Boots .rodata section on ARM64 to avoid pointlessly duplicating const strings. This is used by the Linux CCF_FULL port and may be useful elsewhere in U-Boot. Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
This commit is contained in:
@@ -104,6 +104,8 @@ size_t strcspn(const char *s, const char *reject);
|
||||
#ifndef __HAVE_ARCH_STRDUP
|
||||
extern char * strdup(const char *);
|
||||
extern char * strndup(const char *, size_t);
|
||||
extern const char *strdup_const(const char *s);
|
||||
extern void kfree_const(const void *x);
|
||||
#endif
|
||||
#ifndef __HAVE_ARCH_STRSWAB
|
||||
extern char * strswab(const char *);
|
||||
|
||||
Reference in New Issue
Block a user