linux-mips
[Top] [All Lists]

Re: Equivalent of ioperm / iopl in linux mips ?

To: Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: Equivalent of ioperm / iopl in linux mips ?
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Mon, 22 Apr 2002 17:30:08 +0200 (MET DST)
Cc: Wayne Gowcher <wgowcher@yahoo.com>, Linux-MIPS <linux-mips@oss.sgi.com>
In-reply-to: <Pine.GSO.4.21.0204221654140.17279-100000@vervain.sonytel.be>
Organization: Technical University of Gdansk
Sender: owner-linux-mips@oss.sgi.com
On Mon, 22 Apr 2002, Geert Uytterhoeven wrote:

> >  Hmm, I admit I haven't looked at this matter, but aren't
> > in/out/ioperm/iopl implemented as library functions in glibc like for
> > other architectures doing MMIO?  E.g. Alpha does this an it makes porting
> 
> Perhaps. Note that you still need some /proc magic to find out the correct
> address to map. Or you can use /dev/ports.

 Well, for Alpha ioperm/iopl functions check the system type in
/proc/cpuinfo (we seem to have enough information there as well) and
failing this they check a result of readlink of /etc/alpha_systype.  Then
an appropriate region of /dev/mem is mmapped with per-page permissions set
up as requested if ioperm is used (with a worse granularity, though) and
subsequent in/out function invocations access the area as appropriate. 
See sysdeps/unix/sysv/linux/alpha/ioperm.c in glibc for details -- it's a
pretty clever solution with good performance and only a few trade-offs.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


<Prev in Thread] Current Thread [Next in Thread>