blob: 0142ea8e7bcd4193705c355bec876eafbcd604af [file] [log] [blame]
Thomas Huth90806fe2017-07-12 14:49:43 +02001/*
2 * libc-style definitions and functions
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#ifndef S390_CCW_LIBC_H
11#define S390_CCW_LIBC_H
12
13typedef long size_t;
14typedef int bool;
15typedef unsigned char uint8_t;
16typedef unsigned short uint16_t;
17typedef unsigned int uint32_t;
18typedef unsigned long long uint64_t;
19
20static inline void *memset(void *s, int c, size_t n)
21{
22 int i;
23 unsigned char *p = s;
24
25 for (i = 0; i < n; i++) {
26 p[i] = c;
27 }
28
29 return s;
30}
31
32static inline void *memcpy(void *s1, const void *s2, size_t n)
33{
34 uint8_t *dest = s1;
35 const uint8_t *src = s2;
36 int i;
37
38 for (i = 0; i < n; i++) {
39 dest[i] = src[i];
40 }
41
42 return s1;
43}
44
45#endif