aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaf Hering <olh@suse.de>2004-09-14 14:24:48 +0000
committerH. Peter Anvin <hpa@zytor.com>2004-09-14 14:24:48 +0000
commit4d02057566c00e14ad01f9dc9b9c419ea6dca2fb (patch)
tree1446a1b9a814642e6bd116c1a49119806e412332
parent4e4060000cf68960402e05bd85b82b58596c94c8 (diff)
downloadklibc-4d02057566c00e14ad01f9dc9b9c419ea6dca2fb.tar.gz
Support __le* and __be* types used in the most recent kernelsklibc-0.174
-rw-r--r--include/klibc/compiler.h12
-rw-r--r--include/sys/types.h8
-rw-r--r--klibc/include/klibc/compiler.h12
-rw-r--r--klibc/include/sys/types.h8
4 files changed, 36 insertions, 4 deletions
diff --git a/include/klibc/compiler.h b/include/klibc/compiler.h
index a4637247f04aa..823996e7773cf 100644
--- a/include/klibc/compiler.h
+++ b/include/klibc/compiler.h
@@ -7,8 +7,6 @@
#ifndef _KLIBC_COMPILER_H
#define _KLIBC_COMPILER_H
-#define __user
-
/* Specific calling conventions */
/* __cdecl is used when we want varadic and non-varadic functions to have
the same binary calling convention. */
@@ -108,4 +106,14 @@
# define __unusedfunc
#endif
+/* It's all user space... */
+#define __user
+
+/* The bitwise attribute: disallow arithmetric operations */
+#ifdef __CHECKER__ /* sparse only */
+# define __bitwise __attribute__((bitwise))
+#else
+# define __bitwise
+#endif
+
#endif
diff --git a/include/sys/types.h b/include/sys/types.h
index 2e8a4cbd2ed33..ddec2429222d2 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -5,6 +5,7 @@
#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H
+#include <klibc/compiler.h>
#include <stddef.h>
#include <stdint.h>
@@ -88,6 +89,13 @@ typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
typedef uint64_t u_int64_t;
+typedef uint16_t __bitwise __le16;
+typedef uint16_t __bitwise __be16;
+typedef uint32_t __bitwise __le32;
+typedef uint32_t __bitwise __be32;
+typedef uint64_t __bitwise __le64;
+typedef uint64_t __bitwise __be64;
+
/*
* Some apps want this in <sys/types.h>
*/
diff --git a/klibc/include/klibc/compiler.h b/klibc/include/klibc/compiler.h
index a4637247f04aa..823996e7773cf 100644
--- a/klibc/include/klibc/compiler.h
+++ b/klibc/include/klibc/compiler.h
@@ -7,8 +7,6 @@
#ifndef _KLIBC_COMPILER_H
#define _KLIBC_COMPILER_H
-#define __user
-
/* Specific calling conventions */
/* __cdecl is used when we want varadic and non-varadic functions to have
the same binary calling convention. */
@@ -108,4 +106,14 @@
# define __unusedfunc
#endif
+/* It's all user space... */
+#define __user
+
+/* The bitwise attribute: disallow arithmetric operations */
+#ifdef __CHECKER__ /* sparse only */
+# define __bitwise __attribute__((bitwise))
+#else
+# define __bitwise
+#endif
+
#endif
diff --git a/klibc/include/sys/types.h b/klibc/include/sys/types.h
index 2e8a4cbd2ed33..ddec2429222d2 100644
--- a/klibc/include/sys/types.h
+++ b/klibc/include/sys/types.h
@@ -5,6 +5,7 @@
#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H
+#include <klibc/compiler.h>
#include <stddef.h>
#include <stdint.h>
@@ -88,6 +89,13 @@ typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
typedef uint64_t u_int64_t;
+typedef uint16_t __bitwise __le16;
+typedef uint16_t __bitwise __be16;
+typedef uint32_t __bitwise __le32;
+typedef uint32_t __bitwise __be32;
+typedef uint64_t __bitwise __le64;
+typedef uint64_t __bitwise __be64;
+
/*
* Some apps want this in <sys/types.h>
*/