From: kettenis Date: Tue, 19 Aug 2008 07:59:19 +0000 (+0000) Subject: Make it possible to enter ddb from the serial console. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=362ea72ea21cc4017e61c39187f2ed3efa80235a;p=openbsd Make it possible to enter ddb from the serial console. ok miod@, deraadt@ --- diff --git a/sys/arch/macppc/dev/zs.c b/sys/arch/macppc/dev/zs.c index 3842224d44c..317992a7e22 100644 --- a/sys/arch/macppc/dev/zs.c +++ b/sys/arch/macppc/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.16 2008/01/23 16:37:56 jsing Exp $ */ +/* $OpenBSD: zs.c,v 1.17 2008/08/19 07:59:19 kettenis Exp $ */ /* $NetBSD: zs.c,v 1.17 2001/06/19 13:42:15 wiz Exp $ */ /* @@ -1123,7 +1123,24 @@ zscninit(cp) void zs_abort(struct zs_chanstate *channel) { + volatile struct zschan *zc = zs_conschan; + int rr0; + /* Wait for end of break to avoid PROM abort. */ + /* XXX - Limit the wait? */ + do { + rr0 = zc->zc_csr; + ZS_DELAY(); + } while (rr0 & ZSRR0_BREAK); + +#if defined(DDB) + { + extern int db_active; + + if (!db_active) + Debugger(); + } +#endif } /* copied from sparc - XXX? */