summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/common/compiler.h')
-rw-r--r--hw/xfree86/common/compiler.h94
1 files changed, 14 insertions, 80 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 9e9234f97..886c639a4 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -75,44 +75,6 @@
# endif
# endif /* __inline */
-# if defined(IODEBUG) && defined(__GNUC__)
-# define outb RealOutb
-# define outw RealOutw
-# define outl RealOutl
-# define inb RealInb
-# define inw RealInw
-# define inl RealInl
-# endif
-
-# if defined(QNX4) /* Do this for now to keep Watcom happy */
-# define outb outp
-# define outw outpw
-# define outl outpd
-# define inb inp
-# define inw inpw
-# define inl inpd
-
-/* Define the ffs function for inlining */
-extern int ffs(unsigned long);
-# pragma aux ffs_ = \
- "bsf edx, eax" \
- "jnz bits_set" \
- "xor eax, eax" \
- "jmp exit1" \
- "bits_set:" \
- "mov eax, edx" \
- "inc eax" \
- "exit1:" \
- __parm [eax] \
- __modify [eax edx] \
- __value [eax] \
- ;
-# endif
-
-# if defined(__SUNPRO_C)
-# define DO_PROTOTYPES
-# endif
-
# if defined(NO_INLINE) || defined(DO_PROTOTYPES)
# if !defined(__arm__)
@@ -250,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
@@ -269,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
@@ -288,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
@@ -311,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
@@ -336,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
@@ -361,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
@@ -818,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
@@ -834,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
@@ -846,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
@@ -858,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
@@ -873,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
@@ -884,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
@@ -1511,7 +1473,6 @@ inl(unsigned short port)
# endif /* ix86 */
# else /* !GNUC */
-# if !defined(QNX4)
# if defined(__STDC__) && (__STDC__ == 1)
# ifndef asm
# define asm __asm
@@ -1527,13 +1488,13 @@ inl(unsigned short port)
# define uint_t unsigned int
# define uchar_t unsigned char
# endif /* __UNIXWARE__ */
-# if !defined(sgi) && !defined(__SUNPRO_C)
+# if !defined(__SUNPRO_C)
# include <sys/inline.h>
# endif
# else
# include "scoasm.h"
# endif
-# if (!defined(__HIGHC__) && !defined(sgi) && !defined(__SUNPRO_C)) || \
+# if !defined(__HIGHC__) && !defined(__SUNPRO_C) || \
defined(__USLC__)
# pragma asm partial_optimization outl
# pragma asm partial_optimization outw
@@ -1542,7 +1503,6 @@ inl(unsigned short port)
# pragma asm partial_optimization inw
# pragma asm partial_optimization inb
# endif
-# endif
# define ldq_u(p) (*((unsigned long *)(p)))
# define ldl_u(p) (*((unsigned int *)(p)))
# define ldw_u(p) (*((unsigned short *)(p)))
@@ -1553,32 +1513,6 @@ inl(unsigned short port)
# define write_mem_barrier() /* NOP */
# endif /* __GNUC__ */
-# if defined(QNX4)
-# include <sys/types.h>
-extern unsigned inb(unsigned port);
-extern unsigned inw(unsigned port);
-extern unsigned inl(unsigned port);
-extern void outb(unsigned port, unsigned val);
-extern void outw(unsigned port, unsigned val);
-extern void outl(unsigned port, unsigned val);
-# endif /* QNX4 */
-
-# if defined(IODEBUG) && defined(__GNUC__)
-# undef inb
-# undef inw
-# undef inl
-# undef outb
-# undef outw
-# undef outl
-# define inb(a) __extension__ ({unsigned char __c=RealInb(a); ErrorF("inb(0x%03x) = 0x%02x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;})
-# define inw(a) __extension__ ({unsigned short __c=RealInw(a); ErrorF("inw(0x%03x) = 0x%04x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;})
-# define inl(a) __extension__ ({unsigned int __c=RealInl(a); ErrorF("inl(0x%03x) = 0x%08x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;})
-
-# define outb(a,b) (ErrorF("outb(0x%03x, 0x%02x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutb(a,b))
-# define outw(a,b) (ErrorF("outw(0x%03x, 0x%04x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutw(a,b))
-# define outl(a,b) (ErrorF("outl(0x%03x, 0x%08x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutl(a,b))
-# endif
-
# endif /* NO_INLINE */
# ifdef __alpha__