Welcome! Log In Create A New Profile

Advanced

Why use spinlock in an ISR on a UniCPU?

Posted by Toan 
hi,

i am just curious to why one uses a spinlock inside a service routine handler on a uniprocessor machine?

Although the spinlock would never have to wait to get the lock, but why use it?

** I saw this on the r6040 ethernet driver and I am very curious. Is it included to support SMP?

thank you.


Toan
Re: Why use spinlock in an ISR on a UniCPU?
August 13, 2009 01:46PM
Hi!

It is done to be SMP safe. If you compile the kernel without SMP support, the spinlock makros will be reduced to nothing. Only the maros which turn off interrupts will remain.

-Michi

---
programing a layer 3+4 network protocol for mesh networks
see [michaelblizek.twilightparadox.com]
Toan
Re: Why use spinlock in an ISR on a UniCPU?
September 13, 2009 06:28PM
thank you for your clarification
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 7 plus 15?
Message: