- Applied patch: pit-panic.

The 82c54 model (pit.cc) implements timer modes 0, 2, and 3 in its handler
  functions, without caring which timer number is involved.  However, the
  I/O write code that sets the mode is inconsistent.
    Timer 0 can be set to modes 0,2,3 only.
    Timer 1 can be set to mode 2 only.
    Timer 2 can be set to mode 2,3 only.
  From a quick reading of an 8254 datasheet, I can't see any reason to
  restrict which timer can be in which mode, so I think it's correct to
  allow ALL timers to go into ALL modes that are implemented.
This commit is contained in:
Bryce Denney 2001-04-10 02:14:37 +00:00
parent e2a0ce5c03
commit d12a76d30b

View File

@ -368,7 +368,7 @@ bx_printf("timer 0-2 mode control: comm:%02x mode:%02x bcd_mode:%u\n",
BX_PIT_THIS s.timer[1].input_latch_value = 0;
BX_PIT_THIS s.timer[1].input_latch_toggle = 0;
BX_PIT_THIS s.timer[1].bcd_mode = bcd_mode;
if ( mode!=2 || bcd_mode!=0 )
if ( (mode!=3 && mode!=2 && mode!=0) || bcd_mode!=0 )
bx_panic("pit: outp(43h): comm 7, mode %02x, bcd %02x unhandled\n",
(unsigned) mode, bcd_mode);
break;
@ -387,7 +387,7 @@ bx_printf("timer 0-2 mode control: comm:%02x mode:%02x bcd_mode:%u\n",
BX_PIT_THIS s.timer[2].input_latch_value = 0;
BX_PIT_THIS s.timer[2].input_latch_toggle = 0;
BX_PIT_THIS s.timer[2].bcd_mode = bcd_mode;
if ( (mode!=3 && mode!=2) || bcd_mode!=0 )
if ( (mode!=3 && mode!=2 && mode!=0) || bcd_mode!=0 )
bx_panic("pit: outp(43h): comm Bh, mode %02x, bcd %02x unhandled\n",
(unsigned) mode, bcd_mode);
break;