mirror of https://gitee.com/openkylin/qemu.git
pckbd: split out interrupt line changing code
Split out the interrupt line changing code from kbd_update_irq(). This is a preparation for the next patch. There is no functional change. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-4-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
cec3252416
commit
c3c4a96116
|
@ -148,15 +148,34 @@ typedef struct KBDState {
|
||||||
hwaddr mask;
|
hwaddr mask;
|
||||||
} KBDState;
|
} KBDState;
|
||||||
|
|
||||||
/* update irq and KBD_STAT_[MOUSE_]OBF */
|
|
||||||
/* XXX: not generating the irqs if KBD_MODE_DISABLE_KBD is set may be
|
/* XXX: not generating the irqs if KBD_MODE_DISABLE_KBD is set may be
|
||||||
incorrect, but it avoids having to simulate exact delays */
|
incorrect, but it avoids having to simulate exact delays */
|
||||||
static void kbd_update_irq(KBDState *s)
|
static void kbd_update_irq_lines(KBDState *s)
|
||||||
{
|
{
|
||||||
int irq_kbd_level, irq_mouse_level;
|
int irq_kbd_level, irq_mouse_level;
|
||||||
|
|
||||||
irq_kbd_level = 0;
|
irq_kbd_level = 0;
|
||||||
irq_mouse_level = 0;
|
irq_mouse_level = 0;
|
||||||
|
|
||||||
|
if (s->status & KBD_STAT_OBF) {
|
||||||
|
if (s->status & KBD_STAT_MOUSE_OBF) {
|
||||||
|
if (s->mode & KBD_MODE_MOUSE_INT) {
|
||||||
|
irq_mouse_level = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((s->mode & KBD_MODE_KBD_INT) &&
|
||||||
|
!(s->mode & KBD_MODE_DISABLE_KBD)) {
|
||||||
|
irq_kbd_level = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
qemu_set_irq(s->irq_kbd, irq_kbd_level);
|
||||||
|
qemu_set_irq(s->irq_mouse, irq_mouse_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* update irq and KBD_STAT_[MOUSE_]OBF */
|
||||||
|
static void kbd_update_irq(KBDState *s)
|
||||||
|
{
|
||||||
s->status &= ~(KBD_STAT_OBF | KBD_STAT_MOUSE_OBF);
|
s->status &= ~(KBD_STAT_OBF | KBD_STAT_MOUSE_OBF);
|
||||||
s->outport &= ~(KBD_OUT_OBF | KBD_OUT_MOUSE_OBF);
|
s->outport &= ~(KBD_OUT_OBF | KBD_OUT_MOUSE_OBF);
|
||||||
if (s->pending) {
|
if (s->pending) {
|
||||||
|
@ -166,16 +185,9 @@ static void kbd_update_irq(KBDState *s)
|
||||||
if (s->pending == KBD_PENDING_AUX) {
|
if (s->pending == KBD_PENDING_AUX) {
|
||||||
s->status |= KBD_STAT_MOUSE_OBF;
|
s->status |= KBD_STAT_MOUSE_OBF;
|
||||||
s->outport |= KBD_OUT_MOUSE_OBF;
|
s->outport |= KBD_OUT_MOUSE_OBF;
|
||||||
if (s->mode & KBD_MODE_MOUSE_INT)
|
|
||||||
irq_mouse_level = 1;
|
|
||||||
} else {
|
|
||||||
if ((s->mode & KBD_MODE_KBD_INT) &&
|
|
||||||
!(s->mode & KBD_MODE_DISABLE_KBD))
|
|
||||||
irq_kbd_level = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qemu_set_irq(s->irq_kbd, irq_kbd_level);
|
kbd_update_irq_lines(s);
|
||||||
qemu_set_irq(s->irq_mouse, irq_mouse_level);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kbd_update_kbd_irq(void *opaque, int level)
|
static void kbd_update_kbd_irq(void *opaque, int level)
|
||||||
|
|
Loading…
Reference in New Issue