Diff below adds code to recognize a break and invoke ddb on pluart(4).
ok?
Index: arch/arm64/dev/pluart.c
===================================================================
RCS file: /cvs/src/sys/arch/arm64/dev/pluart.c,v
retrieving revision 1.2
diff -u -p -r1.2 pluart.c
--- arch/arm64/dev/pluart.c 20 Jan 2017 08:03:21 -0000 1.2
+++ arch/arm64/dev/pluart.c 11 Apr 2017 13:50:17 -0000
@@ -256,6 +256,7 @@ pluartattach(struct device *parent, stru
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,15 @@ 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) {
+ if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
+ if (db_console)
+ Debugger();
+ continue;
+ }
+ }
if (p >= sc->sc_ibufend) {
sc->sc_floods++;
if (sc->sc_errors++ == 0)
Index: arch/armv7/dev/pluart.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/dev/pluart.c,v
retrieving revision 1.1
diff -u -p -r1.1 pluart.c
--- arch/armv7/dev/pluart.c 31 Aug 2016 16:19:40 -0000 1.1
+++ arch/armv7/dev/pluart.c 11 Apr 2017 13:50:17 -0000
@@ -260,6 +260,7 @@ pluartattach(struct device *parent, stru
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);
@@ -308,8 +309,15 @@ 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) {
+ if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
+ if (db_console)
+ Debugger();
+ continue;
+ }
+ }
if (p >= sc->sc_ibufend) {
sc->sc_floods++;
if (sc->sc_errors++ == 0)