19950312.freebsd-hackers

Andrey Gerzhov (kittle@deimos.ldc.net)
Sun, 19 Jul 1998 04:49:15 +0300 (EEST)

[USEMAP]
Date: Tue, 14 Mar 1995 08:23:32 +0100 (MET)
From: J Wunsch <j@uriah.heep.sax.de>
To: freebsd-hackers@FreeBSD.org (FreeBSD hackers)
Subject: Re: calling up ddb from a comconsole
Message-ID: <199503140723.IAA01352@uriah.heep.sax.de>
In-Reply-To: <199503140037.AAA01029@bagpuss.demon.co.uk> from "Karl Strickland"
at Mar 14, 95 00:37:09 am
_________________________________________________________________

Next in thread | Previous in thread | Raw E-Mail | Current Archive |
Help
_________________________________________________________________

As Karl Strickland wrote:
>
> ideally i'd like to do this on 1.x, though if anyone has a patch for either
> 1.x or 2.x, please send it to me!

Had a hard time getting this machine up again... This once happened
to work on a 2.0 box (actually, it still works). It uses a BREAK
character to trigger DDB. The patch is rather complex since it
adds another argument to siointr1 in order to pass the unit # down
(and decide if this port has been the console port).

Does anyone else have comments on this?

*** sio.c.orig Wed Oct 12 19:11:00 1994
--- sio.c Mon Oct 31 12:01:49 1994
***************
*** 272,278 ****
static timeout_t siodtrwakeup;
static void comflush __P((struct com_s *com));
static void comhardclose __P((struct com_s *com));
! static void siointr1 __P((struct com_s *com));
static void commctl __P((struct com_s *com, int bits, int h
ow));
static int comparam __P((struct tty *tp, struct termios *t)
);
static int sioprobe __P((struct isa_device *dev));
--- 272,278 ----
static timeout_t siodtrwakeup;
static void comflush __P((struct com_s *com));
static void comhardclose __P((struct com_s *com));
! static void siointr1 __P((struct com_s *com, int unit));
static void commctl __P((struct com_s *com, int bits, int h
ow));
static int comparam __P((struct tty *tp, struct termios *t)
);
static int sioprobe __P((struct isa_device *dev));
***************
*** 999,1005 ****
int unit;
{
#ifndef COM_MULTIPORT
! siointr1(com_addr(unit));
#else /* COM_MULTIPORT */
struct com_s *com;
bool_t possibly_more_intrs;
--- 999,1005 ----
int unit;
{
#ifndef COM_MULTIPORT
! siointr1(com_addr(unit), unit);
#else /* COM_MULTIPORT */
struct com_s *com;
bool_t possibly_more_intrs;
***************
*** 1018,1024 ****
if (com != NULL
&& (inb(com->int_id_port) & IIR_IMASK)
!= IIR_NOPEND) {
! siointr1(com);
possibly_more_intrs = TRUE;
}
}
--- 1018,1024 ----
if (com != NULL
&& (inb(com->int_id_port) & IIR_IMASK)
!= IIR_NOPEND) {
! siointr1(com, unit);
possibly_more_intrs = TRUE;
}
}
***************
*** 1027,1034 ****
}

static void
! siointr1(com)
struct com_s *com;
{
u_char line_status;
u_char modem_status;
--- 1027,1035 ----
}

static void
! siointr1(com, unit)
struct com_s *com;
+ int unit;
{
u_char line_status;
u_char modem_status;
***************
*** 1060,1065 ****
--- 1061,1080 ----
continue;
}
#endif /* KGDB */
+ #if defined(COMCONSOLE) && defined(DDB)
+ if ((line_status & LSR_BI) /* BREAK */
+ && unit == comconsole) {
+ static bool_t in_Debugger = FALSE;
+
+ if(!in_Debugger) {
+ in_Debugger = TRUE;
+ Debugger("console break");
+ in_Debugger = FALSE;
+ goto next;
+ }
+ }
+ #endif /* COMCONSOLE && DDB */
+
ioptr = com->iptr;
if (ioptr >= com->ibufend)
CE_RECORD(com, CE_INTERRUPT_BUF_OVERFLOW);
***************
*** 1085,1090 ****
--- 1100,1108 ----
* "& 0x7F" is to avoid the gcc-1.40 generating a slow
* jump from the top of the loop to here
*/
+ #if defined(COMCONSOLE) && defined(DDB)
+ next:
+ #endif
line_status = inb(com->line_status_port) & 0x7F;
}

***************
*** 1715,1721 ****
* stale input in sioopen().
*/
if (com->state >= (CS_BUSY | CS_TTGO))
! siointr1(com);

enable_intr();
splx(s);
--- 1733,1739 ----
* stale input in sioopen().
*/
if (com->state >= (CS_BUSY | CS_TTGO))
! siointr1(com, unit);

enable_intr();
splx(s);
***************
*** 1767,1773 ****
#endif
if (com->state & CS_BUSY) {
disable_intr();
! siointr1(com);
enable_intr();
} else if (tp->t_outq.c_cc != 0) {
u_int ocount;
--- 1785,1791 ----
#endif
if (com->state & CS_BUSY) {
disable_intr();
! siointr1(com, unit);
enable_intr();
} else if (tp->t_outq.c_cc != 0) {
u_int ocount;
***************
*** 1777,1783 ****
disable_intr();
com->obufend = (com->optr = com->obuf) + ocount;
com->state |= CS_BUSY;
! siointr1(com); /* fake interrupt to start output */
enable_intr();
}
out:
--- 1795,1801 ----
disable_intr();
com->obufend = (com->optr = com->obuf) + ocount;
com->state |= CS_BUSY;
! siointr1(com, unit); /* fake interrupt to start output */
enable_intr();
}
out:
***************
*** 1864,1870 ****
if (com != NULL
&& (com->state >= (CS_BUSY | CS_TTGO) || com->poll)) {
disable_intr();
! siointr1(com);
enable_intr();
}
}
--- 1882,1888 ----
if (com != NULL
&& (com->state >= (CS_BUSY | CS_TTGO) || com->poll)) {
disable_intr();
! siointr1(com, unit);
enable_intr();
}
}

--
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)

_________________________________________________________________ www@freebsd.org