Subject: linux ioperm() == netbsd ???()
To: None <port-i386@netbsd.org>
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
List: port-i386
Date: 12/20/1999 02:57:16
Hi,
while porting the toshiba laptop utils to netbsd, i wonder what to do with
this Linux call:
=09ioperm(0xb2, 1, 1)
Can someone tell me if the following is correct:
#include <sys/types.h> /* pull in select(2) FD_* macros */
#include <machine/sysarch.h>
#include <err.h>
#undef FD_SETSIZE
#define FD_SETSIZE 1024 /* per i386_set_ioperm(2) */
=20
u_long a[32];
if (i386_get_ioperm(a) =3D=3D -1) { =20
warn("i386_get_ioperm");
return 1;
}
a[(0xb2 / 32)] &=3D ~(1 << (32 - (0xb2 % 32))); /* Ewww, =
bitbanging */ =20
if (i386_set_ioperm(a) =3D=3D -1) {
warn("i386_set_ioperm");
return 1;
} =20
The i386_[sg]et_ioperm() manpage is not clear about if bit #0 is the
MSB=A0or LSB of a[0], can someone enlighten me there? The code above
assumes it's the MSB, but this is just a wild guess.=20
- Hubert
--=20
NetBSD - Better for your uptime than Viagra