From 65b5fb4f50af2912dc69b57f6ab53abe2137470c Mon Sep 17 00:00:00 2001 From: Fabian Freyer Date: Sun, 18 Feb 2018 14:04:45 +0000 Subject: [PATCH] tests: implement memset in multiboot libc kernel This is necessary for the tests to compile with clang --- tests/data/multiboot/libc.c | 10 ++++++++++ tests/data/multiboot/libc.h | 1 + 2 files changed, 11 insertions(+) diff --git a/tests/data/multiboot/libc.c b/tests/data/multiboot/libc.c index 6df9bda..43502f5 100644 --- a/tests/data/multiboot/libc.c +++ b/tests/data/multiboot/libc.c @@ -34,6 +34,16 @@ void* memcpy(void *dest, const void *src, int n) return dest; } +void* memset(void *b, int c, unsigned len) +{ + char *bb; + + for (bb = (char *)b; len--; ) + *bb++ = c; + + return (b); +} + static void print_char(char c) { outb(0xe9, c); diff --git a/tests/data/multiboot/libc.h b/tests/data/multiboot/libc.h index 04c9922..b16cf64 100644 --- a/tests/data/multiboot/libc.h +++ b/tests/data/multiboot/libc.h @@ -58,5 +58,6 @@ static inline void outb(uint16_t port, uint8_t data) void printf(const char *fmt, ...); void* memcpy(void *dest, const void *src, int n); +void* memset(void *b, int c, unsigned len); #endif