RTEMS  5.1
kernel-rtems.h
1 /*
2  * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Dornierstr. 4
6  * 82178 Puchheim
7  * Germany
8  * <rtems@embedded-brains.de>
9  *
10  * Copyright 2016 Chris Johns <chrisj@rtems.org>
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifndef __LINUX_RTEMS_IMPL_H__
18 #define __LINUX_RTEMS_IMPL_H__
19 
20 #include <rtems.h>
21 #include <rtems/bspIo.h>
22 
23 static inline char *do_kmemdup(const char *s, size_t n)
24 {
25  char *dup = malloc(n + 1);
26 
27  if (dup != 0) {
28  dup[n] = '\0';
29  dup = memcpy(dup, s, n);
30  }
31 
32  return dup;
33 }
34 
35 /*
36  * Provide a private printk to avoid all the formatting warnings in the JFFS2 code.
37  */
38 static inline int jffs2_printk(const char* fmt, ...)
39 {
40  va_list ap;
41  int r;
42  va_start(ap, fmt);
43  r = vprintk(fmt, ap);
44  va_end(ap);
45  return r;
46 }
47 
48 #undef printk
49 #define printk jffs2_printk
50 
51 #endif /* __LINUX_RTEMS_IMPL_H__ */
int vprintk(const char *fmt, va_list ap)
Variable Argument printk()
Definition: vprintk.c:29
Interface to Kernel Print Methods.