Commit 1f5476fc authored by bellard's avatar bellard
Browse files

a20 support - keyboard led fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@441 c046a42c-6fe2-441c-8c8c-71466251a162
parent 461c0471
...@@ -2594,8 +2594,8 @@ void ide_init(void) ...@@ -2594,8 +2594,8 @@ void ide_init(void)
#define KBD_CCMD_WRITE_AUX_OBUF 0xD3 /* Write to output buffer as if #define KBD_CCMD_WRITE_AUX_OBUF 0xD3 /* Write to output buffer as if
initiated by the auxiliary device */ initiated by the auxiliary device */
#define KBD_CCMD_WRITE_MOUSE 0xD4 /* Write the following byte to the mouse */ #define KBD_CCMD_WRITE_MOUSE 0xD4 /* Write the following byte to the mouse */
#define KBD_CCMD_ENABLE_A20 0xDD #define KBD_CCMD_DISABLE_A20 0xDD /* HP vectra only ? */
#define KBD_CCMD_DISABLE_A20 0xDF #define KBD_CCMD_ENABLE_A20 0xDF /* HP vectra only ? */
#define KBD_CCMD_RESET 0xFE #define KBD_CCMD_RESET 0xFE
/* Keyboard Commands */ /* Keyboard Commands */
...@@ -2685,7 +2685,6 @@ typedef struct KBDState { ...@@ -2685,7 +2685,6 @@ typedef struct KBDState {
KBDState kbd_state; KBDState kbd_state;
int reset_requested; int reset_requested;
int a20_enabled;
/* update irq and KBD_STAT_[MOUSE_]OBF */ /* update irq and KBD_STAT_[MOUSE_]OBF */
static void kbd_update_irq(KBDState *s) static void kbd_update_irq(KBDState *s)
...@@ -2802,10 +2801,10 @@ void kbd_write_command(CPUX86State *env, uint32_t addr, uint32_t val) ...@@ -2802,10 +2801,10 @@ void kbd_write_command(CPUX86State *env, uint32_t addr, uint32_t val)
kbd_queue(s, val, 0); kbd_queue(s, val, 0);
break; break;
case KBD_CCMD_ENABLE_A20: case KBD_CCMD_ENABLE_A20:
a20_enabled = 1; cpu_x86_set_a20(env, 1);
break; break;
case KBD_CCMD_DISABLE_A20: case KBD_CCMD_DISABLE_A20:
a20_enabled = 0; cpu_x86_set_a20(env, 0);
break; break;
case KBD_CCMD_RESET: case KBD_CCMD_RESET:
reset_requested = 1; reset_requested = 1;
...@@ -2875,6 +2874,7 @@ static void kbd_write_keyboard(KBDState *s, int val) ...@@ -2875,6 +2874,7 @@ static void kbd_write_keyboard(KBDState *s, int val)
case KBD_CMD_SET_LEDS: case KBD_CMD_SET_LEDS:
case KBD_CMD_SET_RATE: case KBD_CMD_SET_RATE:
s->kbd_write_cmd = val; s->kbd_write_cmd = val;
kbd_queue(s, KBD_REPLY_ACK, 0);
break; break;
case KBD_CMD_RESET_DISABLE: case KBD_CMD_RESET_DISABLE:
kbd_reset_keyboard(s); kbd_reset_keyboard(s);
...@@ -3129,7 +3129,7 @@ void kbd_write_data(CPUX86State *env, uint32_t addr, uint32_t val) ...@@ -3129,7 +3129,7 @@ void kbd_write_data(CPUX86State *env, uint32_t addr, uint32_t val)
kbd_queue(s, val, 1); kbd_queue(s, val, 1);
break; break;
case KBD_CCMD_WRITE_OUTPORT: case KBD_CCMD_WRITE_OUTPORT:
a20_enabled = (val >> 1) & 1; cpu_x86_set_a20(env, (val >> 1) & 1);
if (!(val & 1)) { if (!(val & 1)) {
reset_requested = 1; reset_requested = 1;
cpu_x86_interrupt(global_env, CPU_INTERRUPT_EXIT); cpu_x86_interrupt(global_env, CPU_INTERRUPT_EXIT);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment