~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/um/include/shared/user.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /* 
  3  * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  4  */
  5 
  6 #ifndef __USER_H__
  7 #define __USER_H__
  8 
  9 #include <generated/asm-offsets.h>
 10 
 11 /*
 12  * The usual definition - copied here because the kernel provides its own,
 13  * fancier, type-safe, definition.  Using that one would require
 14  * copying too much infrastructure for my taste, so userspace files
 15  * get less checking than kernel files.
 16  */
 17 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 18 
 19 /* This is to get size_t and NULL */
 20 #ifndef __UM_HOST__
 21 #include <linux/types.h>
 22 #else
 23 #include <stddef.h>
 24 #include <sys/types.h>
 25 #endif
 26 
 27 extern void panic(const char *fmt, ...)
 28         __attribute__ ((format (printf, 1, 2)));
 29 
 30 /* Requires preincluding include/linux/kern_levels.h */
 31 #define UM_KERN_EMERG   KERN_EMERG
 32 #define UM_KERN_ALERT   KERN_ALERT
 33 #define UM_KERN_CRIT    KERN_CRIT
 34 #define UM_KERN_ERR     KERN_ERR
 35 #define UM_KERN_WARNING KERN_WARNING
 36 #define UM_KERN_NOTICE  KERN_NOTICE
 37 #define UM_KERN_INFO    KERN_INFO
 38 #define UM_KERN_DEBUG   KERN_DEBUG
 39 #define UM_KERN_CONT    KERN_CONT
 40 
 41 #ifdef UML_CONFIG_PRINTK
 42 #define printk(...) _printk(__VA_ARGS__)
 43 extern int _printk(const char *fmt, ...)
 44         __attribute__ ((format (printf, 1, 2)));
 45 extern void print_hex_dump(const char *level, const char *prefix_str,
 46                            int prefix_type, int rowsize, int groupsize,
 47                            const void *buf, size_t len, _Bool ascii);
 48 #else
 49 static inline int printk(const char *fmt, ...)
 50 {
 51         return 0;
 52 }
 53 static inline void print_hex_dump(const char *level, const char *prefix_str,
 54                                   int prefix_type, int rowsize, int groupsize,
 55                                   const void *buf, size_t len, _Bool ascii)
 56 {
 57 }
 58 #endif
 59 
 60 extern int in_aton(char *str);
 61 extern size_t strlcat(char *, const char *, size_t);
 62 extern size_t sized_strscpy(char *, const char *, size_t);
 63 #define strscpy(dst, src)       sized_strscpy(dst, src, sizeof(dst))
 64 
 65 /* Copied from linux/compiler-gcc.h since we can't include it directly */
 66 #define barrier() __asm__ __volatile__("": : :"memory")
 67 
 68 #endif
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php