minix/drivers/audio/es1371/wait.c
Arun Thomas 436d6012a3 Convert drivers/ and servers/ over to bsdmake
-Move libdriver to lib/
-Install all boot image services on filesystem to aid restartability
2010-03-22 21:25:22 +00:00

27 lines
421 B
C

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