From a87ce74d606e1384f43b0afb39e1f17e2e635a1c Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 7 Nov 2021 17:58:52 +0000 Subject: [PATCH] kernel/rdb: need to reenable polling mode on the uart, remove cruft --- sys/src/9/port/rdb.c | 73 +++++++++++++------------------------------- 1 file changed, 22 insertions(+), 51 deletions(-) diff --git a/sys/src/9/port/rdb.c b/sys/src/9/port/rdb.c index 12977da26..402cbf67f 100644 --- a/sys/src/9/port/rdb.c +++ b/sys/src/9/port/rdb.c @@ -6,51 +6,27 @@ #include "io.h" #include "ureg.h" -#define DBG if(0)scrprint -#pragma varargck argpos scrprint 1 -static Ureg ureg; - -static void -scrprint(char *fmt, ...) -{ - char buf[128]; - va_list va; - int n; - - va_start(va, fmt); - n = vseprint(buf, buf+sizeof buf, fmt, va)-buf; - va_end(va); - putstrn(buf, n); -} - static char* getline(void) { static char buf[128]; int i, c; - for(;;){ - for(i=0; iphys->disable != nil) + consuart->phys->disable(consuart); + if(consuart->phys->enable != nil) + consuart->phys->enable(consuart, 0); + serialoq = nil; + } kprintoq = nil; /* turn off /dev/kprint if active */ -// scrprint("Plan 9 debugger\n"); + iprint("Edebugger reset\n"); for(;;){ req = getline(); switch(*req){ case 'r': a = addr(req+1, ureg, nil); - DBG("read %p\n", a); - iprint("R%.8lux %.2ux %.2ux %.2ux %.2ux\n", - strtoul(req+1, 0, 16), a[0], a[1], a[2], a[3]); + iprint("R%.8zux %.2ux %.2ux %.2ux %.2ux\n", + (uintptr)a, a[0], a[1], a[2], a[3]); break; case 'w': @@ -78,22 +63,8 @@ talkrdb(Ureg *ureg) *(ulong*)a = strtoul(p, nil, 16); iprint("W\n"); break; -/* - * case Tmput: - n = min[4]; - if(n > 4){ - mesg(Rerr, Ecount); - break; - } - a = addr(min+0); - scrprint("mput %.8lux\n", a); - memmove(a, min+5, n); - mesg(Rmput, mout); - break; - * - */ + default: - DBG("unknown %c\n", *req); iprint("Eunknown message\n"); break; }