summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorNadim Taha <ntaha@google.com>2017-02-02 18:48:03 -0800
committerNadim Taha <ntaha@chromium.org>2017-02-17 01:46:31 +0000
commit69c3fc2378ee9026277c1cbaf6e8aff0b99ecf46 (patch)
tree548d9660cb450bdb29cb08be0fdaff740854d276 /builtin
parent61a5649e302915c617f4f70a1b3211805f363ed8 (diff)
downloadchrome-ec-69c3fc2378ee9026277c1cbaf6e8aff0b99ecf46.tar.gz
builtin: Expands string.h / stdint.h
Declares UINT8_MAX, INT8_MAX and defines strnlen(), strncpy(), strncmp() & memchr(). Needed by a module I'm integrating into cr51. BRANCH=none BUG=none TEST=make buildall -j Change-Id: I894b0297216df1b945b36fc77cd3bc5c4ef8aa2b Signed-off-by: Nadim Taha <ntaha@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/436786 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/stdint.h7
-rw-r--r--builtin/string.h5
2 files changed, 12 insertions, 0 deletions
diff --git a/builtin/stdint.h b/builtin/stdint.h
index f80a46f1a5..b82268b409 100644
--- a/builtin/stdint.h
+++ b/builtin/stdint.h
@@ -23,6 +23,13 @@ typedef unsigned int uintptr_t;
typedef uint8_t uint_least8_t;
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127U)
+#endif
+
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
diff --git a/builtin/string.h b/builtin/string.h
index 50a6d54664..21159a5eef 100644
--- a/builtin/string.h
+++ b/builtin/string.h
@@ -14,5 +14,10 @@ int memcmp(const void *s1, const void *s2, size_t len);
void *memcpy(void *dest, const void *src, size_t len);
void *memmove(void *dest, const void *src, size_t n);
void *memset(void *dest, int c, size_t len);
+void *memchr(const void *buffer, int c, size_t n);
+
+size_t strnlen(const char *s, size_t maxlen);
+char *strncpy(char *dest, const char *src, size_t n);
+int strncmp(const char *s1, const char *s2, size_t n);
#endif /* __CROS_EC_STRINGS_H__ */