Sun Nov 28 10:27:02 2010 UTC ()
Fix merge and ARM define handling.


(skrll)
diff -r1.6 -r1.7 xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h

cvs diff -r1.6 -r1.7 xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h (expand / switch to unified diff)

--- xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h 2010/11/23 07:08:05 1.6
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h 2010/11/28 10:27:02 1.7
@@ -697,27 +697,27 @@ xf86WriteMmio32BeNB(__volatile__ void *b @@ -697,27 +697,27 @@ xf86WriteMmio32BeNB(__volatile__ void *b
697} 697}
698 698
699static __inline__ void 699static __inline__ void
700xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset, 700xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset,
701 const unsigned int val) 701 const unsigned int val)
702{ 702{
703 unsigned long addr = ((unsigned long)base) + offset; 703 unsigned long addr = ((unsigned long)base) + offset;
704 704
705 __asm__ __volatile__("sta %0, [%1] %2" 705 __asm__ __volatile__("sta %0, [%1] %2"
706 : /* No outputs */ 706 : /* No outputs */
707 : "r" (val), "r" (addr), "i" (ASI_PL)); 707 : "r" (val), "r" (addr), "i" (ASI_PL));
708} 708}
709 709
710# elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__)) 710# elif defined(__mips__) || ((defined(__arm32__) || defined(__arm__)) && !defined(__linux__))
711# ifdef __arm32__ 711# ifdef __arm32__
712# define PORT_SIZE long 712# define PORT_SIZE long
713# else 713# else
714# define PORT_SIZE short 714# define PORT_SIZE short
715# endif 715# endif
716 716
717_X_EXPORT unsigned int IOPortBase; /* Memory mapped I/O port area */ 717_X_EXPORT unsigned int IOPortBase; /* Memory mapped I/O port area */
718 718
719static __inline__ void 719static __inline__ void
720outb(unsigned PORT_SIZE port, unsigned char val) 720outb(unsigned PORT_SIZE port, unsigned char val)
721{ 721{
722 *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val; 722 *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val;
723} 723}
@@ -736,81 +736,26 @@ outl(unsigned PORT_SIZE port, unsigned i @@ -736,81 +736,26 @@ outl(unsigned PORT_SIZE port, unsigned i
736 736
737static __inline__ unsigned int 737static __inline__ unsigned int
738inb(unsigned PORT_SIZE port) 738inb(unsigned PORT_SIZE port)
739{ 739{
740 return *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase); 740 return *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase);
741} 741}
742 742
743static __inline__ unsigned int 743static __inline__ unsigned int
744inw(unsigned PORT_SIZE port) 744inw(unsigned PORT_SIZE port)
745{ 745{
746 return *(volatile unsigned short*)(((unsigned PORT_SIZE)(port))+IOPortBase); 746 return *(volatile unsigned short*)(((unsigned PORT_SIZE)(port))+IOPortBase);
747} 747}
748 748
749#if 0 
750static __inline__ void stw_u(unsigned long val, unsigned short *p) 
751{ 
752# if defined(__GNUC__) 
753 struct __una_u16 *ptr = (struct __una_u16 *) p; 
754 ptr->x = val; 
755# else 
756 unsigned short tmp = val; 
757 memmove(p, &tmp, sizeof(*p)); 
758# endif 
759} 
760 
761# define mem_barrier() /* XXX: nop for now */ 
762# define write_mem_barrier() /* XXX: nop for now */ 
763 
764# elif defined(__mips__) || ((defined(__arm32__) || defined(__arm__)) && !defined(__linux__)) 
765# if defined(__arm32__) || defined(__arm__) 
766# define PORT_SIZE long 
767# else 
768# define PORT_SIZE short 
769# endif 
770 
771unsigned int IOPortBase; /* Memory mapped I/O port area */ 
772 
773static __inline__ void 
774outb(unsigned PORT_SIZE port, unsigned char val) 
775{ 
776 *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val; 
777} 
778 
779static __inline__ void 
780outw(unsigned PORT_SIZE port, unsigned short val) 
781{ 
782 *(volatile unsigned short*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val; 
783} 
784 
785static __inline__ void 
786outl(unsigned PORT_SIZE port, unsigned int val) 
787{ 
788 *(volatile unsigned int*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val; 
789} 
790 
791static __inline__ unsigned int 
792inb(unsigned PORT_SIZE port) 
793{ 
794 return *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase); 
795} 
796 
797static __inline__ unsigned int 
798inw(unsigned PORT_SIZE port) 
799{ 
800 return *(volatile unsigned short*)(((unsigned PORT_SIZE)(port))+IOPortBase); 
801} 
802#endif 
803 
804static __inline__ unsigned int 749static __inline__ unsigned int
805inl(unsigned PORT_SIZE port) 750inl(unsigned PORT_SIZE port)
806{ 751{
807 return *(volatile unsigned int*)(((unsigned PORT_SIZE)(port))+IOPortBase); 752 return *(volatile unsigned int*)(((unsigned PORT_SIZE)(port))+IOPortBase);
808} 753}
809 754
810 755
811# if defined(__mips__) 756# if defined(__mips__)
812# ifdef linux /* don't mess with other OSs */ 757# ifdef linux /* don't mess with other OSs */
813# if X_BYTE_ORDER == X_BIG_ENDIAN 758# if X_BYTE_ORDER == X_BIG_ENDIAN
814static __inline__ unsigned int 759static __inline__ unsigned int
815xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset) 760xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
816{ 761{
@@ -827,39 +772,26 @@ static __inline__ void @@ -827,39 +772,26 @@ static __inline__ void
827xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, 772xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
828 const unsigned int val) 773 const unsigned int val)
829{ 774{
830 unsigned long addr = ((unsigned long)base) + offset; 775 unsigned long addr = ((unsigned long)base) + offset;
831 776
832 __asm__ __volatile__("sw %0, 0(%1)" 777 __asm__ __volatile__("sw %0, 0(%1)"
833 : /* No outputs */ 778 : /* No outputs */
834 : "r" (val), "r" (addr)); 779 : "r" (val), "r" (addr));
835} 780}
836# endif 781# endif
837# endif /* !linux */ 782# endif /* !linux */
838# endif /* __mips__ */ 783# endif /* __mips__ */
839 784
840#if 0 
841# if defined(__arm32__) || defined(__arm__) 
842# define ldq_u(p) (*((unsigned long *)(p))) 
843# define ldl_u(p) (*((unsigned int *)(p))) 
844# define ldw_u(p) (*((unsigned short *)(p))) 
845# define stq_u(v,p) (*(unsigned long *)(p)) = (v) 
846# define stl_u(v,p) (*(unsigned int *)(p)) = (v) 
847# define stw_u(v,p) (*(unsigned short *)(p)) = (v) 
848# define mem_barrier() /* NOP */ 
849# define write_mem_barrier() /* NOP */ 
850# endif /* __arm32__ || __arm__ */ 
851#endif 
852 
853# elif (defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)) && defined(__powerpc__) 785# elif (defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)) && defined(__powerpc__)
854 786
855# ifndef MAP_FAILED 787# ifndef MAP_FAILED
856# define MAP_FAILED ((void *)-1) 788# define MAP_FAILED ((void *)-1)
857# endif 789# endif
858 790
859extern _X_EXPORT volatile unsigned char *ioBase; 791extern _X_EXPORT volatile unsigned char *ioBase;
860 792
861static __inline__ unsigned char 793static __inline__ unsigned char
862xf86ReadMmio8(__volatile__ void *base, const unsigned long offset) 794xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
863{ 795{
864 register unsigned char val; 796 register unsigned char val;
865 __asm__ __volatile__( 797 __asm__ __volatile__(