From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: 111c93,98f9256d903bde7 X-Google-Attributes: gid111c93,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: =?iso-8859-1?q?M=E5ns_Rullg=E5rd?= Newsgroups: comp.os.linux.alpha Subject: Re: User mode IO acces - PCI A/D card - Alpha station XP900 Date: Tue, 11 Oct 2005 19:13:01 +0100 Message-ID: References: <1129032472.525938.270220@f14g2000cwb.googlegroups.com> <1129039826.382311.313210@g44g2000cwa.googlegroups.com> <1129046640.719784.48750@o13g2000cwo.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: individual.net 1NqlTuZrq3Dpk6SJDcASnwm0IsT4PeelUiKh4BmgktAOKCCsAd User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.15 (Security Through Obscurity, linux) Cancel-Lock: sha1:OvD4+fuPPwP2zu/lMcxncQrU39s= Xref: g2news1.google.com comp.os.linux.alpha:488 "lpgl" writes: > Isn't accessing I/O ports, from user space, using outb/inb/outw/inw/ > after an initial ioperm() or iopl(), an i386 only feature ? > I thought everything was memory mapped on alpha, and so were PCI > devices. The PCI I/O space is mapped to some high memory regions on Alpha. The outb/inb functions simply access these memory addresses. These functions are used for at least two reasons: 1) different machine types map the I/O space at different addresses, and 2) for portability to other architectures. Another thing to be aware of on the Alpha is that the PCI memory is mapped at a high offset as well. You need to add a large number to values listed by lspci to get the real address where a card can be found, and use that when accessing /dev/mem. Again, this offset varies between machine types. The function bus_base(), declared in sys/io.h, will return the correct value. It gets even more complicated. Both PCI memory and I/O are mapped to several CPU address regions. Some of these are sparse, meaning that a 32-bit write in that region will perform an 8-bit or 16-bit write to the PCI bus. The reason for this is that the first Alpha models only had instructions to access memory 32 or 64 bits at a time. Then there's the IOMMU, but that's a different story, involving bus mastering. -- M�ns Rullg�rd mru@inprovide.com