From owner-freebsd-drivers@FreeBSD.ORG Fri May 16 15:57:05 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 683FF106564A for ; Fri, 16 May 2008 15:57:05 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mx1.freebsd.org (Postfix) with ESMTP id 497B78FC14 for ; Fri, 16 May 2008 15:57:05 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Jx20A-000728-Cn for freebsd-drivers@freebsd.org; Fri, 16 May 2008 08:37:46 -0700 Message-ID: <17277776.post@talk.nabble.com> Date: Fri, 16 May 2008 08:37:46 -0700 (PDT) From: n4ti1us To: freebsd-drivers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: gaspar_i@yahoo.com Subject: Spin locks and software IRQs. X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2008 15:57:05 -0000 Hi All, I was looking at the linux kernel, and in the implementation of spinlocks, one can use different functions. One of them is spin_lock_bh(). What it does is it creates a spin lock and disables the software irqs. In FreeBSD on the other hand, the implementation of spinlocks is done by mtx_lock_spin (which is actually a macro that calls mtx_lock_spin_flags()) but the problem is that is disables all the irq vector (at the bottom of the stack it executes an "cli"). Is there any way one can implement spinlocks that only disable the bottom half (sof irq)? Alternatively, what would be the best way to manualy disable the soft irqs? And all this makes me think... Why has nobody implemented a "_bh" version so far? Is this an architectural decision, or is it just me being blind? -- View this message in context: http://www.nabble.com/Spin-locks-and-software-IRQs.-tp17277776p17277776.html Sent from the freebsd-drivers mailing list archive at Nabble.com.