RTEMS 6.1-rc2
Loading...
Searching...
No Matches
kernel-rtems.h
1/*
2 * Copyright (c) 2013 embedded brains GmbH & Co. KG
3 *
4 * Copyright 2016 Chris Johns <chrisj@rtems.org>
5 *
6 * The license and distribution terms for this file may be
7 * found in the file LICENSE in this distribution or at
8 * http://www.rtems.org/license/LICENSE.
9 */
10
11#ifndef __LINUX_RTEMS_IMPL_H__
12#define __LINUX_RTEMS_IMPL_H__
13
14#include <rtems.h>
15#include <rtems/bspIo.h>
16
17static inline char *do_kmemdup(const char *s, size_t n)
18{
19 char *dup = malloc(n + 1);
20
21 if (dup != 0) {
22 dup[n] = '\0';
23 dup = memcpy(dup, s, n);
24 }
25
26 return dup;
27}
28
29/*
30 * Provide a private printk to avoid all the formatting warnings in the JFFS2 code.
31 */
32static inline int jffs2_printk(const char* fmt, ...)
33{
34 va_list ap;
35 int r;
36 va_start(ap, fmt);
37 r = vprintk(fmt, ap);
38 va_end(ap);
39 return r;
40}
41
42#undef printk
43#define printk jffs2_printk
44
45#endif /* __LINUX_RTEMS_IMPL_H__ */
This header file provides the kernel character input/output support API.
int vprintk(const char *fmt, va_list ap)
Outputs the characters defined by the format string and the variable argument list to the kernel char...
Definition: vprintk.c:43
This header file defines the RTEMS Classic API.