summaryrefslogtreecommitdiff
path: root/include/util.h
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2015-01-07 11:03:51 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-08 00:38:13 +0000
commitdc1362ca82e72ac488bb25d308c97aaf733274fc (patch)
treede3023bc3c0c9362afaf30d030287f1df27722a4 /include/util.h
parent18d3bde7f89cb0bf62e3703d1954791dbb2a0df3 (diff)
downloadchrome-ec-dc1362ca82e72ac488bb25d308c97aaf733274fc.tar.gz
Queue: Add methods that accept a memcpy routine
These versions of the queue add and remove methods support using memcpy like routines to access regions of memory with specific requirements. In particular, this will allow for transfers between queues and USB packet RAM on the STM32 which has specific access requirements. This change also includes an update to the mem* util routines to make their prototypes compatible with C89 and POSIX standards. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Test USB Echo functionality on discovery-stm32f072 board to ensure that queues still function correctly. Change-Id: I557064d99abfc3e8cfc98099a1d94334a976550c Reviewed-on: https://chromium-review.googlesource.com/239217 Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org> Trybot-Ready: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'include/util.h')
-rw-r--r--include/util.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/util.h b/include/util.h
index e83e2fe05e..86c7a8dc0c 100644
--- a/include/util.h
+++ b/include/util.h
@@ -12,6 +12,8 @@
#include "compile_time_macros.h"
#include "panic.h"
+#include <stddef.h>
+
/**
* Trigger a debug exception if the condition
* is not verified at runtime.
@@ -88,12 +90,12 @@ int isdigit(int c);
int isspace(int c);
int isalpha(int c);
int isprint(int c);
-int memcmp(const void *s1, const void *s2, int len);
-void *memcpy(void *dest, const void *src, int len);
-void *memset(void *dest, int c, int len);
-void *memmove(void *dest, const void *src, int len);
+int memcmp(const void *s1, const void *s2, size_t len);
+void *memcpy(void *dest, const void *src, size_t len);
+void *memset(void *dest, int c, size_t len);
+void *memmove(void *dest, const void *src, size_t len);
int strcasecmp(const char *s1, const char *s2);
-int strncasecmp(const char *s1, const char *s2, int size);
+int strncasecmp(const char *s1, const char *s2, size_t size);
int strlen(const char *s);
/* Like strtol(), but for integers. */