diff options
author | Adam Jackson <ajax@redhat.com> | 2008-07-23 11:35:06 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-07-23 11:35:06 -0400 |
commit | 2e3c43d306616f8accdeaffec9c108ba88324805 (patch) | |
tree | 1082328a705a864b58d68559f07f7c2ed8852dfb /hw | |
parent | 0c1c9d75089aac0cf673820db83801d3cab5bfc7 (diff) |
Assume __GNUC__ >= 3.
gcc 3.0 was seven years ago. Get with the times.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/compiler.h | 24 | ||||
-rw-r--r-- | hw/xfree86/x86emu/sys.c | 68 |
2 files changed, 19 insertions, 73 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index 040d8cdf8..24f9ae617 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -212,7 +212,7 @@ struct __una_u16 { unsigned short x __attribute__((packed)); }; static __inline__ unsigned long ldq_u(unsigned long * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u64 *ptr = (const struct __una_u64 *) r11; return ptr->x; # else @@ -231,7 +231,7 @@ static __inline__ unsigned long ldq_u(unsigned long * r11) static __inline__ unsigned long ldl_u(unsigned int * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u32 *ptr = (const struct __una_u32 *) r11; return ptr->x; # else @@ -250,7 +250,7 @@ static __inline__ unsigned long ldl_u(unsigned int * r11) static __inline__ unsigned long ldw_u(unsigned short * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u16 *ptr = (const struct __una_u16 *) r11; return ptr->x; # else @@ -273,7 +273,7 @@ static __inline__ unsigned long ldw_u(unsigned short * r11) static __inline__ void stq_u(unsigned long r5, unsigned long * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u64 *ptr = (struct __una_u64 *) r11; ptr->x = r5; # else @@ -298,7 +298,7 @@ static __inline__ void stq_u(unsigned long r5, unsigned long * r11) static __inline__ void stl_u(unsigned long r5, unsigned int * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u32 *ptr = (struct __una_u32 *) r11; ptr->x = r5; # else @@ -323,7 +323,7 @@ static __inline__ void stl_u(unsigned long r5, unsigned int * r11) static __inline__ void stw_u(unsigned long r5, unsigned short * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u16 *ptr = (struct __una_u16 *) r11; ptr->x = r5; # else @@ -780,7 +780,7 @@ struct __una_u16 { unsigned short x __attribute__((packed)); }; static __inline__ unsigned long ldq_u(unsigned long *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) # if defined(__arch64__) || defined(__sparcv9) const struct __una_u64 *ptr = (const struct __una_u64 *) p; # else @@ -796,7 +796,7 @@ static __inline__ unsigned long ldq_u(unsigned long *p) static __inline__ unsigned long ldl_u(unsigned int *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u32 *ptr = (const struct __una_u32 *) p; return ptr->x; # else @@ -808,7 +808,7 @@ static __inline__ unsigned long ldl_u(unsigned int *p) static __inline__ unsigned long ldw_u(unsigned short *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u16 *ptr = (const struct __una_u16 *) p; return ptr->x; # else @@ -820,7 +820,7 @@ static __inline__ unsigned long ldw_u(unsigned short *p) static __inline__ void stq_u(unsigned long val, unsigned long *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) # if defined(__arch64__) || defined(__sparcv9) struct __una_u64 *ptr = (struct __una_u64 *) p; # else @@ -835,7 +835,7 @@ static __inline__ void stq_u(unsigned long val, unsigned long *p) static __inline__ void stl_u(unsigned long val, unsigned int *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u32 *ptr = (struct __una_u32 *) p; ptr->x = val; # else @@ -846,7 +846,7 @@ static __inline__ void stl_u(unsigned long val, unsigned int *p) static __inline__ void stw_u(unsigned long val, unsigned short *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u16 *ptr = (struct __una_u16 *) p; ptr->x = val; # else diff --git a/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c index 4d90ea315..e15fb0931 100644 --- a/hw/xfree86/x86emu/sys.c +++ b/hw/xfree86/x86emu/sys.c @@ -68,7 +68,7 @@ X86EMU_intrFuncs _X86EMU_intrTab[256]; * packed structures to talk about such things with. */ -#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +#if defined(__GNUC__) struct __una_u64 { unsigned long x __attribute__((packed)); }; struct __una_u32 { unsigned int x __attribute__((packed)); }; struct __una_u16 { unsigned short x __attribute__((packed)); }; @@ -76,7 +76,7 @@ struct __una_u16 { unsigned short x __attribute__((packed)); }; static __inline__ unsigned long ldq_u(unsigned long * r11) { -#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +#if defined(__GNUC__) const struct __una_u64 *ptr = (const struct __una_u64 *) r11; return ptr->x; #else @@ -95,7 +95,7 @@ static __inline__ unsigned long ldq_u(unsigned long * r11) static __inline__ unsigned long ldl_u(unsigned int * r11) { -#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +#if defined(__GNUC__) const struct __una_u32 *ptr = (const struct __una_u32 *) r11; return ptr->x; #else @@ -114,7 +114,7 @@ static __inline__ unsigned long ldl_u(unsigned int * r11) static __inline__ unsigned long ldw_u(unsigned short * r11) { -#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +#if defined(__GNUC__) const struct __una_u16 *ptr = (const struct __una_u16 *) r11; return ptr->x; #else @@ -137,7 +137,7 @@ static __inline__ unsigned long ldw_u(unsigned short * r11) static __inline__ void stq_u(unsigned long r5, unsigned long * r11) { -#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +#if defined(__GNUC__) struct __una_u64 *ptr = (struct __una_u64 *) r11; ptr->x = r5; #else @@ -162,7 +162,7 @@ static __inline__ void stq_u(unsigned long r5, unsigned long * r11) static __inline__ void stl_u(unsigned long r5, unsigned int * r11) { -#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +#if defined(__GNUC__) struct __una_u32 *ptr = (struct __una_u32 *) r11; ptr->x = r5; #else @@ -187,7 +187,7 @@ static __inline__ void stl_u(unsigned long r5, unsigned int * r11) static __inline__ void stw_u(unsigned long r5, unsigned short * r11) { -#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +#if defined(__GNUC__) struct __una_u16 *ptr = (struct __una_u16 *) r11; ptr->x = r5; #else @@ -209,60 +209,6 @@ static __inline__ void stw_u(unsigned long r5, unsigned short * r11) :"r" (r5), "r" (r11)); #endif } - -#elif defined(__GNUC__) && ((__GNUC__ < 3)) && \ - (defined (__ia64__) || defined (ia64__)) -#define IA64_UALOADS -/* - * EGCS 1.1 knows about arbitrary unaligned loads. Define some - * packed structures to talk about such things with. - */ -struct __una_u64 { unsigned long x __attribute__((packed)); }; -struct __una_u32 { unsigned int x __attribute__((packed)); }; -struct __una_u16 { unsigned short x __attribute__((packed)); }; - -static __inline__ unsigned long -__uldq (const unsigned long * r11) -{ - const struct __una_u64 *ptr = (const struct __una_u64 *) r11; - return ptr->x; -} - -static __inline__ unsigned long -uldl (const unsigned int * r11) -{ - const struct __una_u32 *ptr = (const struct __una_u32 *) r11; - return ptr->x; -} - -static __inline__ unsigned long -uldw (const unsigned short * r11) -{ - const struct __una_u16 *ptr = (const struct __una_u16 *) r11; - return ptr->x; -} - -static __inline__ void -ustq (unsigned long r5, unsigned long * r11) -{ - struct __una_u64 *ptr = (struct __una_u64 *) r11; - ptr->x = r5; -} - -static __inline__ void -ustl (unsigned long r5, unsigned int * r11) -{ - struct __una_u32 *ptr = (struct __una_u32 *) r11; - ptr->x = r5; -} - -static __inline__ void -ustw (unsigned long r5, unsigned short * r11) -{ - struct __una_u16 *ptr = (struct __una_u16 *) r11; - ptr->x = r5; -} - #endif /**************************************************************************** |