Bug 15440

Summary: support atomic locks in the UP kernel
Product: Base System Reporter: jburkhol <jburkhol>
Component: kernAssignee: Jason Evans <jasone>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description jburkhol 1999-12-12 19:20:01 UTC
This patch brings in alpha inline asm versions of s_lock_init, s_lock,
s_lock_try and s_unlock from netbsd, and converts the existing i386
routines to inline asm as well.  This way the locks are useable from
userland, simply by including <machine/lock.h>.  It is hoped that 
these routines will aid in making the linuxthreads port pltaform
independent, and serve as a basis for more advanvced synchronization
primitives when native threads are developed.

I've tested this on a UP i386 machine, but do not have access to
SMP or alpha hardware.  An SMP kernel compiles, and there should
be no functional changes in that case, since the debug versions
in simplelock.s are used rather than these inline ones.  The alpha
versions are taken directly from netbsd, so I assume they work fine.

Fix: The patch is included below, and is also available at
http://io.yi.org/lock.diff.
How-To-Repeat: 
n/a
Comment 1 Jason Evans freebsd_committer freebsd_triage 1999-12-16 05:51:14 UTC
Responsible Changed
From-To: freebsd-bugs->jasone

The originator of the PR asked me to address the PR. 
Comment 2 Jason Evans freebsd_committer freebsd_triage 2000-09-11 21:59:32 UTC
State Changed
From-To: open->closed

The SMPng commit adds atomic locks.