Move ata_detect call to 32bit code.
[people/mcb30/legacybios.git] / src / util.c
1 #include "util.h" // usleep
2
3 // Sleep for n microseconds. currently using the
4 // refresh request port 0x61 bit4, toggling every 15usec
5 void
6 usleep(u32 count)
7 {
8     count = count / 15;
9     u8 kbd = inb(PORT_PS2_CTRLB);
10     while (count)
11         if ((inb(PORT_PS2_CTRLB) ^ kbd) & KBD_REFRESH)
12             count--;
13 }