]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/lib.c
f2a27eb6cdfcc34c56ebba0a2dbe0638f5e96650
[jailhouse.git] / hypervisor / lib.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013
5  *
6  * Authors:
7  *  Jan Kiszka <jan.kiszka@siemens.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  */
12
13 #include <jailhouse/string.h>
14 #include <jailhouse/types.h>
15
16 void *memset(void *s, int c, unsigned long n)
17 {
18         u8 *p = s;
19
20         while (n-- > 0)
21                 *p++ = c;
22         return s;
23 }
24
25 int strcmp(const char *s1, const char *s2)
26 {
27         while (*s1 == *s2) {
28                 if (*s1 == '\0')
29                         return 0;
30                 s1++;
31                 s2++;
32         }
33         return *(unsigned char *)s1 - *(unsigned char *)s2;
34 }