Subject: Debugger entry routines and console polling
To: None <port-vax@NetBSD.ORG>
From: Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
List: port-vax
Date: 03/14/1998 15:08:42
I've just fixed support for the kernel debugger in the QDSS driver. 
However, while doing it one problem has come to my attention.  The
debugger wants to use polled console I/O using cnputc and cngetc. 
Interrupt driven I/O should be disabled with cnpollc(ON) and then 
reenabled with cnpollc(OFF).  For example, here's the code from the i386
port (/sys/arch/i386/i386/db_interface.c):

        s = splhigh();
        db_active++;
        cnpollc(TRUE);
        db_trap(type, code);
        cnpollc(FALSE);
        db_active--;
        splx(s);

However, NetBSD/vax doesn't have the cnpollc function and it does the
interrupt on/off stuff for gencons directly in
"/sys/arch/vax/vax/db_machdep.c".  It even does it if the console isn't
gencons! In that case enabling the interrupts causes a crash.  See:

        s = splddb();
        mtpr(0, PR_RXCS);
        mtpr(0, PR_TXCS);
        db_active++;
        db_trap(frame->trap, frame->code);
        db_active--;
        mtpr(GC_RIE, PR_RXCS);
        mtpr(GC_TIE, PR_TXCS);
        splx(s);

This needs to be fixed by putting the console interrupt I/O on/off stuff
into the cnpollc function for gencons and calling cnpollc.  Then the
#define ??cnpollc nullcnpollc stuff from /sys/arch/vax/vax/conf.c 
needs to be removed and everything should work the way it's supposed to.

BTW.  I just need to add QDSS detection code to the QDSS driver and then
the integration into NetBSD is done.

-- 
|  Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>              |
|  Home page:  http://www.undergrad.math.uwaterloo.ca/~bgjenero/     |
|  "Luke, you're going to find that many of the truths we cling to   |
|  depend greatly on our own point of view." - Obi-Wan Kenobi, ROTJ  |