Skip to content

Commit

Permalink
tests: implement memset in multiboot libc kernel
Browse files Browse the repository at this point in the history
This is necessary for the tests to compile with clang
  • Loading branch information
fabianfreyer committed Feb 18, 2018
1 parent 7a27d4a commit 65b5fb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/data/multiboot/libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions tests/data/multiboot/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 65b5fb4

Please sign in to comment.