Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:17

0001 /*
0002  * Copyright (c) 2013 embedded brains GmbH & Co. KG
0003  *
0004  * Copyright 2016 Chris Johns <chrisj@rtems.org>
0005  *
0006  * The license and distribution terms for this file may be
0007  * found in the file LICENSE in this distribution or at
0008  * http://www.rtems.org/license/LICENSE.
0009  */
0010 
0011 #ifndef __LINUX_RTEMS_IMPL_H__
0012 #define __LINUX_RTEMS_IMPL_H__
0013 
0014 #include <rtems.h>
0015 #include <rtems/bspIo.h>
0016 
0017 static inline char *do_kmemdup(const char *s, size_t n)
0018 {
0019     char *dup = malloc(n + 1);
0020 
0021     if (dup != 0) {
0022         dup[n] = '\0';
0023         dup = memcpy(dup, s, n);
0024     }
0025 
0026     return dup;
0027 }
0028 
0029 /*
0030  * Provide a private printk to avoid all the formatting warnings in the JFFS2 code.
0031  */
0032 static inline int jffs2_printk(const char* fmt, ...)
0033 {
0034     va_list ap;
0035     int r;
0036     va_start(ap, fmt);
0037     r = vprintk(fmt, ap);
0038     va_end(ap);
0039     return r;
0040 }
0041 
0042 #undef printk
0043 #define printk jffs2_printk
0044 
0045 #endif /* __LINUX_RTEMS_IMPL_H__ */