Same problem as sfuart(4); no support for detecting a BREAK.  So
leverage db_rint(9) to provide a way to enter DDB.

ok?


Index: dev/fdt/amluart.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/amluart.c,v
retrieving revision 1.3
diff -u -p -r1.3 amluart.c
--- dev/fdt/amluart.c   24 Oct 2021 17:52:26 -0000      1.3
+++ dev/fdt/amluart.c   15 Jul 2022 09:20:10 -0000
@@ -276,8 +276,20 @@ amluart_softintr(void *arg)
 
        splx(s);
 
-       while (ibufp < ibufend)
-               (*linesw[tp->t_line].l_rint)(*ibufp++, tp);
+       while (ibufp < ibufend) {
+               int i = *ibufp++;
+#ifdef DDB
+               if (tp->t_dev == cn_tab->cn_dev) {
+                       int j = db_rint(i);
+
+                       if (j == 1)     /* Escape received, skip */
+                               continue;
+                       if (j == 2)     /* Second char wasn't 'D' */
+                               (*linesw[tp->t_line].l_rint)(27, tp);
+               }
+#endif
+               (*linesw[tp->t_line].l_rint)(i, tp);
+       }
 }
 
 int

Reply via email to