Lionel Sambuc 433d6423c3 New sources layout
Change-Id: Ic716f336b7071063997cf5b4dae6d50e0b4631e9
2014-07-31 16:00:30 +02:00

28 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;
}