Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 May 2002 10:00:16 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Alfred Perlstein <bright@mu.org>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, "Nelson, Trent ." <tnelson@switch.com>
Subject:   Re: Kernel spin lock facilities
Message-ID:  <XFMail.20020502100016.jhb@FreeBSD.org>
In-Reply-To: <20020501161502.GF98487@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 01-May-2002 Alfred Perlstein wrote:
> * Nelson, Trent . <tnelson@switch.com> [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.

Actually, a normal mutex would probably be best.  On stable these would
be nops.  On current I would use a MTX_DEF mutex.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020502100016.jhb>