From owner-p4-projects@FreeBSD.ORG Mon Mar 29 20:21:05 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B440C16A4D0; Mon, 29 Mar 2004 20:21:05 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 601C816A4CE for ; Mon, 29 Mar 2004 20:21:05 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 537E443D39 for ; Mon, 29 Mar 2004 20:21:05 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i2U4L5Ge069114 for ; Mon, 29 Mar 2004 20:21:05 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2U4L4km069069 for perforce@freebsd.org; Mon, 29 Mar 2004 20:21:04 -0800 (PST) (envelope-from marcel@freebsd.org) Date: Mon, 29 Mar 2004 20:21:04 -0800 (PST) Message-Id: <200403300421.i2U4L4km069069@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 49938 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2004 04:21:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=49938 Change 49938 by marcel@marcel_nfs on 2004/03/29 20:20:59 Don't mutilate DELAY() when the debugger is active. If the sole reason for not calling getit() is to avoid locking, then it's infinitely better to just don't lock in getit(). That way DELAY() will at least deliver on its promise to delay. This unbreaks uart(4) when used as a debug port on i386 at low speeds. Affected files ... .. //depot/projects/gdb/sys/i386/isa/clock.c#3 edit Differences ... ==== //depot/projects/gdb/sys/i386/isa/clock.c#3 (text+ko) ==== @@ -403,7 +403,10 @@ { int high, low; - mtx_lock_spin(&clock_lock); +#ifdef KDB + if (!kdb_active) + mtx_lock_spin(&clock_lock); +#endif /* Select timer0 and latch counter value. */ outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); @@ -411,7 +414,11 @@ low = inb(TIMER_CNTR0); high = inb(TIMER_CNTR0); - mtx_unlock_spin(&clock_lock); +#ifdef KDB + if (!kdb_active) + mtx_unlock_spin(&clock_lock); +#endif + return ((high << 8) | low); } @@ -458,12 +465,7 @@ * locking for many reasons, but it calls here for at least atkbd * input. */ -#ifdef KDB - if (kdb_active) - prev_tick = 0; - else -#endif - prev_tick = getit(); + prev_tick = getit(); n -= 0; /* XXX actually guess no initial overhead */ /* * Calculate (n * (timer_freq / 1e6)) without using floating point @@ -490,13 +492,7 @@ / 1000000; while (ticks_left > 0) { -#ifdef KDB - if (kdb_active) { - inb(0x84); - tick = prev_tick + 1; - } else -#endif - tick = getit(); + tick = getit(); #ifdef DELAYDEBUG ++getit_calls; #endif