Linux Audio

Check our new training course

Loading...
v6.2
 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
27extern 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__)
43extern int _printk(const char *fmt, ...)
44	__attribute__ ((format (printf, 1, 2)));
45#else
46static inline int printk(const char *fmt, ...)
47{
48	return 0;
49}
50#endif
51
 
52extern int in_aton(char *str);
 
53extern size_t strlcpy(char *, const char *, size_t);
54extern size_t strlcat(char *, const char *, size_t);
55
56/* Copied from linux/compiler-gcc.h since we can't include it directly */
57#define barrier() __asm__ __volatile__("": : :"memory")
58
59#endif
v3.1
 
 1/* 
 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 3 * Licensed under the GPL
 4 */
 5
 6#ifndef __USER_H__
 7#define __USER_H__
 8
 9#include "kern_constants.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 */
20#ifdef __KERNEL__
21#include <linux/types.h>
22#else
23#include <stddef.h>
 
24#endif
25
26extern void panic(const char *fmt, ...)
27	__attribute__ ((format (printf, 1, 2)));
28
 
 
 
 
 
 
 
 
 
 
 
29#ifdef UML_CONFIG_PRINTK
30extern int printk(const char *fmt, ...)
 
31	__attribute__ ((format (printf, 1, 2)));
32#else
33static inline int printk(const char *fmt, ...)
34{
35	return 0;
36}
37#endif
38
39extern void schedule(void);
40extern int in_aton(char *str);
41extern int open_gdb_chan(void);
42extern size_t strlcpy(char *, const char *, size_t);
43extern size_t strlcat(char *, const char *, size_t);
 
 
 
44
45#endif