From owner-svn-src-all@FreeBSD.ORG Tue Feb 8 01:43:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7D89106566C; Tue, 8 Feb 2011 01:43:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D73FE8FC0C; Tue, 8 Feb 2011 01:43:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p181hj3p029441; Tue, 8 Feb 2011 01:43:45 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p181hjjO029439; Tue, 8 Feb 2011 01:43:45 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102080143.p181hjjO029439@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 8 Feb 2011 01:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218426 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2011 01:43:46 -0000 Author: marcel Date: Tue Feb 8 01:43:45 2011 New Revision: 218426 URL: http://svn.freebsd.org/changeset/base/218426 Log: o Make sure to mask off timer1 interrupts. It's not necessarily masked-off by the firmware. o In DELAY(). Make sure we have an inner-loop body that the compiler cannot eliminate. While timing does not have to be perfect, the loops must be there to have at least some notion of delay. Obtained from: Juniper Networks Modified: head/sys/arm/mv/timer.c Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Tue Feb 8 00:36:46 2011 (r218425) +++ head/sys/arm/mv/timer.c Tue Feb 8 01:43:45 2011 (r218426) @@ -150,6 +150,7 @@ mv_timer_attach(device_t dev) write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); irq_mask |= IRQ_TIMER0_MASK; + irq_mask &= ~IRQ_TIMER1_MASK; write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); sc->et.et_name = "CPUTimer0"; @@ -229,7 +230,7 @@ DELAY(int usec) if (!timers_initialized) { for (; usec > 0; usec--) for (val = 100; val > 0; val--) - ; + __asm __volatile("nop" ::: "memory"); return; }