Re: spinlock/cli/sti and unrelated modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




--- Bernd Petrovitsch <bernd@xxxxxxxxx> wrote:

> On Tue, 2005-08-23 at 17:58 -0700, john bogus wrote:
> [...]
> > and should be replaced by the spinlock interface
> > 
> >         spinlock_t mr_lock = SPIN_LOCK_UNLOCKED;
> >         unsigned long flags;                   
> >         spin_lock_irqsave(&mr_lock, flags);    
> >         /* critical section ... */             
> >         spin_unlock_irqrestore(&mr_lock, flags)
> > 
> > 
> > but I am working with a few different drivers
> (some of
> > which I didn't write). They are using gpio ports
> on a
> > embedded arm processor. My critial code would set
> a
> > single bit in a port (the other modules use other
> bits
> > in the same port) i.e.:
> >         outl(inl(XXXX_PORT) | XXXX_MASK,
> XXXX_PORT); 
> > 
> > If I use the spinlocks, the spinlock_t mr_lock is
> not
> > availble in all the modules.... so do I have a
> locking
>   ^^^^^^^^
> What exactly you mean with this?
> Do you get compiler errors about unknown variables?
> 
> > problem? how should I code this ?
> 
> You probably forget to put an 'extern' declaration
> in a .h file.
> 
> 	Bernd
> -- 
> Firmix Software GmbH                  
> http://www.firmix.at/
> mobil: +43 664 4416156                 fax: +43 1
> 7890849-55
>           Embedded Linux Development and Services
> 
> 



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux