[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] common: move Linux-inherited fixed width type decls to common header



commit 75e84d477234796b7b1bb3a39b02e9b3c8b3f7d8
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Aug 9 15:54:45 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Aug 9 15:54:45 2023 +0200

    common: move Linux-inherited fixed width type decls to common header
    
    Have these in one place, for all architectures to use. Also use the C99
    types as the "original" ones, and derive the Linux compatible ones
    (which we're trying to phase out). For __s<N>, seeing that no uses exist
    anymore, move them to a new Linux compatibility header (as an act of
    precaution - as said, we don't have any uses of these types right now).
    
    In some Flask sources inclusion of asm/byteorder.h needs moving later.
    
    No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 xen/arch/arm/include/asm/types.h   | 19 +++++--------------
 xen/arch/ppc/include/asm/types.h   | 11 -----------
 xen/arch/riscv/include/asm/types.h | 13 -------------
 xen/arch/x86/include/asm/types.h   | 11 -----------
 xen/include/xen/linux-compat.h     | 19 +++++++++++++++++++
 xen/include/xen/types.h            | 19 ++++++++++---------
 xen/xsm/flask/ss/conditional.c     |  3 ++-
 xen/xsm/flask/ss/ebitmap.c         |  4 +++-
 xen/xsm/flask/ss/policydb.c        |  4 +++-
 9 files changed, 42 insertions(+), 61 deletions(-)

diff --git a/xen/arch/arm/include/asm/types.h b/xen/arch/arm/include/asm/types.h
index 545a5e9d11..b0a34ea730 100644
--- a/xen/arch/arm/include/asm/types.h
+++ b/xen/arch/arm/include/asm/types.h
@@ -1,18 +1,8 @@
 #ifndef __ARM_TYPES_H__
 #define __ARM_TYPES_H__
 
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
 #if defined(CONFIG_ARM_32)
-typedef signed long long s64;
-typedef unsigned long long u64;
+
 typedef u32 vaddr_t;
 #define PRIvaddr PRIx32
 #if defined(CONFIG_PHYS_ADDR_T_32)
@@ -34,9 +24,9 @@ typedef u64 paddr_t;
 #endif
 typedef u32 register_t;
 #define PRIregister "08x"
-#elif defined (CONFIG_ARM_64)
-typedef signed long s64;
-typedef unsigned long u64;
+
+#elif defined(CONFIG_ARM_64)
+
 typedef u64 vaddr_t;
 #define PRIvaddr PRIx64
 typedef u64 paddr_t;
@@ -44,6 +34,7 @@ typedef u64 paddr_t;
 #define PRIpaddr "016lx"
 typedef u64 register_t;
 #define PRIregister "016lx"
+
 #endif
 
 #endif /* __ARM_TYPES_H__ */
diff --git a/xen/arch/ppc/include/asm/types.h b/xen/arch/ppc/include/asm/types.h
index cee08e111a..b62ae0e7ae 100644
--- a/xen/arch/ppc/include/asm/types.h
+++ b/xen/arch/ppc/include/asm/types.h
@@ -3,17 +3,6 @@
 #ifndef _ASM_PPC_TYPES_H
 #define _ASM_PPC_TYPES_H
 
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long s64;
-typedef unsigned long u64;
 typedef unsigned long paddr_t;
 #define INVALID_PADDR (~0UL)
 #define PRIpaddr "016lx"
diff --git a/xen/arch/riscv/include/asm/types.h 
b/xen/arch/riscv/include/asm/types.h
index ab222de337..59358fd698 100644
--- a/xen/arch/riscv/include/asm/types.h
+++ b/xen/arch/riscv/include/asm/types.h
@@ -3,19 +3,8 @@
 #ifndef __RISCV_TYPES_H__
 #define __RISCV_TYPES_H__
 
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
 #if defined(CONFIG_RISCV_32)
 
-typedef signed long long s64;
-typedef unsigned long long u64;
 typedef u32 vaddr_t;
 #define PRIvaddr PRIx32
 typedef u64 paddr_t;
@@ -26,8 +15,6 @@ typedef u32 register_t;
 
 #elif defined (CONFIG_RISCV_64)
 
-typedef signed long s64;
-typedef unsigned long u64;
 typedef u64 vaddr_t;
 #define PRIvaddr PRIx64
 typedef u64 paddr_t;
diff --git a/xen/arch/x86/include/asm/types.h b/xen/arch/x86/include/asm/types.h
index c9d2577165..4cbbc8eaa6 100644
--- a/xen/arch/x86/include/asm/types.h
+++ b/xen/arch/x86/include/asm/types.h
@@ -1,17 +1,6 @@
 #ifndef __X86_TYPES_H__
 #define __X86_TYPES_H__
 
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long s64;
-typedef unsigned long u64;
 typedef unsigned long paddr_t;
 #define INVALID_PADDR (~0UL)
 #define PRIpaddr "016lx"
diff --git a/xen/include/xen/linux-compat.h b/xen/include/xen/linux-compat.h
new file mode 100644
index 0000000000..2c7c046d4c
--- /dev/null
+++ b/xen/include/xen/linux-compat.h
@@ -0,0 +1,19 @@
+/******************************************************************************
+ * linux-compat.h
+ *
+ * Container for types and other definitions use in Linux (and hence in files
+ * we "steal" from there), but which shouldn't be used (anymore) in normal Xen
+ * files.
+ */
+
+#ifndef __XEN_LINUX_COMPAT_H__
+#define __XEN_LINUX_COMPAT_H__
+
+#include <xen/types.h>
+
+typedef int8_t  __s8;
+typedef int16_t __s16;
+typedef int32_t __s32;
+typedef int64_t __s64;
+
+#endif /* __XEN_LINUX_COMPAT_H__ */
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index c873c81ccf..e6fe35db99 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -4,6 +4,16 @@
 #include <xen/stdbool.h>
 #include <xen/stdint.h>
 
+/* Linux inherited types which are being phased out */
+typedef int8_t s8;
+typedef uint8_t u8, __u8;
+typedef int16_t s16;
+typedef uint16_t u16, __u16;
+typedef int32_t s32;
+typedef uint32_t u32, __u32;
+typedef int64_t s64;
+typedef uint64_t u64, __u64;
+
 #include <asm/types.h>
 
 typedef __SIZE_TYPE__ size_t;
@@ -40,15 +50,6 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 #define LONG_MIN        (-LONG_MAX - 1)
 #define ULONG_MAX       (~0UL)
 
-typedef uint8_t         __u8;
-typedef int8_t          __s8;
-typedef uint16_t        __u16;
-typedef int16_t         __s16;
-typedef uint32_t        __u32;
-typedef int32_t         __s32;
-typedef uint64_t        __u64;
-typedef int64_t         __s64;
-
 typedef __u16 __le16;
 typedef __u16 __be16;
 typedef __u32 __le32;
diff --git a/xen/xsm/flask/ss/conditional.c b/xen/xsm/flask/ss/conditional.c
index e74fc01746..d314f772b4 100644
--- a/xen/xsm/flask/ss/conditional.c
+++ b/xen/xsm/flask/ss/conditional.c
@@ -9,7 +9,6 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@xxxxxxxxxxxxxx> */
 
-#include <asm/byteorder.h>
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/errno.h>
@@ -17,6 +16,8 @@
 #include <xen/spinlock.h>
 #include <xen/xmalloc.h>
 
+#include <asm/byteorder.h>
+
 #include "security.h"
 #include "conditional.h"
 
diff --git a/xen/xsm/flask/ss/ebitmap.c b/xen/xsm/flask/ss/ebitmap.c
index e1d0a586a7..1db69d9ad1 100644
--- a/xen/xsm/flask/ss/ebitmap.c
+++ b/xen/xsm/flask/ss/ebitmap.c
@@ -10,12 +10,14 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@xxxxxxxxxxxxxx> */
 
-#include <asm/byteorder.h>
 #include <xen/lib.h>
 #include <xen/xmalloc.h>
 #include <xen/errno.h>
 #include <xen/spinlock.h>
 #include <xen/bitmap.h>
+
+#include <asm/byteorder.h>
+
 #include "ebitmap.h"
 #include "policydb.h"
 
diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 7f232f92fa..5af45fdc27 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -22,12 +22,14 @@
 
 /* Ported to Xen 3.0, George Coker, <gscoker@xxxxxxxxxxxxxx> */
 
-#include <asm/byteorder.h>
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/string.h>
 #include <xen/errno.h>
+
+#include <asm/byteorder.h>
+
 #include <conditional.h>
 #include "security.h"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.