Commit f69a86955e028f963ae31257bd6cb25be705a6cd

Authored by bellard
1 parent 7b936c0c

slavio_serial fixes (Blue Swirl)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1575 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 4 additions and 4 deletions
hw/slavio_serial.c
... ... @@ -195,7 +195,7 @@ static void slavio_serial_mem_writeb(void *opaque, target_phys_addr_t addr, uint
195 195 val &= 0x38;
196 196 switch (val) {
197 197 case 8:
198   - s->reg |= 0x8;
  198 + newreg |= 0x8;
199 199 break;
200 200 case 0x20:
201 201 s->rxint = 0;
... ... @@ -245,7 +245,8 @@ static void slavio_serial_mem_writeb(void *opaque, target_phys_addr_t addr, uint
245 245 handle_kbd_command(s, val);
246 246 }
247 247 s->txint = 1;
248   - s->rregs[0] |= 4;
  248 + s->rregs[0] |= 4; // Tx buffer empty
  249 + s->rregs[1] |= 1; // All sent
249 250 // Interrupts reported only on channel A
250 251 if (s->chn == 0)
251 252 s->rregs[3] |= 0x10;
... ... @@ -278,12 +279,12 @@ static uint32_t slavio_serial_mem_readb(void *opaque, target_phys_addr_t addr)
278 279 s->reg = 0;
279 280 return ret;
280 281 case 1:
281   - SER_DPRINTF("Read channel %c, ch %d\n", channel? 'b' : 'a', s->rx);
282 282 s->rregs[0] &= ~1;
283 283 if (s->type == kbd)
284 284 ret = get_queue(s);
285 285 else
286 286 ret = s->rx;
  287 + SER_DPRINTF("Read channel %c, ch %d\n", channel? 'b' : 'a', ret);
287 288 return ret;
288 289 default:
289 290 break;
... ... @@ -454,7 +455,6 @@ static void handle_kbd_command(ChannelState *s, int val)
454 455 switch (val) {
455 456 case 1: // Reset, return type code
456 457 put_queue(s, 0xff);
457   - put_queue(s, 0xff);
458 458 put_queue(s, 5); // Type 5
459 459 break;
460 460 case 7: // Query layout
... ...