From 5b3eaf5874413698328fdf993b90658aef5f6bb3 Mon Sep 17 00:00:00 2001 From: jca Date: Tue, 12 Jul 2022 17:14:12 +0000 Subject: [PATCH] Use db_rint() in sfuart(4) This lets me enter ddb(4) even when the riscv64 machines I manage get unusable because of NFS. Suggested by miod@, ok miod@ kettenis@ --- sys/arch/riscv64/dev/sfuart.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/arch/riscv64/dev/sfuart.c b/sys/arch/riscv64/dev/sfuart.c index 5598a28159f..2ea91a29e40 100644 --- a/sys/arch/riscv64/dev/sfuart.c +++ b/sys/arch/riscv64/dev/sfuart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sfuart.c,v 1.5 2022/04/06 18:59:27 naddy Exp $ */ +/* $OpenBSD: sfuart.c,v 1.6 2022/07/12 17:14:12 jca Exp $ */ /* * Copyright (c) 2019 Mark Kettenis * @@ -262,8 +262,20 @@ sfuart_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