aboutsummaryrefslogtreecommitdiff
path: root/src/serial.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-10-24 11:06:08 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-10-24 11:06:08 -0400
commit10ad799ff49508127e75f57c3927603441232ae3 (patch)
treea581669e7c2210c247f253c849e9a530fc38f719 /src/serial.c
parent89eb6241e51bc825cfbc1292802a960dcb48d778 (diff)
downloadseabios-hppa-10ad799ff49508127e75f57c3927603441232ae3.zip
seabios-hppa-10ad799ff49508127e75f57c3927603441232ae3.tar.gz
seabios-hppa-10ad799ff49508127e75f57c3927603441232ae3.tar.bz2
Replace irq_enable() regions with explicit calls to check for irqs.
Add new function yield() which will permit irqs to trigger. The yield() call enables irqs to occur in 32bit mode. Add [num]sleep calls that yield instead of just spinning. Rename existing int 1586 usleep call to biosusleep. Convert many calls to mdelay to msleep.
Diffstat (limited to 'src/serial.c')
-rw-r--r--src/serial.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/serial.c b/src/serial.c
index a24f83f..19e39ca 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -118,7 +118,6 @@ handle_1401(struct bregs *regs)
if (!addr)
return;
struct tick_timer_s tt = initTickTimer(GET_BDA(com_timeout[regs->dx]));
- irq_enable();
for (;;) {
u8 lsr = inb(addr+SEROFF_LSR);
if ((lsr & 0x60) == 0x60) {
@@ -133,8 +132,8 @@ handle_1401(struct bregs *regs)
regs->ah = lsr | 0x80;
break;
}
+ yield();
}
- irq_disable();
set_success(regs);
}
@@ -146,7 +145,6 @@ handle_1402(struct bregs *regs)
if (!addr)
return;
struct tick_timer_s tt = initTickTimer(GET_BDA(com_timeout[regs->dx]));
- irq_enable();
for (;;) {
u8 lsr = inb(addr+SEROFF_LSR);
if (lsr & 0x01) {
@@ -160,8 +158,8 @@ handle_1402(struct bregs *regs)
regs->ah = lsr | 0x80;
break;
}
+ yield();
}
- irq_disable();
set_success(regs);
}
@@ -265,7 +263,6 @@ handle_1700(struct bregs *regs)
return;
struct tick_timer_s tt = initTickTimer(GET_BDA(lpt_timeout[regs->dx]));
- irq_enable();
outb(regs->al, addr);
u8 val8 = inb(addr+2);
@@ -285,9 +282,9 @@ handle_1700(struct bregs *regs)
regs->ah = (v ^ 0x48) | 0x01;
break;
}
+ yield();
}
- irq_disable();
set_success(regs);
}