minix/drivers/audio/es1371/wait.c
Ben Gras 0d2d8c6db2 audio drivers. (not updated for trunk.)
sb16: port of isa sb16 driver to user-space. Port by Peter Boonstoppel.
es1371: By Laurens Bronwasser.
2007-11-23 11:30:50 +00:00

28 lines
457 B
C
Executable file

#include "../../drivers.h"
#include <sys/types.h>
#include <time.h>
#include "../../libpci/pci.h"
int WaitBitd (int paddr, int bitno, int state, long tmout)
{
unsigned long val, mask;
mask = 1UL << bitno;
tmout *= 5000;
if(state) {
while(tmout-- > 0) {
if((val = pci_inl(paddr)) & mask) {
return 0;
}
}
} else {
while(tmout-- > 0) {
if(!((val = pci_inl(paddr)) & mask)) {
return 0;
}
}
}
return 0;
}