* [PATCH] xen: kill __u*/__s* integer types
@ 2012-01-20 14:05 Christoph Egger
2012-01-20 14:36 ` Jan Beulich
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Egger @ 2012-01-20 14:05 UTC (permalink / raw)
To: xen-devel@lists.xensource.com
[-- Attachment #1: Type: text/plain, Size: 413 bytes --]
Kill __u*/__s* integer types and use c99 integer types instead.
Cleanup <asm-x86/types.h>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_type.diff --]
[-- Type: text/plain, Size: 31590 bytes --]
diff -r 87854d3bed93 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce.h Fri Jan 20 15:01:35 2012 +0100
@@ -189,25 +189,25 @@ static inline int mce_bank_msr(uint32_t
/* Fields are zero when not available */
struct mce {
- __u64 status;
- __u64 misc;
- __u64 addr;
- __u64 mcgstatus;
- __u64 ip;
- __u64 tsc; /* cpu time stamp counter */
- __u64 time; /* wall time_t when error was detected */
- __u8 cpuvendor; /* cpu vendor as encoded in system.h */
- __u8 inject_flags; /* software inject flags */
- __u16 pad;
- __u32 cpuid; /* CPUID 1 EAX */
- __u8 cs; /* code segment */
- __u8 bank; /* machine check bank */
- __u8 cpu; /* cpu number; obsolete; use extcpu now */
- __u8 finished; /* entry is valid */
- __u32 extcpu; /* linux cpu number that detected the error */
- __u32 socketid; /* CPU socket ID */
- __u32 apicid; /* CPU initial apic ID */
- __u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */
+ uint64_t status;
+ uint64_t misc;
+ uint64_t addr;
+ uint64_t mcgstatus;
+ uint64_t ip;
+ uint64_t tsc; /* cpu time stamp counter */
+ uint64_t time; /* wall time_t when error was detected */
+ uint8_t cpuvendor; /* cpu vendor as encoded in system.h */
+ uint8_t inject_flags; /* software inject flags */
+ uint16_t pad;
+ uint32_t cpuid; /* CPUID 1 EAX */
+ uint8_t cs; /* code segment */
+ uint8_t bank; /* machine check bank */
+ uint8_t cpu; /* cpu number; obsolete; use extcpu now */
+ uint8_t finished; /* entry is valid */
+ uint32_t extcpu; /* linux cpu number that detected the error */
+ uint32_t socketid; /* CPU socket ID */
+ uint32_t apicid; /* CPU initial apic ID */
+ uint64_t mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */
};
extern int apei_write_mce(struct mce *m);
diff -r 87854d3bed93 xen/arch/x86/oprofile/nmi_int.c
--- a/xen/arch/x86/oprofile/nmi_int.c Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/arch/x86/oprofile/nmi_int.c Fri Jan 20 15:01:35 2012 +0100
@@ -295,7 +295,7 @@ void nmi_stop(void)
static int __init p4_init(char ** cpu_type)
{
- __u8 cpu_model = current_cpu_data.x86_model;
+ uint8_t cpu_model = current_cpu_data.x86_model;
if ((cpu_model > 6) || (cpu_model == 5)) {
printk("xenoprof: Initialization failed. "
@@ -341,7 +341,7 @@ custom_param("cpu_type", force_cpu_type)
static int __init ppro_init(char ** cpu_type)
{
- __u8 cpu_model = current_cpu_data.x86_model;
+ uint8_t cpu_model = current_cpu_data.x86_model;
if (force_arch_perfmon && cpu_has_arch_perfmon)
return 0;
@@ -399,9 +399,9 @@ static int __init arch_perfmon_init(char
static int __init nmi_init(void)
{
- __u8 vendor = current_cpu_data.x86_vendor;
- __u8 family = current_cpu_data.x86;
- __u8 _model = current_cpu_data.x86_model;
+ uint8_t vendor = current_cpu_data.x86_vendor;
+ uint8_t family = current_cpu_data.x86;
+ uint8_t _model = current_cpu_data.x86_model;
if (!cpu_has_apic) {
printk("xenoprof: Initialization failed. No APIC\n");
diff -r 87854d3bed93 xen/include/asm-x86/byteorder.h
--- a/xen/include/asm-x86/byteorder.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/asm-x86/byteorder.h Fri Jan 20 15:01:35 2012 +0100
@@ -4,17 +4,17 @@
#include <asm/types.h>
#include <xen/compiler.h>
-static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+static inline __attribute_const__ uint32_t ___arch__swab32(uint32_t x)
{
asm("bswap %0" : "=r" (x) : "0" (x));
return x;
}
-static inline __attribute_const__ __u64 ___arch__swab64(__u64 val)
+static inline __attribute_const__ uint64_t ___arch__swab64(uint64_t val)
{
union {
- struct { __u32 a,b; } s;
- __u64 u;
+ struct { uint32_t a,b; } s;
+ uint64_t u;
} v;
v.u = val;
asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
diff -r 87854d3bed93 xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/asm-x86/io_apic.h Fri Jan 20 15:01:35 2012 +0100
@@ -91,7 +91,7 @@ enum ioapic_irq_destination_types {
};
struct IO_APIC_route_entry {
- __u32 vector : 8,
+ uint32_t vector : 8,
delivery_mode : 3, /* 000: FIXED
* 001: lowest prio
* 111: ExtINT
@@ -104,19 +104,19 @@ struct IO_APIC_route_entry {
mask : 1, /* 0: enabled, 1: disabled */
__reserved_2 : 15;
- union { struct { __u32
+ union { struct { uint32_t
__reserved_1 : 24,
physical_dest : 4,
__reserved_2 : 4;
} physical;
- struct { __u32
+ struct { uint32_t
__reserved_1 : 24,
logical_dest : 8;
} logical;
/* used when Interrupt Remapping with EIM is enabled */
- __u32 dest32;
+ uint32_t dest32;
} dest;
} __attribute__ ((packed));
diff -r 87854d3bed93 xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/asm-x86/msi.h Fri Jan 20 15:01:35 2012 +0100
@@ -90,12 +90,12 @@ extern unsigned int pci_msix_get_table_l
struct msi_desc {
struct msi_attrib {
- __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */
- __u8 maskbit : 1; /* mask-pending bit supported ? */
- __u8 masked : 1;
- __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */
- __u8 pos; /* Location of the msi capability */
- __u16 entry_nr; /* specific enabled entry */
+ uint8_t type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */
+ uint8_t maskbit : 1; /* mask-pending bit supported ? */
+ uint8_t masked : 1;
+ uint8_t is_64 : 1; /* Address size: 0=32bit 1=64bit */
+ uint8_t pos; /* Location of the msi capability */
+ uint16_t entry_nr; /* specific enabled entry */
} msi_attrib;
struct list_head list;
@@ -175,19 +175,19 @@ int msi_free_irq(struct msi_desc *entry)
struct msg_data {
#if defined(__LITTLE_ENDIAN_BITFIELD)
- __u32 vector : 8;
- __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */
- __u32 reserved_1 : 3;
- __u32 level : 1; /* 0: deassert | 1: assert */
- __u32 trigger : 1; /* 0: edge | 1: level */
- __u32 reserved_2 : 16;
+ uint32_t vector : 8;
+ uint32_t delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */
+ uint32_t reserved_1 : 3;
+ uint32_t level : 1; /* 0: deassert | 1: assert */
+ uint32_t trigger : 1; /* 0: edge | 1: level */
+ uint32_t reserved_2 : 16;
#elif defined(__BIG_ENDIAN_BITFIELD)
- __u32 reserved_2 : 16;
- __u32 trigger : 1; /* 0: edge | 1: level */
- __u32 level : 1; /* 0: deassert | 1: assert */
- __u32 reserved_1 : 3;
- __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */
- __u32 vector : 8;
+ uint32_t reserved_2 : 16;
+ uint32_t trigger : 1; /* 0: edge | 1: level */
+ uint32_t level : 1; /* 0: deassert | 1: assert */
+ uint32_t reserved_1 : 3;
+ uint32_t delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */
+ uint32_t vector : 8;
#else
#error "Bitfield endianness not defined! Check your byteorder.h"
#endif
@@ -197,26 +197,26 @@ struct msg_address {
union {
struct {
#if defined(__LITTLE_ENDIAN_BITFIELD)
- __u32 reserved_1 : 2;
- __u32 dest_mode : 1; /*0:physic | 1:logic */
- __u32 redirection_hint: 1; /*0: dedicated CPU
+ uint32_t reserved_1 : 2;
+ uint32_t dest_mode : 1; /*0:physic | 1:logic */
+ uint32_t redirection_hint: 1; /*0: dedicated CPU
1: lowest priority */
- __u32 reserved_2 : 4;
- __u32 dest_id : 24; /* Destination ID */
+ uint32_t reserved_2 : 4;
+ uint32_t dest_id : 24; /* Destination ID */
#elif defined(__BIG_ENDIAN_BITFIELD)
- __u32 dest_id : 24; /* Destination ID */
- __u32 reserved_2 : 4;
- __u32 redirection_hint: 1; /*0: dedicated CPU
- 1: lowest priority */
- __u32 dest_mode : 1; /*0:physic | 1:logic */
- __u32 reserved_1 : 2;
+ uint32_t dest_id : 24; /* Destination ID */
+ uint32_t reserved_2 : 4;
+ uint32_t redirection_hint: 1; /*0: dedicated CPU
+ 1: lowest priority */
+ uint32_t dest_mode : 1; /*0:physic | 1:logic */
+ uint32_t reserved_1 : 2;
#else
#error "Bitfield endianness not defined! Check your byteorder.h"
#endif
}u;
- __u32 value;
+ uint32_t value;
}lo_address;
- __u32 hi_address;
+ uint32_t hi_address;
} __attribute__ ((packed));
void msi_compose_msg(struct irq_desc *, struct msi_msg *);
diff -r 87854d3bed93 xen/include/asm-x86/msr.h
--- a/xen/include/asm-x86/msr.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/asm-x86/msr.h Fri Jan 20 15:01:35 2012 +0100
@@ -27,11 +27,11 @@
: /* no outputs */ \
: "c" (msr), "a" (val1), "d" (val2))
-static inline void wrmsrl(unsigned int msr, __u64 val)
+static inline void wrmsrl(unsigned int msr, uint64_t val)
{
- __u32 lo, hi;
- lo = (__u32)val;
- hi = (__u32)(val >> 32);
+ uint32_t lo, hi;
+ lo = (uint32_t)val;
+ hi = (uint32_t)(val >> 32);
wrmsr(msr, lo, hi);
}
diff -r 87854d3bed93 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/asm-x86/processor.h Fri Jan 20 15:01:35 2012 +0100
@@ -162,10 +162,10 @@ struct vcpu;
#endif
struct cpuinfo_x86 {
- __u8 x86; /* CPU family */
- __u8 x86_vendor; /* CPU vendor */
- __u8 x86_model;
- __u8 x86_mask;
+ uint8_t x86; /* CPU family */
+ uint8_t x86_vendor; /* CPU vendor */
+ uint8_t x86_model;
+ uint8_t x86_mask;
int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */
unsigned int x86_capability[NCAPINTS];
char x86_vendor_id[16];
@@ -173,10 +173,10 @@ struct cpuinfo_x86 {
int x86_cache_size; /* in KB - valid for CPUS which support this call */
int x86_cache_alignment; /* In bytes */
int x86_power;
- __u32 x86_max_cores; /* cpuid returned max cores value */
- __u32 booted_cores; /* number of cores as seen by OS */
- __u32 x86_num_siblings; /* cpuid logical cpus per chip value */
- __u32 apicid;
+ uint32_t x86_max_cores; /* cpuid returned max cores value */
+ uint32_t booted_cores; /* number of cores as seen by OS */
+ uint32_t x86_num_siblings; /* cpuid logical cpus per chip value */
+ uint32_t apicid;
int phys_proc_id; /* package ID of each logical CPU */
int cpu_core_id; /* core ID of each logical CPU*/
int compute_unit_id; /* AMD compute unit ID of each logical CPU */
diff -r 87854d3bed93 xen/include/asm-x86/types.h
--- a/xen/include/asm-x86/types.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/asm-x86/types.h Fri Jan 20 15:01:35 2012 +0100
@@ -5,53 +5,47 @@
#include <xen/config.h>
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
+typedef __signed__ char int8_t;
+typedef unsigned char uint8_t;
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
+typedef __signed__ short int16_t;
+typedef unsigned short uint16_t;
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-#if defined(__i386__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#elif defined(__x86_64__)
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-#endif
-#endif
-
-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__ int int32_t;
+typedef unsigned int uint32_t;
#if defined(__i386__)
-typedef signed long long s64;
-typedef unsigned long long u64;
-typedef u64 paddr_t;
+typedef __signed__ long long int64_t;
+typedef unsigned long long uint64_t;
#define INVALID_PADDR (~0ULL)
#define PRIpaddr "016llx"
#elif defined(__x86_64__)
-typedef signed long s64;
-typedef unsigned long u64;
-typedef unsigned long paddr_t;
+typedef __signed__ long int64_t;
+typedef unsigned long uint64_t;
#define INVALID_PADDR (~0UL)
#define PRIpaddr "016lx"
#endif
+typedef uint64_t paddr_t;
+
+/* Linux types */
+typedef int8_t s8;
+typedef uint8_t u8;
+
+typedef int16_t s16;
+typedef uint16_t u16;
+
+typedef int32_t s32;
+typedef uint32_t u32;
+
+typedef int64_t s64;
+typedef uint64_t u64;
+
#if defined(__SIZE_TYPE__)
typedef __SIZE_TYPE__ size_t;
#elif defined(__i386__)
typedef unsigned int size_t;
-#else
+#elif defined(__x86_64__)
typedef unsigned long size_t;
#endif
diff -r 87854d3bed93 xen/include/xen/bitops.h
--- a/xen/include/xen/bitops.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/xen/bitops.h Fri Jan 20 15:01:35 2012 +0100
@@ -77,9 +77,9 @@ static __inline__ int generic_fls(int x)
#include <asm/bitops.h>
-static inline int generic_fls64(__u64 x)
+static inline int generic_fls64(uint64_t x)
{
- __u32 h = x >> 32;
+ uint32_t h = x >> 32;
if (h)
return fls(x) + 32;
return fls(x);
@@ -132,7 +132,7 @@ static inline unsigned int generic_hweig
return (res & 0x0F) + ((res >> 4) & 0x0F);
}
-static inline unsigned long generic_hweight64(__u64 w)
+static inline unsigned long generic_hweight64(uint64_t w)
{
#if BITS_PER_LONG < 64
return generic_hweight32((unsigned int)(w >> 32)) +
@@ -159,7 +159,7 @@ static inline unsigned long hweight_long
* @word: value to rotate
* @shift: bits to roll
*/
-static inline __u32 rol32(__u32 word, unsigned int shift)
+static inline uint32_t rol32(uint32_t word, unsigned int shift)
{
return (word << shift) | (word >> (32 - shift));
}
@@ -170,7 +170,7 @@ static inline __u32 rol32(__u32 word, un
* @word: value to rotate
* @shift: bits to roll
*/
-static inline __u32 ror32(__u32 word, unsigned int shift)
+static inline uint32_t ror32(uint32_t word, unsigned int shift)
{
return (word >> shift) | (word << (32 - shift));
}
diff -r 87854d3bed93 xen/include/xen/byteorder/little_endian.h
--- a/xen/include/xen/byteorder/little_endian.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/xen/byteorder/little_endian.h Fri Jan 20 15:01:35 2012 +0100
@@ -11,78 +11,78 @@
#include <xen/types.h>
#include <xen/byteorder/swab.h>
-#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
-#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
-#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
-#define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
-#define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
-#define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
+#define __constant_cpu_to_le64(x) ((__force __le64)(uint64_t)(x))
+#define __constant_le64_to_cpu(x) ((__force uint64_t)(__le64)(x))
+#define __constant_cpu_to_le32(x) ((__force __le32)(uint32_t)(x))
+#define __constant_le32_to_cpu(x) ((__force uint32_t)(__le32)(x))
+#define __constant_cpu_to_le16(x) ((__force __le16)(uint16_t)(x))
+#define __constant_le16_to_cpu(x) ((__force uint16_t)(__le16)(x))
#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
-#define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
+#define __constant_be64_to_cpu(x) ___constant_swab64((__force uint64_t)(__be64)(x))
#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
-#define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
+#define __constant_be32_to_cpu(x) ___constant_swab32((__force uint32_t)(__be32)(x))
#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
-#define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
-#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
-#define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
-#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
-#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
-#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
-#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
+#define __constant_be16_to_cpu(x) ___constant_swab16((__force uint16_t)(__be16)(x))
+#define __cpu_to_le64(x) ((__force __le64)(uint64_t)(x))
+#define __le64_to_cpu(x) ((__force uint64_t)(__le64)(x))
+#define __cpu_to_le32(x) ((__force __le32)(uint32_t)(x))
+#define __le32_to_cpu(x) ((__force uint32_t)(__le32)(x))
+#define __cpu_to_le16(x) ((__force __le16)(uint16_t)(x))
+#define __le16_to_cpu(x) ((__force uint16_t)(__le16)(x))
#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
-#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
+#define __be64_to_cpu(x) __swab64((__force uint64_t)(__be64)(x))
#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
-#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
+#define __be32_to_cpu(x) __swab32((__force uint32_t)(__be32)(x))
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
-#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
+#define __be16_to_cpu(x) __swab16((__force uint16_t)(__be16)(x))
-static inline __le64 __cpu_to_le64p(const __u64 *p)
+static inline __le64 __cpu_to_le64p(const uint64_t *p)
{
return (__force __le64)*p;
}
-static inline __u64 __le64_to_cpup(const __le64 *p)
+static inline uint64_t __le64_to_cpup(const __le64 *p)
{
- return (__force __u64)*p;
+ return (__force uint64_t)*p;
}
-static inline __le32 __cpu_to_le32p(const __u32 *p)
+static inline __le32 __cpu_to_le32p(const uint32_t *p)
{
return (__force __le32)*p;
}
-static inline __u32 __le32_to_cpup(const __le32 *p)
+static inline uint32_t __le32_to_cpup(const __le32 *p)
{
- return (__force __u32)*p;
+ return (__force uint32_t)*p;
}
-static inline __le16 __cpu_to_le16p(const __u16 *p)
+static inline __le16 __cpu_to_le16p(const uint16_t *p)
{
return (__force __le16)*p;
}
-static inline __u16 __le16_to_cpup(const __le16 *p)
+static inline uint16_t __le16_to_cpup(const __le16 *p)
{
- return (__force __u16)*p;
+ return (__force uint16_t)*p;
}
-static inline __be64 __cpu_to_be64p(const __u64 *p)
+static inline __be64 __cpu_to_be64p(const uint64_t *p)
{
return (__force __be64)__swab64p(p);
}
-static inline __u64 __be64_to_cpup(const __be64 *p)
+static inline uint64_t __be64_to_cpup(const __be64 *p)
{
- return __swab64p((__u64 *)p);
+ return __swab64p((uint64_t *)p);
}
-static inline __be32 __cpu_to_be32p(const __u32 *p)
+static inline __be32 __cpu_to_be32p(const uint32_t *p)
{
return (__force __be32)__swab32p(p);
}
-static inline __u32 __be32_to_cpup(const __be32 *p)
+static inline uint32_t __be32_to_cpup(const __be32 *p)
{
- return __swab32p((__u32 *)p);
+ return __swab32p((uint32_t *)p);
}
-static inline __be16 __cpu_to_be16p(const __u16 *p)
+static inline __be16 __cpu_to_be16p(const uint16_t *p)
{
return (__force __be16)__swab16p(p);
}
-static inline __u16 __be16_to_cpup(const __be16 *p)
+static inline uint16_t __be16_to_cpup(const __be16 *p)
{
- return __swab16p((__u16 *)p);
+ return __swab16p((uint16_t *)p);
}
#define __cpu_to_le64s(x) do {} while (0)
#define __le64_to_cpus(x) do {} while (0)
diff -r 87854d3bed93 xen/include/xen/byteorder/swab.h
--- a/xen/include/xen/byteorder/swab.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/xen/byteorder/swab.h Fri Jan 20 15:01:35 2012 +0100
@@ -11,72 +11,73 @@
*/
/* casts are necessary for constants, because we never know how for sure
- * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
+ * how U/UL/ULL map to uint16_t, uint32_t, uint64_t.
+ * At least not in a portable way.
*/
#define ___swab16(x) \
({ \
- __u16 __x = (x); \
- ((__u16)( \
- (((__u16)(__x) & (__u16)0x00ffU) << 8) | \
- (((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
+ uint16_t __x = (x); \
+ ((uint16_t)( \
+ (((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
+ (((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) ));\
})
#define ___swab32(x) \
({ \
- __u32 __x = (x); \
- ((__u32)( \
- (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
- (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | \
- (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | \
- (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
+ uint32_t __x = (x); \
+ ((uint32_t)( \
+ (((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
+ (((uint32_t)(__x) & (uint32_t)0x0000ff00UL) << 8) | \
+ (((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
+ (((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
})
#define ___swab64(x) \
({ \
- __u64 __x = (x); \
- ((__u64)( \
- (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
- (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
- (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
- (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \
- (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \
- (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
- (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
- (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
+ uint64_t __x = (x); \
+ ((uint64_t)( \
+ (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
+ (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
+ (uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
+ (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
+ (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
+ (uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
+ (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
+ (uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
})
-#define ___constant_swab16(x) \
- ((__u16)( \
- (((__u16)(x) & (__u16)0x00ffU) << 8) | \
- (((__u16)(x) & (__u16)0xff00U) >> 8) ))
-#define ___constant_swab32(x) \
- ((__u32)( \
- (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
- (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
- (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
- (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+#define ___constant_swab16(x) \
+ ((uint16_t)( \
+ (((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \
+ (((uint16_t)(x) & (uint16_t)0xff00U) >> 8) ))
+#define ___constant_swab32(x) \
+ ((uint32_t)( \
+ (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
+ (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
+ (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
+ (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24) ))
#define ___constant_swab64(x) \
- ((__u64)( \
- (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
- (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
- (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
- (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
- (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
- (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
- (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
- (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+ ((uint64_t)( \
+ (uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
+ (uint64_t)(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
+ (uint64_t)(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
+ (uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
+ (uint64_t)(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
+ (uint64_t)(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
+ (uint64_t)(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
+ (uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) ))
/*
* provide defaults when no architecture-specific optimization is detected
*/
#ifndef __arch__swab16
-# define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
+# define __arch__swab16(x) ({ uint16_t __tmp = (x) ; ___swab16(__tmp); })
#endif
#ifndef __arch__swab32
-# define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); })
+# define __arch__swab32(x) ({ uint32_t __tmp = (x) ; ___swab32(__tmp); })
#endif
#ifndef __arch__swab64
-# define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); })
+# define __arch__swab64(x) ({ uint64_t __tmp = (x) ; ___swab64(__tmp); })
#endif
#ifndef __arch__swab16p
@@ -105,15 +106,15 @@
*/
#if defined(__GNUC__) && defined(__OPTIMIZE__)
# define __swab16(x) \
-(__builtin_constant_p((__u16)(x)) ? \
+(__builtin_constant_p((uint16_t)(x)) ? \
___swab16((x)) : \
__fswab16((x)))
# define __swab32(x) \
-(__builtin_constant_p((__u32)(x)) ? \
+(__builtin_constant_p((uint32_t)(x)) ? \
___swab32((x)) : \
__fswab32((x)))
# define __swab64(x) \
-(__builtin_constant_p((__u64)(x)) ? \
+(__builtin_constant_p((uint64_t)(x)) ? \
___swab64((x)) : \
__fswab64((x)))
#else
@@ -123,48 +124,48 @@
#endif /* OPTIMIZE */
-static inline __attribute_const__ __u16 __fswab16(__u16 x)
+static inline __attribute_const__ uint16_t __fswab16(uint16_t x)
{
return __arch__swab16(x);
}
-static inline __u16 __swab16p(const __u16 *x)
+static inline uint16_t __swab16p(const uint16_t *x)
{
return __arch__swab16p(x);
}
-static inline void __swab16s(__u16 *addr)
+static inline void __swab16s(uint16_t *addr)
{
__arch__swab16s(addr);
}
-static inline __attribute_const__ __u32 __fswab32(__u32 x)
+static inline __attribute_const__ uint32_t __fswab32(uint32_t x)
{
return __arch__swab32(x);
}
-static inline __u32 __swab32p(const __u32 *x)
+static inline uint32_t __swab32p(const uint32_t *x)
{
return __arch__swab32p(x);
}
-static inline void __swab32s(__u32 *addr)
+static inline void __swab32s(uint32_t *addr)
{
__arch__swab32s(addr);
}
#ifdef __BYTEORDER_HAS_U64__
-static inline __attribute_const__ __u64 __fswab64(__u64 x)
+static inline __attribute_const__ uint64_t __fswab64(uint64_t x)
{
# ifdef __SWAB_64_THRU_32__
- __u32 h = x >> 32;
- __u32 l = x & ((1ULL<<32)-1);
- return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
+ uint32_t h = x >> 32;
+ uint32_t l = x & ((1ULL<<32)-1);
+ return (((uint64_t)__swab32(l)) << 32) | ((uint64_t)(__swab32(h)));
# else
return __arch__swab64(x);
# endif
}
-static inline __u64 __swab64p(const __u64 *x)
+static inline uint64_t __swab64p(const uint64_t *x)
{
return __arch__swab64p(x);
}
-static inline void __swab64s(__u64 *addr)
+static inline void __swab64s(uint64_t *addr)
{
__arch__swab64s(addr);
}
diff -r 87854d3bed93 xen/include/xen/cper.h
--- a/xen/include/xen/cper.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/xen/cper.h Fri Jan 20 15:01:35 2012 +0100
@@ -28,7 +28,7 @@
extern unsigned long get_sec(void);
typedef struct {
- __u8 b[16];
+ uint8_t b[16];
} uuid_le;
static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
@@ -155,36 +155,36 @@ static inline u64 cper_next_record_id(vo
struct cper_record_header {
char signature[CPER_SIG_SIZE]; /* must be CPER_SIG_RECORD */
- __u16 revision; /* must be CPER_RECORD_REV */
- __u32 signature_end; /* must be CPER_SIG_END */
- __u16 section_count;
- __u32 error_severity;
- __u32 validation_bits;
- __u32 record_length;
- __u64 timestamp;
+ uint16_t revision; /* must be CPER_RECORD_REV */
+ uint32_t signature_end; /* must be CPER_SIG_END */
+ uint16_t section_count;
+ uint32_t error_severity;
+ uint32_t validation_bits;
+ uint32_t record_length;
+ uint64_t timestamp;
uuid_le platform_id;
uuid_le partition_id;
uuid_le creator_id;
uuid_le notification_type;
- __u64 record_id;
- __u32 flags;
- __u64 persistence_information;
- __u8 reserved[12]; /* must be zero */
+ uint64_t record_id;
+ uint32_t flags;
+ uint64_t persistence_information;
+ uint8_t reserved[12]; /* must be zero */
};
struct cper_section_descriptor {
- __u32 section_offset; /* Offset in bytes of the
+ uint32_t section_offset; /* Offset in bytes of the
* section body from the base
* of the record header */
- __u32 section_length;
- __u16 revision; /* must be CPER_RECORD_REV */
- __u8 validation_bits;
- __u8 reserved; /* must be zero */
- __u32 flags;
+ uint32_t section_length;
+ uint16_t revision; /* must be CPER_RECORD_REV */
+ uint8_t validation_bits;
+ uint8_t reserved; /* must be zero */
+ uint32_t flags;
uuid_le section_type;
uuid_le fru_id;
- __u32 section_severity;
- __u8 fru_text[20];
+ uint32_t section_severity;
+ uint8_t fru_text[20];
};
/* Reset to default packing */
diff -r 87854d3bed93 xen/include/xen/types.h
--- a/xen/include/xen/types.h Fri Jan 20 10:40:16 2012 +0000
+++ b/xen/include/xen/types.h Fri Jan 20 15:01:35 2012 +0100
@@ -31,30 +31,14 @@ typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
-typedef __u8 uint8_t;
-typedef __u8 u_int8_t;
-typedef __s8 int8_t;
-
-typedef __u16 uint16_t;
-typedef __u16 u_int16_t;
-typedef __s16 int16_t;
-
-typedef __u32 uint32_t;
-typedef __u32 u_int32_t;
-typedef __s32 int32_t;
-
-typedef __u64 uint64_t;
-typedef __u64 u_int64_t;
-typedef __s64 int64_t;
-
struct domain;
struct vcpu;
-typedef __u16 __le16;
-typedef __u16 __be16;
-typedef __u32 __le32;
-typedef __u32 __be32;
-typedef __u64 __le64;
-typedef __u64 __be64;
+typedef uint16_t __le16;
+typedef uint16_t __be16;
+typedef uint32_t __le32;
+typedef uint32_t __be32;
+typedef uint64_t __le64;
+typedef uint64_t __be64;
#endif /* __TYPES_H__ */
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen: kill __u*/__s* integer types
2012-01-20 14:05 [PATCH] xen: kill __u*/__s* integer types Christoph Egger
@ 2012-01-20 14:36 ` Jan Beulich
2012-01-20 14:50 ` Christoph Egger
0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2012-01-20 14:36 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel@lists.xensource.com
>>> On 20.01.12 at 15:05, Christoph Egger <Christoph.Egger@amd.com> wrote:
> Kill __u*/__s* integer types and use c99 integer types instead.
> Cleanup <asm-x86/types.h>
Was this build-tested for ia64?
Jan
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen: kill __u*/__s* integer types
2012-01-20 14:36 ` Jan Beulich
@ 2012-01-20 14:50 ` Christoph Egger
2012-01-20 14:57 ` Jan Beulich
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Egger @ 2012-01-20 14:50 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel@lists.xensource.com
On 01/20/12 15:36, Jan Beulich wrote:
>>>> On 20.01.12 at 15:05, Christoph Egger<Christoph.Egger@amd.com> wrote:
>> Kill __u*/__s* integer types and use c99 integer types instead.
>> Cleanup<asm-x86/types.h>
>
> Was this build-tested for ia64?
No. I don't have such a machine.
Can you do that, please?
Christoph
>
> Jan
>
>> Signed-off-by: Christoph Egger<Christoph.Egger@amd.com>
>
>
>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen: kill __u*/__s* integer types
2012-01-20 14:50 ` Christoph Egger
@ 2012-01-20 14:57 ` Jan Beulich
2012-01-20 15:16 ` Christoph Egger
0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2012-01-20 14:57 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel@lists.xensource.com
>>> On 20.01.12 at 15:50, Christoph Egger <Christoph.Egger@amd.com> wrote:
> On 01/20/12 15:36, Jan Beulich wrote:
>>>>> On 20.01.12 at 15:05, Christoph Egger<Christoph.Egger@amd.com> wrote:
>>> Kill __u*/__s* integer types and use c99 integer types instead.
>>> Cleanup<asm-x86/types.h>
>>
>> Was this build-tested for ia64?
>
> No. I don't have such a machine.
And you don't need to. You can just use a cross tool chain.
> Can you do that, please?
I'm trying to avoid having to do (a perhaps massive) cleanup after
a patch like this.
If you can't/don't want to do the cross build (given that the ARM
bits are sort of ready to be committed, it might be a good idea to
check against those bits too), then please adjust the patch so
that it won't break the build for arches you don't test.
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen: kill __u*/__s* integer types
2012-01-20 14:57 ` Jan Beulich
@ 2012-01-20 15:16 ` Christoph Egger
2012-01-20 15:22 ` Jan Beulich
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Egger @ 2012-01-20 15:16 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel@lists.xensource.com
On 01/20/12 15:57, Jan Beulich wrote:
>>>> On 20.01.12 at 15:50, Christoph Egger<Christoph.Egger@amd.com> wrote:
>> On 01/20/12 15:36, Jan Beulich wrote:
>>>>>> On 20.01.12 at 15:05, Christoph Egger<Christoph.Egger@amd.com> wrote:
>>>> Kill __u*/__s* integer types and use c99 integer types instead.
>>>> Cleanup<asm-x86/types.h>
>>>
>>> Was this build-tested for ia64?
>>
>> No. I don't have such a machine.
>
> And you don't need to. You can just use a cross tool chain.
>
>> Can you do that, please?
>
> I'm trying to avoid having to do (a perhaps massive) cleanup after
> a patch like this.
>
> If you can't/don't want to do the cross build (given that the ARM
> bits are sort of ready to be committed, it might be a good idea to
> check against those bits too), then please adjust the patch so
> that it won't break the build for arches you don't test.
I just figured this out:
<xen/types.h> includes <asm/types.h> which doesn't exist on ia64.
So I guess ia64 doesn't build anyway...
Christoph
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen: kill __u*/__s* integer types
2012-01-20 15:16 ` Christoph Egger
@ 2012-01-20 15:22 ` Jan Beulich
0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2012-01-20 15:22 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel@lists.xensource.com
>>> On 20.01.12 at 16:16, Christoph Egger <Christoph.Egger@amd.com> wrote:
> On 01/20/12 15:57, Jan Beulich wrote:
>>>>> On 20.01.12 at 15:50, Christoph Egger<Christoph.Egger@amd.com> wrote:
>>> On 01/20/12 15:36, Jan Beulich wrote:
>>>>>>> On 20.01.12 at 15:05, Christoph Egger<Christoph.Egger@amd.com> wrote:
>>>>> Kill __u*/__s* integer types and use c99 integer types instead.
>>>>> Cleanup<asm-x86/types.h>
>>>>
>>>> Was this build-tested for ia64?
>>>
>>> No. I don't have such a machine.
>>
>> And you don't need to. You can just use a cross tool chain.
>>
>>> Can you do that, please?
>>
>> I'm trying to avoid having to do (a perhaps massive) cleanup after
>> a patch like this.
>>
>> If you can't/don't want to do the cross build (given that the ARM
>> bits are sort of ready to be committed, it might be a good idea to
>> check against those bits too), then please adjust the patch so
>> that it won't break the build for arches you don't test.
>
>
> I just figured this out:
>
> <xen/types.h> includes <asm/types.h> which doesn't exist on ia64.
> So I guess ia64 doesn't build anyway...
Which is obviously not the case. There are multiple places where you
need to look for such a header on ia64 - in this case, it's in
xen/include/asm-ia64/linux-xen/asm.
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-20 15:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-20 14:05 [PATCH] xen: kill __u*/__s* integer types Christoph Egger
2012-01-20 14:36 ` Jan Beulich
2012-01-20 14:50 ` Christoph Egger
2012-01-20 14:57 ` Jan Beulich
2012-01-20 15:16 ` Christoph Egger
2012-01-20 15:22 ` Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).