lkml.org 
[lkml]   [2008]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectUsage semantics of atomic_set ( )
I'm trying to implement atomic ops for a CPU which has no inherent
support for Read-Modify-Write Ops. Instead of using a global spin lock
which protects all the atomic APIs, I want to use a spin lock per
instance of atomic_t. This works well when atomic_t is unitary and
statically initialized using ATOMIC_INIT (where I can reset the
spinlock_t as well). However if atomic_t var is embedded within a
bigger struct which is allocated dynamically how to I init the
embedded spin lock. atomic_set ( ) is the closest choice, however I
don't think it's current usage in kernel code qualifies it to be
"initializer only".

Doesn't that defeat the intended usage of atomic_t as a opaque type
which can be "effectively" used to hide other architecture specific
stuff.

Thanks,
Vineet


\
 
 \ /
  Last update: 2008-01-12 00:01    [W:0.033 / U:5.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site