From 88893a868d12d16f61bf9b3aacd86f4ebfa21f8c Mon Sep 17 00:00:00 2001 From: Bryce Denney Date: Sun, 11 Nov 2001 00:45:42 +0000 Subject: [PATCH] - Committed patch.pic-slave-special-mask to fix bug [ #468340 ] pic:slave: OCW3 not implemented The service_master_pic() method supported special mask mode but service_slave_pic() did not. I added the code to service_slave_pic(). I have no clear way to test that this is actually working right. If I can put a gdb breakpoint in the pic.cc code and then step through and watch it work, I'll be more confident. --- bochs/iodev/pic.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/bochs/iodev/pic.cc b/bochs/iodev/pic.cc index 924c5586f..51b42dfdc 100644 --- a/bochs/iodev/pic.cc +++ b/bochs/iodev/pic.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: pic.cc,v 1.12 2001-10-03 13:10:38 bdenney Exp $ +// $Id: pic.cc,v 1.13 2001-11-11 00:45:42 bdenney Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -400,8 +400,7 @@ bx_pic_c::write(Bit32u address, Bit32u value, unsigned io_len) else if (special_mask == 0x03) { /* set specific mask */ BX_PIC_THIS s.slave_pic.special_mask = 1; service_slave_pic(); - BX_ERROR(("slave: OCW3 not implemented (%02x)", - (unsigned) value)); + BX_ERROR(("Congratulations, you found a test case for bug [ #468340 ] pic:slave: OCW3 not implemented. The bug has been fixed, but Bryce needs a way to test it. Please report exactly how you got to this point. It is perfectly safe to continue.")); } return; } @@ -625,6 +624,13 @@ bx_pic_c::service_slave_pic(void) return; } + if (BX_PIC_THIS s.master_pic.special_mask) { + /* all priorities may be enabled. check all IRR bits except ones + * which have corresponding ISR bits set + */ + lowest_priority_irq = 8; + } + else { /* Find the highest priority IRQ that is enabled due to current ISR */ isr = BX_PIC_THIS s.slave_pic.isr; if (isr) { @@ -637,11 +643,17 @@ bx_pic_c::service_slave_pic(void) } else lowest_priority_irq = 8; + } /* now, see if there are any higher priority requests */ if ((unmasked_requests = (BX_PIC_THIS s.slave_pic.irr & ~BX_PIC_THIS s.slave_pic.imr)) ) { for (irq=0; irq> irq) & 0x01) ) + continue; if (unmasked_requests & (1 << irq)) { if (bx_dbg.pic) BX_DEBUG(("slave: signalling IRQ(%u)",