aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@linux.intel.com>2011-06-23 09:56:38 +0100
committerMatt Fleming <matt.fleming@linux.intel.com>2011-07-21 11:39:00 +0100
commit23a57f1c512755f2ffe08576a1f4482f0d76b58e (patch)
tree8bbdd1aa2af346ed6ec89e9d2030baa33c2e583c
parentaba10773b6fda96227f51cab74232d262e9801d8 (diff)
downloadefilinux-23a57f1c512755f2ffe08576a1f4482f0d76b58e.tar.gz
stdlib.h: Add memset and memcpy
Add a simple implementation of these standard library functions. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
-rw-r--r--stdlib.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/stdlib.h b/stdlib.h
index 1079e88..e32e84d 100644
--- a/stdlib.h
+++ b/stdlib.h
@@ -3,4 +3,20 @@
extern void *malloc(UINTN size);
+static inline void memset(char *dst, char ch, UINTN size)
+{
+ int i;
+
+ for (i = 0; i < size; i++)
+ dst[i] = ch;
+}
+
+static inline void memcpy(char *dst, char *src, UINTN size)
+{
+ int i;
+
+ for (i = 0; i < size; i++)
+ *dst++ = *src++;
+}
+
#endif /* __STDLIB_H__ */