EmbeddedPkg/libfdt: Add strcmp and strncpy to libfdt_env.h

OpenSBI has started using those in v0.9. See:
https://github.com/riscv/opensbi/blob/v0.9/lib/utils/fdt/fdt_domain.c

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Anup Patel <anup.patel@wdc.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Acked-by: Leif Lindholm <leif@nuviainc.com>
This commit is contained in:
Abner Chang 2021-08-05 12:52:39 +08:00 committed by mergify[bot]
parent 6355287206
commit 9abc60f9f7
1 changed files with 8 additions and 0 deletions

View File

@ -76,8 +76,16 @@ static inline size_t strnlen (const char* str, size_t strsz ) {
return AsciiStrnLenS (str, strsz);
}
static inline size_t strcmp (const char* str1, const char* str2) {
return AsciiStrCmp (str1, str2);
}
static inline size_t strncmp (const char* str1, const char* str2, size_t strsz ) {
return AsciiStrnCmp (str1, str2, strsz);
}
static inline size_t strncpy (char* dest, const char* source, size_t dest_max) {
return AsciiStrCpyS (dest, dest_max, source);
}
#endif /* _LIBFDT_ENV_H */