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,7 +195,7 @@ static void slavio_serial_mem_writeb(void *opaque, target_phys_addr_t addr, uint
195 val &= 0x38; 195 val &= 0x38;
196 switch (val) { 196 switch (val) {
197 case 8: 197 case 8:
198 - s->reg |= 0x8; 198 + newreg |= 0x8;
199 break; 199 break;
200 case 0x20: 200 case 0x20:
201 s->rxint = 0; 201 s->rxint = 0;
@@ -245,7 +245,8 @@ static void slavio_serial_mem_writeb(void *opaque, target_phys_addr_t addr, uint @@ -245,7 +245,8 @@ static void slavio_serial_mem_writeb(void *opaque, target_phys_addr_t addr, uint
245 handle_kbd_command(s, val); 245 handle_kbd_command(s, val);
246 } 246 }
247 s->txint = 1; 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 // Interrupts reported only on channel A 250 // Interrupts reported only on channel A
250 if (s->chn == 0) 251 if (s->chn == 0)
251 s->rregs[3] |= 0x10; 252 s->rregs[3] |= 0x10;
@@ -278,12 +279,12 @@ static uint32_t slavio_serial_mem_readb(void *opaque, target_phys_addr_t addr) @@ -278,12 +279,12 @@ static uint32_t slavio_serial_mem_readb(void *opaque, target_phys_addr_t addr)
278 s->reg = 0; 279 s->reg = 0;
279 return ret; 280 return ret;
280 case 1: 281 case 1:
281 - SER_DPRINTF("Read channel %c, ch %d\n", channel? 'b' : 'a', s->rx);  
282 s->rregs[0] &= ~1; 282 s->rregs[0] &= ~1;
283 if (s->type == kbd) 283 if (s->type == kbd)
284 ret = get_queue(s); 284 ret = get_queue(s);
285 else 285 else
286 ret = s->rx; 286 ret = s->rx;
  287 + SER_DPRINTF("Read channel %c, ch %d\n", channel? 'b' : 'a', ret);
287 return ret; 288 return ret;
288 default: 289 default:
289 break; 290 break;
@@ -454,7 +455,6 @@ static void handle_kbd_command(ChannelState *s, int val) @@ -454,7 +455,6 @@ static void handle_kbd_command(ChannelState *s, int val)
454 switch (val) { 455 switch (val) {
455 case 1: // Reset, return type code 456 case 1: // Reset, return type code
456 put_queue(s, 0xff); 457 put_queue(s, 0xff);
457 - put_queue(s, 0xff);  
458 put_queue(s, 5); // Type 5 458 put_queue(s, 5); // Type 5
459 break; 459 break;
460 case 7: // Query layout 460 case 7: // Query layout