From 467651fa4a81e090f223fc0a4a50188f6aedcd0f Mon Sep 17 00:00:00 2001 From: kettenis Date: Fri, 15 Jul 2022 17:14:49 +0000 Subject: [PATCH] Use db_rint() to make it possible to enter ddb(4) by typing ESC D. ok jca@, miod@ --- sys/dev/fdt/amluart.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/dev/fdt/amluart.c b/sys/dev/fdt/amluart.c index 03abf60c351..7c9aaa9b0b6 100644 --- a/sys/dev/fdt/amluart.c +++ b/sys/dev/fdt/amluart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amluart.c,v 1.3 2021/10/24 17:52:26 mpi Exp $ */ +/* $OpenBSD: amluart.c,v 1.4 2022/07/15 17:14:49 kettenis Exp $ */ /* * Copyright (c) 2019 Mark Kettenis * @@ -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 -- 2.20.1