| @@ -697,27 +697,27 @@ xf86WriteMmio32BeNB(__volatile__ void *b | | | @@ -697,27 +697,27 @@ xf86WriteMmio32BeNB(__volatile__ void *b |
697 | } | | 697 | } |
698 | | | 698 | |
699 | static __inline__ void | | 699 | static __inline__ void |
700 | xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset, | | 700 | xf86WriteMmio32LeNB(__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 | |
719 | static __inline__ void | | 719 | static __inline__ void |
720 | outb(unsigned PORT_SIZE port, unsigned char val) | | 720 | outb(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 | |
737 | static __inline__ unsigned int | | 737 | static __inline__ unsigned int |
738 | inb(unsigned PORT_SIZE port) | | 738 | inb(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 | |
743 | static __inline__ unsigned int | | 743 | static __inline__ unsigned int |
744 | inw(unsigned PORT_SIZE port) | | 744 | inw(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 | | | |
750 | static __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 | | | | |
771 | unsigned int IOPortBase; /* Memory mapped I/O port area */ | | | |
772 | | | | |
773 | static __inline__ void | | | |
774 | outb(unsigned PORT_SIZE port, unsigned char val) | | | |
775 | { | | | |
776 | *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val; | | | |
777 | } | | | |
778 | | | | |
779 | static __inline__ void | | | |
780 | outw(unsigned PORT_SIZE port, unsigned short val) | | | |
781 | { | | | |
782 | *(volatile unsigned short*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val; | | | |
783 | } | | | |
784 | | | | |
785 | static __inline__ void | | | |
786 | outl(unsigned PORT_SIZE port, unsigned int val) | | | |
787 | { | | | |
788 | *(volatile unsigned int*)(((unsigned PORT_SIZE)(port))+IOPortBase) = val; | | | |
789 | } | | | |
790 | | | | |
791 | static __inline__ unsigned int | | | |
792 | inb(unsigned PORT_SIZE port) | | | |
793 | { | | | |
794 | return *(volatile unsigned char*)(((unsigned PORT_SIZE)(port))+IOPortBase); | | | |
795 | } | | | |
796 | | | | |
797 | static __inline__ unsigned int | | | |
798 | inw(unsigned PORT_SIZE port) | | | |
799 | { | | | |
800 | return *(volatile unsigned short*)(((unsigned PORT_SIZE)(port))+IOPortBase); | | | |
801 | } | | | |
802 | #endif | | | |
803 | | | | |
804 | static __inline__ unsigned int | | 749 | static __inline__ unsigned int |
805 | inl(unsigned PORT_SIZE port) | | 750 | inl(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 |
814 | static __inline__ unsigned int | | 759 | static __inline__ unsigned int |
815 | xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset) | | 760 | xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset) |
816 | { | | 761 | { |
| @@ -827,39 +772,26 @@ static __inline__ void | | | @@ -827,39 +772,26 @@ static __inline__ void |
827 | xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, | | 772 | xf86WriteMmio32Be(__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 | |
859 | extern _X_EXPORT volatile unsigned char *ioBase; | | 791 | extern _X_EXPORT volatile unsigned char *ioBase; |
860 | | | 792 | |
861 | static __inline__ unsigned char | | 793 | static __inline__ unsigned char |
862 | xf86ReadMmio8(__volatile__ void *base, const unsigned long offset) | | 794 | xf86ReadMmio8(__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__( |