summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Luebbe2021-08-06 16:47:00 +0200
committerPeter Maydell2021-08-25 11:48:50 +0200
commitd60af909d5131300596d4f6f052b2d0f44e76560 (patch)
tree12ea2a01a387b231f78f31688e717e80ae62a928
parenttarget/arm: kvm: use RCU_READ_LOCK_GUARD() in kvm_arch_fixup_msi_route() (diff)
downloadqemu-d60af909d5131300596d4f6f052b2d0f44e76560.tar.gz
qemu-d60af909d5131300596d4f6f052b2d0f44e76560.tar.xz
qemu-d60af909d5131300596d4f6f052b2d0f44e76560.zip
hw/char/pl011: add support for sending break
Break events are currently only handled by chardev/char-serial.c, so we just ignore errors, which results in no behaviour change for other chardevs. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Message-id: 20210806144700.3751979-1-jlu@pengutronix.de Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/char/pl011.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index dc85527a5f..6e2d7f7509 100644
--- a/hw/char/pl011.c
+++ b/hw/char/pl011.c
@@ -26,6 +26,7 @@
#include "hw/qdev-properties-system.h"
#include "migration/vmstate.h"
#include "chardev/char-fe.h"
+#include "chardev/char-serial.h"
#include "qemu/log.h"
#include "qemu/module.h"
#include "trace.h"
@@ -231,6 +232,11 @@ static void pl011_write(void *opaque, hwaddr offset,
s->read_count = 0;
s->read_pos = 0;
}
+ if ((s->lcr ^ value) & 0x1) {
+ int break_enable = value & 0x1;
+ qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_BREAK,
+ &break_enable);
+ }
s->lcr = value;
pl011_set_read_trigger(s);
break;