aboutsummaryrefslogtreecommitdiffstats
path: root/src/floppy.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-09-20 15:33:08 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-09-20 15:33:08 -0400
commitee2efa7303077ce98a745f637e213ba9a0965811 (patch)
tree421bea0de69c8fcc61122d96409218799efbfb0a /src/floppy.c
parent40f5b5aa1ecb189353e79009f49276193b3a87e9 (diff)
downloadseabios-ee2efa7303077ce98a745f637e213ba9a0965811.tar.gz
Support sleeping until an irq fires, and use where applicable.
Add wait_irq() - it's more efficient than looping with cpu_relax(). Also, move kbd irq enables down - only kbd_command needs it. Also, make some minor code layout improvements to kbd.c.
Diffstat (limited to 'src/floppy.c')
-rw-r--r--src/floppy.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/floppy.c b/src/floppy.c
index 922a2f51..ad7aa7f1 100644
--- a/src/floppy.c
+++ b/src/floppy.c
@@ -176,7 +176,6 @@ floppy_reset_controller()
static int
wait_floppy_irq()
{
- irq_enable();
u8 v;
for (;;) {
if (!GET_BDA(floppy_motor_counter)) {
@@ -186,9 +185,8 @@ wait_floppy_irq()
v = GET_BDA(floppy_recalibration_status);
if (v & FRS_TIMEOUT)
break;
- cpu_relax();
+ wait_irq();
}
- irq_disable();
v &= ~FRS_TIMEOUT;
SET_BDA(floppy_recalibration_status, v);