compiler.h revision a2760a4d593af57a19ec32cdfd1723b68495df8c
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.99 2003/01/29 15:23:20 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Thomas Roell not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Thomas Roell makes no representations
* about the suitability of this software for any purpose. It is provided
* "as is" without express or implied warranty.
*
* THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/* $XConsortium: compiler.h /main/16 1996/10/25 15:38:34 kaleb $ */
#ifndef _COMPILER_H
# if !defined(_XF86_ANSIC_H) && defined(XFree86Module)
# endif
# define _COMPILER_H
# ifndef __inline__
# if defined(__GNUC__)
/* gcc has __inline__ */
# define __inline__ _Inline
# else
# define __inline__ /**/
# endif
# endif /* __inline__ */
# ifndef __inline
# if defined(__GNUC__)
/* gcc has __inline */
# else
# define __inline /**/
# endif
# endif /* __inline */
# endif
# if defined(QNX4) /* Do this for now to keep Watcom happy */
/* Define the ffs function for inlining */
extern int ffs(unsigned long);
"bsf edx, eax" \
"jnz bits_set" \
"xor eax, eax" \
"jmp exit1" \
"bits_set:" \
"mov eax, edx" \
"inc eax" \
"exit1:" \
;
# endif
# if defined(NO_INLINE) || defined(DO_PROTOTYPES)
extern void outb(unsigned short, unsigned char);
extern void outw(unsigned short, unsigned short);
extern void outl(unsigned short, unsigned int);
extern unsigned int inb(unsigned short);
extern unsigned int inw(unsigned short);
extern unsigned int inl(unsigned short);
# else /* __sparc__, __arm32__, __alpha__*/
extern void outb(unsigned long, unsigned char);
extern void outw(unsigned long, unsigned short);
extern void outl(unsigned long, unsigned int);
extern unsigned int inb(unsigned long);
extern unsigned int inw(unsigned long);
extern unsigned int inl(unsigned long);
# endif /* __sparc__, __arm32__, __alpha__ */
extern unsigned long ldq_u(unsigned long *);
extern unsigned long ldl_u(unsigned int *);
extern unsigned long ldw_u(unsigned short *);
extern void stq_u(unsigned long, unsigned long *);
extern void stl_u(unsigned long, unsigned int *);
extern void stw_u(unsigned long, unsigned short *);
extern void mem_barrier(void);
extern void write_mem_barrier(void);
extern void stl_brx(unsigned long, volatile unsigned char *, int);
extern void stw_brx(unsigned short, volatile unsigned char *, int);
extern unsigned long ldl_brx(volatile unsigned char *, int);
extern unsigned short ldw_brx(volatile unsigned char *, int);
# endif
# ifndef NO_INLINE
# ifdef __GNUC__
# if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__alpha__)
# ifdef linux
/* for Linux on Alpha, we use the LIBC _inx/_outx routines */
/* note that the appropriate setup via "ioperm" needs to be done */
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ void
{
}
extern unsigned int (*_alpha_inb)(unsigned long port);
static __inline__ unsigned int
{
return _alpha_inb(port);
}
extern unsigned int (*_alpha_inw)(unsigned long port);
static __inline__ unsigned int
{
return _alpha_inw(port);
}
extern unsigned int (*_alpha_inl)(unsigned long port);
static __inline__ unsigned int
{
return _alpha_inl(port);
}
# endif /* linux */
# if (defined(__FreeBSD__) || defined(__OpenBSD__)) \
&& !defined(DO_PROTOTYPES)
/* for FreeBSD and OpenBSD on Alpha, we use the libio (resp. libalpha) */
/* note that the appropriate setup via "ioperm" needs to be done */
# endif /* (__FreeBSD__ || __OpenBSD__ ) && !DO_PROTOTYPES */
#if defined(__NetBSD__)
#endif /* __NetBSD__ */
/*
* inline functions to do unaligned accesses
* from linux/include/asm-alpha/unaligned.h
*/
/*
* EGCS 1.1 knows about arbitrary unaligned loads. Define some
* packed structures to talk about such things with.
*/
/*
* Elemental unaligned loads
*/
/* let's try making these things static */
{
return ptr->x;
# else
__asm__("ldq_u %0,%3\n\t"
"ldq_u %1,%4\n\t"
"extql %0,%2,%0\n\t"
"extqh %1,%2,%1"
:"r" (r11),
"m" (*r11),
# endif
}
{
return ptr->x;
# else
__asm__("ldq_u %0,%3\n\t"
"ldq_u %1,%4\n\t"
"extll %0,%2,%0\n\t"
"extlh %1,%2,%1"
:"r" (r11),
"m" (*r11),
# endif
}
{
return ptr->x;
# else
__asm__("ldq_u %0,%3\n\t"
"ldq_u %1,%4\n\t"
"extwl %0,%2,%0\n\t"
"extwh %1,%2,%1"
:"r" (r11),
"m" (*r11),
# endif
}
/*
* Elemental unaligned stores
*/
{
# else
__asm__("ldq_u %3,%1\n\t"
"ldq_u %2,%0\n\t"
"insqh %6,%7,%5\n\t"
"insql %6,%7,%4\n\t"
"mskqh %3,%7,%3\n\t"
"mskql %2,%7,%2\n\t"
"bis %3,%5,%3\n\t"
"bis %2,%4,%2\n\t"
"stq_u %3,%1\n\t"
"stq_u %2,%0"
:"=m" (*r11),
# endif
}
{
# else
__asm__("ldq_u %3,%1\n\t"
"ldq_u %2,%0\n\t"
"inslh %6,%7,%5\n\t"
"insll %6,%7,%4\n\t"
"msklh %3,%7,%3\n\t"
"mskll %2,%7,%2\n\t"
"bis %3,%5,%3\n\t"
"bis %2,%4,%2\n\t"
"stq_u %3,%1\n\t"
"stq_u %2,%0"
:"=m" (*r11),
# endif
}
{
# else
__asm__("ldq_u %3,%1\n\t"
"ldq_u %2,%0\n\t"
"inswh %6,%7,%5\n\t"
"inswl %6,%7,%4\n\t"
"mskwh %3,%7,%3\n\t"
"mskwl %2,%7,%2\n\t"
"bis %3,%5,%3\n\t"
"bis %2,%4,%2\n\t"
"stq_u %3,%1\n\t"
"stq_u %2,%0"
:"=m" (*r11),
# endif
}
/* to flush the I-cache before jumping to code which just got loaded */
# define PAL_imb 134
# define istream_mem_barrier() \
# ifdef __ELF__
# else /* ECOFF gas 2.6 doesn't know "wmb" :-( */
# define write_mem_barrier() mem_barrier()
# endif
# include <inttypes.h>
static __inline__ unsigned long
{
return ptr->x;
}
static __inline__ unsigned long
{
return ptr->x;
}
static __inline__ unsigned long
{
return ptr->x;
}
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ void
{
}
/*
* This is overkill, but for different reasons depending on where it is used.
* This is thus general enough to be used everywhere cache flushes are needed.
* It doesn't handle memory access serialisation by other processors, though.
*/
# define ia64_flush_cache(Addr) \
__asm__ __volatile__ ( \
"fc %0;;;" \
"sync.i;;;" \
"mf;;;" \
"srlz.i;;;" \
# include <inttypes.h>
# define ldq_u(p) (*((unsigned long *)(p)))
# define ldl_u(p) (*((unsigned int *)(p)))
# define ldw_u(p) (*((unsigned short *)(p)))
# define stq_u(v,p) (*(unsigned long *)(p)) = (v)
# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
# define mem_barrier() \
# define write_mem_barrier() \
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ unsigned int
{
unsigned char ret;
"=a" (ret) :
"d" (port));
return ret;
}
static __inline__ unsigned int
{
unsigned short ret;
"=a" (ret) :
"d" (port));
return ret;
}
static __inline__ unsigned int
{
unsigned int ret;
"=a" (ret) :
"d" (port));
return ret;
}
# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__)) && defined(__sparc__)
# if !defined(Lynx)
# ifndef ASI_PL
# define ASI_PL 0x88
# endif
static __inline__ void
{
: /* No outputs */
barrier();
}
static __inline__ void
{
: /* No outputs */
barrier();
}
static __inline__ void
{
: /* No outputs */
barrier();
}
static __inline__ unsigned int
{
unsigned int ret;
: "=r" (ret)
return ret;
}
static __inline__ unsigned int
{
unsigned int ret;
: "=r" (ret)
return ret;
}
static __inline__ unsigned int
{
unsigned int ret;
: "=r" (ret)
return ret;
}
static __inline__ unsigned char
{
unsigned char ret;
: "=r" (ret)
return ret;
}
static __inline__ unsigned short
{
unsigned short ret;
: "=r" (ret)
: "r" (addr));
return ret;
}
static __inline__ unsigned short
{
unsigned short ret;
: "=r" (ret)
return ret;
}
static __inline__ unsigned int
{
unsigned int ret;
: "=r" (ret)
: "r" (addr));
return ret;
}
static __inline__ unsigned int
{
unsigned int ret;
: "=r" (ret)
return ret;
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
barrier();
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
barrier();
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
barrier();
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
barrier();
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
barrier();
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
}
# endif /* !Lynx */
/*
* EGCS 1.1 knows about arbitrary unaligned loads. Define some
* packed structures to talk about such things with.
*/
# if defined(__arch64__) || defined(__sparcv9)
# endif
static __inline__ unsigned long ldq_u(unsigned long *p)
{
# if defined(__arch64__) || defined(__sparcv9)
# else
# endif
return ptr->x;
# else
unsigned long ret;
return ret;
# endif
}
static __inline__ unsigned long ldl_u(unsigned int *p)
{
return ptr->x;
# else
unsigned int ret;
return ret;
# endif
}
static __inline__ unsigned long ldw_u(unsigned short *p)
{
return ptr->x;
# else
unsigned short ret;
return ret;
# endif
}
{
# if defined(__arch64__) || defined(__sparcv9)
# else
# endif
# else
# endif
}
{
# else
# endif
}
{
# else
# endif
}
# define mem_barrier() /* XXX: nop for now */
# define write_mem_barrier() /* XXX: nop for now */
#ifdef __arm32__
#define PORT_SIZE long
#else
#define PORT_SIZE short
#endif
unsigned int IOPortBase; /* Memory mapped I/O port area */
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ unsigned int
{
}
static __inline__ unsigned int
{
}
static __inline__ unsigned int
{
}
# if defined(__mips__)
{
unsigned long r1;
__asm__("lwr %0,%2\n\t"
"lwl %0,%3\n\t"
:"=&r" (r1)
:"r" (r11),
"m" (*r11),
return r1;
}
{
unsigned long r1;
__asm__("lwr %0,%2\n\t"
"lwl %0,%3\n\t"
:"=&r" (r1)
:"r" (r11),
"m" (*r11),
return r1;
}
{
unsigned long r1;
__asm__("lwr %0,%2\n\t"
"lwl %0,%3\n\t"
:"=&r" (r1)
:"r" (r11),
"m" (*r11),
return r1;
}
# ifdef linux /* don't mess with other OSs */
/*
* EGCS 1.1 knows about arbitrary unaligned loads (and we don't support older
* versions anyway. Define some packed structures to talk about such things
* with.
*/
{
}
{
}
# if X_BYTE_ORDER == X_BIG_ENDIAN
static __inline__ unsigned int
{
unsigned int ret;
: "=r" (ret)
: "r" (addr));
return ret;
}
static __inline__ void
const unsigned int val)
{
: /* No outputs */
}
# endif
# define mem_barrier() \
"# prevent instructions being moved around\n\t" \
".set\tnoreorder\n\t" \
"# 8 nops to fool the R4400 pipeline\n\t" \
"nop;nop;nop;nop;nop;nop;nop;nop\n\t" \
".set\treorder" \
: /* no output */ \
: /* no input */ \
: "memory")
# define write_mem_barrier() mem_barrier()
# else /* !linux */
# define stl_u(v,p) (*(unsigned char *)(p)) = (v); \
(*(unsigned char *)(p)+1) = ((v) >> 8); \
(*(unsigned char *)(p)+2) = ((v) >> 16); \
(*(unsigned char *)(p)+3) = ((v) >> 24)
# define stw_u(v,p) (*(unsigned char *)(p)) = (v); \
(*(unsigned char *)(p)+1) = ((v) >> 8)
# define mem_barrier() /* NOP */
# endif /* !linux */
# endif /* __mips__ */
# if defined(__arm32__)
# define ldq_u(p) (*((unsigned long *)(p)))
# define ldl_u(p) (*((unsigned int *)(p)))
# define ldw_u(p) (*((unsigned short *)(p)))
# define stq_u(v,p) (*(unsigned long *)(p)) = (v)
# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
# define mem_barrier() /* NOP */
# define write_mem_barrier() /* NOP */
# endif /* __arm32__ */
# elif (defined(Lynx) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__)) && defined(__powerpc__)
# ifndef MAP_FAILED
# define MAP_FAILED ((void *)-1)
# endif
extern volatile unsigned char *ioBase;
static __inline__ unsigned char
{
register unsigned char val;
"lbzx %0,%1,%2\n\t"
"eieio"
: "=r" (val)
return val;
}
static __inline__ unsigned short
{
register unsigned short val;
"lhzx %0,%1,%2\n\t"
"eieio"
: "=r" (val)
return val;
}
static __inline__ unsigned short
{
register unsigned short val;
"lhbrx %0,%1,%2\n\t"
"eieio"
: "=r" (val)
return val;
}
static __inline__ unsigned int
{
register unsigned int val;
"lwzx %0,%1,%2\n\t"
"eieio"
: "=r" (val)
return val;
}
static __inline__ unsigned int
{
register unsigned int val;
"lwbrx %0,%1,%2\n\t"
"eieio"
: "=r" (val)
return val;
}
static __inline__ void
const unsigned char val)
{
"stbx %1,%2,%3\n\t"
}
static __inline__ void
const unsigned short val)
{
"sthbrx %1,%2,%3\n\t"
}
static __inline__ void
const unsigned short val)
{
"sthx %1,%2,%3\n\t"
}
static __inline__ void
const unsigned int val)
{
"stwbrx %1,%2,%3\n\t"
}
static __inline__ void
const unsigned int val)
{
"stwx %1,%2,%3\n\t"
}
static __inline__ void
const unsigned char val)
{
eieio();
}
static __inline__ void
const unsigned short val)
{
eieio();
}
static __inline__ void
const unsigned short val)
{
eieio();
}
static __inline__ void
const unsigned int val)
{
eieio();
}
static __inline__ void
const unsigned int val)
{
eieio();
}
static __inline__ void
{
if(ioBase == MAP_FAILED) return;
}
static __inline__ void
{
if(ioBase == MAP_FAILED) return;
}
static __inline__ void
{
if(ioBase == MAP_FAILED) return;
}
static __inline__ unsigned int
{
if(ioBase == MAP_FAILED) return 0;
}
static __inline__ unsigned int
{
if(ioBase == MAP_FAILED) return 0;
}
static __inline__ unsigned int
{
if(ioBase == MAP_FAILED) return 0;
}
# define ldl_u(p) ((*(unsigned char *)(p)) | \
(*((unsigned char *)(p)+1)<<8) | \
(*((unsigned char *)(p)+2)<<16) | \
(*((unsigned char *)(p)+3)<<24))
# define ldw_u(p) ((*(unsigned char *)(p)) | \
(*((unsigned char *)(p)+1)<<8))
# define stl_u(v,p) (*(unsigned char *)(p)) = (v); \
(*((unsigned char *)(p)+1)) = ((v) >> 8); \
(*((unsigned char *)(p)+2)) = ((v) >> 16); \
(*((unsigned char *)(p)+3)) = ((v) >> 24)
# define stw_u(v,p) (*(unsigned char *)(p)) = (v); \
(*((unsigned char *)(p)+1)) = ((v) >> 8)
# define mem_barrier() eieio()
# define write_mem_barrier() eieio()
# else /* ix86 */
# define ldq_u(p) (*((unsigned long *)(p)))
# define ldl_u(p) (*((unsigned int *)(p)))
# define ldw_u(p) (*((unsigned short *)(p)))
# define stq_u(v,p) (*(unsigned long *)(p)) = (v)
# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
# define mem_barrier() /* NOP */
# define write_mem_barrier() /* NOP */
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)
# ifdef GCCUSESGAS
/*
* If gcc uses gas rather than the native assembler, the syntax of these
* inlines has to be different. DHD
*/
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ unsigned int
{
unsigned char ret;
"=a" (ret) :
"d" (port));
return ret;
}
static __inline__ unsigned int
{
unsigned short ret;
"=a" (ret) :
"d" (port));
return ret;
}
static __inline__ unsigned int
{
unsigned int ret;
"=a" (ret) :
"d" (port));
return ret;
}
# else /* GCCUSESGAS */
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ unsigned int
{
unsigned char ret;
"=a" (ret) :
"d" (port));
return ret;
}
static __inline__ unsigned int
{
unsigned short ret;
"=a" (ret) :
"d" (port));
return ret;
}
static __inline__ unsigned int
{
unsigned int ret;
"=a" (ret) :
"d" (port));
return ret;
}
# endif /* GCCUSESGAS */
# else /* !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)*/
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ void
{
}
static __inline__ unsigned int
{
return 0;
}
static __inline__ unsigned int
{
return 0;
}
static __inline__ unsigned int
{
return 0;
}
# endif /* FAKEIT */
# endif /* ix86 */
/*
* NON-GCC PowerPC - Presumed to be PowerMAX OS for now
*/
# ifndef PowerMAX_OS
# endif
# define PPCIO_DEBUG 0
# define PPCIO_INLINE 1
# define USE_ABS_MACRO 1
/*
* Use compiler intrinsics to access certain PPC machine instructions
*/
# define eieio() __inst_eieio()
# define ldq_u(p) (*((unsigned long long *)(p)))
# define ldl_u(p) (*((unsigned long *)(p)))
# define ldw_u(p) (*((unsigned short *)(p)))
# define stq_u(v,p) (*(unsigned long long *)(p)) = (v)
# define stl_u(v,p) (*(unsigned long *)(p)) = (v)
# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
# define mem_barrier() eieio()
# define write_mem_barrier() eieio()
extern volatile unsigned char *ioBase;
# if !defined(abs) && defined(USE_ABS_MACRO)
# define abs(x) ((x) >= 0 ? (x) : -(x))
# endif
# if PPCIO_DEBUG
# else /* !PPCIO_DEBUG */
extern unsigned char inb(unsigned int a);
extern unsigned short inw(unsigned int a);
extern unsigned int inl(unsigned int a);
# if PPCIO_INLINE
# define outb(a,b) \
# else /* !PPCIO_INLINE */
extern void outb(unsigned int a, unsigned char b);
extern void outw(unsigned int a, unsigned short w);
extern void outl(unsigned int a, unsigned int l);
# endif /* PPCIO_INLINE */
# endif /* !PPCIO_DEBUG */
# else /* !GNUC && !PPC */
# if !defined(QNX4)
# ifndef asm
# define asm __asm
# endif
# endif
# ifdef SVR4
#if 0
#endif
# ifndef __HIGHC__
# ifndef __USLC__
# define __USLC__
# endif
# endif
# endif
# ifndef SCO325
# if defined(USL)
# if defined(IN_MODULE)
# define ushort unsigned short
# define ushort_t unsigned short
# define ulong unsigned long
# define ulong_t unsigned long
# define uint_t unsigned int
# define uchar_t unsigned char
# else
# endif /* IN_MODULE */
# endif /* USL */
# else
# include "scoasm.h"
# endif
# pragma asm partial_optimization outl
# pragma asm partial_optimization outw
# pragma asm partial_optimization outb
# pragma asm partial_optimization inl
# 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)))
# define stq_u(v,p) (*(unsigned long *)(p)) = (v)
# define stl_u(v,p) (*(unsigned int *)(p)) = (v)
# define stw_u(v,p) (*(unsigned short *)(p)) = (v)
# define mem_barrier() /* NOP */
# define write_mem_barrier() /* NOP */
# endif /* __GNUC__ */
# if defined(QNX4)
# endif /* QNX4 */
# 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__
/* entry points for Mmio memory access routines */
extern int (*xf86ReadMmio8)(void *, unsigned long);
extern int (*xf86ReadMmio16)(void *, unsigned long);
extern int (*xf86ReadMmio32)(void *, unsigned long);
extern void (*xf86WriteMmio8)(int, void *, unsigned long);
extern void (*xf86WriteMmio16)(int, void *, unsigned long);
extern void (*xf86WriteMmio32)(int, void *, unsigned long);
extern void (*xf86WriteMmioNB8)(int, void *, unsigned long);
extern void (*xf86WriteMmioNB16)(int, void *, unsigned long);
extern void (*xf86WriteMmioNB32)(int, void *, unsigned long);
extern void xf86JensenMemToBus(char *, long, long, int);
extern void xf86JensenBusToMem(char *, char *, unsigned long, int);
extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
/* Some macros to hide the system dependencies for MMIO accesses */
/* Changed to kill noise generated by gcc's -Wcast-align */
# if defined (JENSEN_SUPPORT)
# else
do { \
write_mem_barrier(); \
} while (0)
# endif
# elif defined(__powerpc__)
/*
* we provide byteswapping and no byteswapping functions here
* with byteswapping as default,
* drivers that don't need byteswapping should define PPC_MMIO_IS_BE
*/
# if defined(PPC_MMIO_IS_BE) /* No byteswapping */
# else /* byteswapping is the default */
# endif
{
__asm__ volatile (
"dcbf 0,%0;"
"sync;"
"icbi 0,%0;"
"sync;"
"isync;"
}
/*
* Like powerpc, we provide byteswapping and no byteswapping functions
* here with byteswapping as default, drivers that don't need byteswapping
* should define SPARC_MMIO_IS_BE (perhaps create a generic macro so that we
* do not need to use PPC_MMIO_IS_BE and the sparc one in all the same places
* of drivers?).
*/
# if defined(SPARC_MMIO_IS_BE) /* No byteswapping */
# else /* byteswapping is the default */
# endif
# else /* !__alpha__ && !__powerpc__ && !__sparc__ */
# endif /* __alpha__ */
/*
* With Intel, the version in os-support/misc/SlowBcopy.s is used.
* This avoids port I/O during the copy (which causes problems with
* some hardware).
*/
# ifdef __alpha__
# else /* __alpha__ */
# endif /* __alpha__ */
#endif /* _COMPILER_H */