diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/qboot/include/string.h | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/qboot/include/string.h')
-rw-r--r-- | roms/qboot/include/string.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/roms/qboot/include/string.h b/roms/qboot/include/string.h new file mode 100644 index 000000000..39decfab1 --- /dev/null +++ b/roms/qboot/include/string.h @@ -0,0 +1,40 @@ +#ifndef BIOS_STRING_H +#define BIOS_STRING_H + +#include <stddef.h> +#include <stdint.h> + +unsigned long strlen(const char *buf); +char *strcat(char *dest, const char *src); +char *strcpy(char *dest, const char *src); +int strcmp(const char *a, const char *b); +char *strchr(const char *s, int c); +char *strstr(const char *s1, const char *s2); +int memcmp(const void *s1, const void *s2, size_t n); +void *memmove(void *dest, const void *src, size_t n); +void *memchr(const void *s, int c, size_t n); +uint8_t csum8(uint8_t *buf, uint32_t len); + +static inline void *memset(void *s, int c, size_t n) +{ + return __builtin_memset(s, c, n); +} + +static inline void *memcpy(void *dest, const void *src, size_t n) +{ + return __builtin_memcpy(dest, src, n); +} + +void *malloc_align(int n, int align); +void *malloc_fseg_align(int n, int align); + +static inline void *malloc(int n) +{ + return malloc_align(n, 16); +} + +static inline void *malloc_fseg(int n) +{ + return malloc_fseg_align(n, 16); +} +#endif |