summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-04-11 15:16:15 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-04-11 15:16:15 +0000
commit4ad2a24caf1563d8d36d3d0da911f817c6bde672 (patch)
tree41ecc36d496a9654ab2910a267f8cc6146b904d0 /sys/arch/arm64/dev
parent2c104ec6a5078e740dbdfc731d2566fce0a32cd6 (diff)
Recognize break conditions and enter ddb if ddb.console is set.
ok visa@, deraadt@
Diffstat (limited to 'sys/arch/arm64/dev')
-rw-r--r--sys/arch/arm64/dev/pluart.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/pluart.c b/sys/arch/arm64/dev/pluart.c
index 18bcd9739bf..3d468709044 100644
--- a/sys/arch/arm64/dev/pluart.c
+++ b/sys/arch/arm64/dev/pluart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pluart.c,v 1.2 2017/01/20 08:03:21 patrick Exp $ */
+/* $OpenBSD: pluart.c,v 1.3 2017/04/11 15:16:14 kettenis Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
@@ -256,6 +256,7 @@ pluartattach(struct device *parent, struct device *self, void *aux)
cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
printf(": console");
+ SET(sc->sc_hwflags, COM_HW_CONSOLE);
}
timeout_set(&sc->sc_diag_tmo, pluart_diag, sc);
@@ -304,8 +305,18 @@ pluart_intr(void *arg)
p = sc->sc_ibufp;
- while(ISSET(bus_space_read_4(iot, ioh, UART_FR), UART_FR_RXFF)) {
- c = bus_space_read_1(iot, ioh, UART_DR);
+ while (ISSET(bus_space_read_4(iot, ioh, UART_FR), UART_FR_RXFF)) {
+ c = bus_space_read_2(iot, ioh, UART_DR);
+ if (c & UART_DR_BE) {
+#ifdef DDB
+ if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
+ if (db_console)
+ Debugger();
+ continue;
+ }
+#endif
+ c = 0;
+ }
if (p >= sc->sc_ibufend) {
sc->sc_floods++;
if (sc->sc_errors++ == 0)