[CRIU] [PATCH 1/2] cr: collect short integer aliases in the single place
Alexander Kartashov
alekskartashov at parallels.com
Sat Apr 5 05:08:19 PDT 2014
This patch moves the files arch/$ARCH/include/asm/int.h to
include/asm-generic/int.h and makes the types {u,s}{8,16,32}
be aliases of the fixed sized integer types [u]int{8,16,32}_t.
This makes it possible to use single set of integer typedefs
in all architectural ports.
Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
Cc: Cyrill Gorcunov <gorcunov at openvz.org>
---
arch/arm/include/asm/int.h | 17 ++++-------------
arch/arm/include/asm/types.h | 1 -
arch/x86/include/asm/int.h | 17 ++++-------------
include/asm-generic/int.h | 15 +++++++++++++++
4 files changed, 23 insertions(+), 27 deletions(-)
create mode 100644 include/asm-generic/int.h
diff --git a/arch/arm/include/asm/int.h b/arch/arm/include/asm/int.h
index 3af4fcb..642804e 100644
--- a/arch/arm/include/asm/int.h
+++ b/arch/arm/include/asm/int.h
@@ -1,15 +1,6 @@
-#ifndef __CR_INT_H__
-#define __CR_INT_H__
+#ifndef __CR_ASM_INT_H__
+#define __CR_ASM_INT_H__
-#include <stdint.h>
+#include "asm-generic/int.h"
-typedef uint64_t u64;
-typedef int64_t s64;
-typedef unsigned int u32;
-typedef signed int s32;
-typedef unsigned short u16;
-typedef signed short s16;
-typedef unsigned char u8;
-typedef signed char s8;
-
-#endif /* __CR_INT_H__ */
+#endif /* __CR_ASM_INT_H__ */
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
index 0b57ce8..e9aa636 100644
--- a/arch/arm/include/asm/types.h
+++ b/arch/arm/include/asm/types.h
@@ -1,7 +1,6 @@
#ifndef __CR_ASM_TYPES_H__
#define __CR_ASM_TYPES_H__
-#include <stdint.h>
#include <stdbool.h>
#include <signal.h>
#include "protobuf/core.pb-c.h"
diff --git a/arch/x86/include/asm/int.h b/arch/x86/include/asm/int.h
index 3af4fcb..642804e 100644
--- a/arch/x86/include/asm/int.h
+++ b/arch/x86/include/asm/int.h
@@ -1,15 +1,6 @@
-#ifndef __CR_INT_H__
-#define __CR_INT_H__
+#ifndef __CR_ASM_INT_H__
+#define __CR_ASM_INT_H__
-#include <stdint.h>
+#include "asm-generic/int.h"
-typedef uint64_t u64;
-typedef int64_t s64;
-typedef unsigned int u32;
-typedef signed int s32;
-typedef unsigned short u16;
-typedef signed short s16;
-typedef unsigned char u8;
-typedef signed char s8;
-
-#endif /* __CR_INT_H__ */
+#endif /* __CR_ASM_INT_H__ */
diff --git a/include/asm-generic/int.h b/include/asm-generic/int.h
new file mode 100644
index 0000000..ac3088d
--- /dev/null
+++ b/include/asm-generic/int.h
@@ -0,0 +1,15 @@
+#ifndef __CR_INT_H__
+#define __CR_INT_H__
+
+#include <stdint.h>
+
+typedef uint64_t u64;
+typedef int64_t s64;
+typedef uint32_t u32;
+typedef int32_t s32;
+typedef uint16_t u16;
+typedef int16_t s16;
+typedef uint8_t u8;
+typedef int8_t s8;
+
+#endif /* __CR_INT_H__ */
--
1.7.9.5
More information about the CRIU
mailing list