From owner-freebsd-hackers Wed May 1 9:15: 6 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id 521C037B400 for ; Wed, 1 May 2002 09:15:03 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id 0110AAE03F; Wed, 1 May 2002 09:15:02 -0700 (PDT) Date: Wed, 1 May 2002 09:15:02 -0700 From: Alfred Perlstein To: "Nelson, Trent ." Cc: "'freebsd-hackers@freebsd.org'" Subject: Re: Kernel spin lock facilities Message-ID: <20020501161502.GF98487@elvis.mu.org> References: <8F329FEDF58BD411BE5200508B10DA76056ED3A0@exchptc1.switch.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8F329FEDF58BD411BE5200508B10DA76056ED3A0@exchptc1.switch.com> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Nelson, Trent . [020501 06:41] wrote: > Hi, > > I'm working on porting the Linux Cisco VPN client kernel module to > FreeBSD. The API interface between the OS and their actual driver has four > spinlock functions that operate around a handle (void *) to a ``critical > section'': > > CNI_free_spin_lock > CNI_new_spin_lock > CNI_spin_lock > CNI_spin_unlock > > Funnily enough, these wrap the Linux spinlock_t/spin_lock*() > functionality quite nicely. Does the FreeBSD kernel offer such a trivial > spinlock facility? If not, could anyone suggest what type of locking > mechanism would best be used? man 9 mutex, see the MTX_SPIN section, but you might not need it. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message