diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2021-09-03 12:32:22 +0100 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2021-09-08 11:09:45 +0100 |
commit | 99b0f0584132d942547046bc064478db5bcbe7c5 (patch) | |
tree | 891978de19255b2172732df3de49a8bb9dffb773 /hw/char | |
parent | a04ca92a54776d832e719252b252c69339b28ec7 (diff) | |
download | qemu-99b0f0584132d942547046bc064478db5bcbe7c5.zip qemu-99b0f0584132d942547046bc064478db5bcbe7c5.tar.gz qemu-99b0f0584132d942547046bc064478db5bcbe7c5.tar.bz2 |
escc: re-use escc_reset_chn() for soft reset
This removes duplication of the internal device state initialisation between
device reset and soft reset.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210903113223.19551-9-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/char')
-rw-r--r-- | hw/char/escc.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/hw/char/escc.c b/hw/char/escc.c index 22c9741..9283ed7 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -288,7 +288,8 @@ static void escc_reset_chn(ESCCChannelState *s) static void escc_soft_reset_chn(ESCCChannelState *s) { - s->reg = 0; + escc_reset_chn(s); + s->wregs[W_CMD] = 0; s->wregs[W_INTR] &= INTR_PAR_SPEC | INTR_WTRQ_TXRX; s->wregs[W_RXCTRL] &= ~RXCTRL_RXEN; @@ -314,12 +315,6 @@ static void escc_soft_reset_chn(ESCCChannelState *s) s->rregs[R_SPEC] |= SPEC_BITS8; s->rregs[R_INTR] = 0; s->rregs[R_MISC] &= MISC_2CLKMISS; - - s->rx = s->tx = 0; - s->rxint = s->txint = 0; - s->rxint_under_svc = s->txint_under_svc = 0; - s->e0_mode = s->led_mode = s->caps_lock_mode = s->num_lock_mode = 0; - clear_queue(s); } static void escc_hard_reset_chn(ESCCChannelState *s) |