Subject: Re: linux ioperm() == netbsd ???()
To: None <hubert.feyrer@informatik.fh-regensburg.de>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: port-i386
Date: 12/20/1999 16:08:31
feyrer@rfhs8012.fh-regensburg.de said:
> a[(0xb2 / 32)] &=3D ~(1 << (32 - (0xb2 % 32)));   /* Ewww, bitbanging *=
/           =


This would be off by one anyway:-)

No, the bits are right-to-left, and the bytes LE.
This "longword" stuff in the manpage and the API
is misleading - you can treat it as byte array.
Simply

char a[256];
a[PORT/8] &=3D ~(1 << (PORT % 8));

or so.
(u_longs do work the same way of course since it is an
LE processor, but from the semantics pov it is nonsense.)

I'd stick with the i386_iopl() calls. Or better, write a driver.

best regards
Matthias