diff options
| author | Anup Patel <anup.patel@wdc.com> | 2019-01-18 10:28:58 +0530 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2019-01-18 10:47:30 +0530 |
| commit | ebfe23125666a11fd3dc14b85f5ca58b7f40276b (patch) | |
| tree | eacf671042d394bcb6e615cc9c7278c1349153b3 /platform/common/include | |
| parent | e0686ca844f6c7372edd353cffe08ddee5dcf5c9 (diff) | |
| download | opensbi-ebfe23125666a11fd3dc14b85f5ca58b7f40276b.tar.gz opensbi-ebfe23125666a11fd3dc14b85f5ca58b7f40276b.tar.bz2 opensbi-ebfe23125666a11fd3dc14b85f5ca58b7f40276b.zip | |
platform: Fix compile error caused by standard includes
Avoid using standard includes namely stdint.h, string.h, stdlib.h, etc.
All standard include except stddef.h give compilation error due
to differences in RISC-V toolchain configuration. Typically, the
compilation error is related to "gnu-stubs-lp64.h".
This patch fixes compile error caused by standard includes by
providing substitutes of definetions provided by standard includes
wherever required.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'platform/common/include')
| -rw-r--r-- | platform/common/include/plat/string.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/platform/common/include/plat/string.h b/platform/common/include/plat/string.h new file mode 100644 index 00000000..ab09f4ec --- /dev/null +++ b/platform/common/include/plat/string.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018 Western Digital Corporation or its affiliates. + * + * Authors: + * Atish Patra <atish.patra@wdc.com> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef __STRING_H__ +#define __STRING_H__ + +#include <sbi/sbi_types.h> + +int strcmp(const char *a, const char *b); + +size_t strlen(const char *str); + +size_t strnlen(const char *str, size_t count); + +char *strcpy(char *dest,const char *src); + +char *strncpy(char *dest, const char *src, size_t count); + +char *strchr(const char *s, int c); + +char *strrchr(const char *s, int c); + +void *memset(void *s,int c,size_t count); + +void *memcpy(void *dest, const void *src, size_t count); + +void *memmove(void *dest,const void *src, size_t count); + +int memcmp(const void *s1,const void *s2, size_t count); + +void *memchr(const void *s, int c, size_t count); + +#endif |
