machine/pio.h: No such file or directory
FreeBSD-Lis
FreeBSD at Zaleo.nl
Wed Jul 9 11:00:56 PDT 2003
Dear people,
after installing FreeBSD 5.0 I wand to start programming, to start with
some simple examples I have my first problem.
I'm missing a include file that just isn't on my system.
/usr/include/machine/pio.h
Can you guys give me a hint how to install the PIO library ?
Error message :
# cc sh2lpt.c
sh2lpt.c:1: syntax error before '.' token
sh2lpt.c:5:25: machine/pio.h: No such file or directory
sh2lpt.c: In function `ioport':
sh2lpt.c:13: storage size of `ioperm' isn't known
Source (a basic example) :
# cat sh2lpt.c
#include <unistd.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <machine/sysarch.h>
#include <machine/pio.h>
/* ioport(port) permit access to an I/O port.
* port I/O address to enable
*/
void
ioport(int port) {
u_long iomap[32];
struct i386_set_ioperm_args ioperm;
ioperm.iomap = iomap;
syscall(SYS_sysarch, I386_GET_IOPERM, (char *) &ioperm);
iomap[port >> 5] &= ~(1 << (port & 0x1f));
syscall(SYS_sysarch, I386_SET_IOPERM, (char *) &ioperm);
}
int
main() {
int i;
ioport(0x378); /* Enable access to the port */
for(i = 0; i < 256; i++) {
outb(0x378, i); /* Set the output register */
sleep(1); /* Sleep a tick */
}
return 0;
}
Kind regards,
--
Zeo Smeijsters
http://www.zaleo.homeunix.net/
http://www.zaleo.nl.
More information about the freebsd-hardware
mailing list