From 10ad799ff49508127e75f57c3927603441232ae3 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 24 Oct 2009 11:06:08 -0400 Subject: 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. --- src/serial.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/serial.c') 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); } -- cgit v1.1