On Fri, Jul 15 2022, Mark Kettenis <[email protected]> wrote:
> Same problem as sfuart(4); no support for detecting a BREAK. So
> leverage db_rint(9) to provide a way to enter DDB.
>
> ok?
I have no hardware to build or test this, but I guess you do and the
change looks fine. ok jca@
> 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
>
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE