diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-10-24 11:06:08 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-10-24 11:06:08 -0400 |
commit | 10ad799ff49508127e75f57c3927603441232ae3 (patch) | |
tree | a581669e7c2210c247f253c849e9a530fc38f719 /src/serial.c | |
parent | 89eb6241e51bc825cfbc1292802a960dcb48d778 (diff) | |
download | seabios-10ad799ff49508127e75f57c3927603441232ae3.tar.gz |
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.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/serial.c b/src/serial.c index a24f83f4..19e39ca5 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); } |