cli and sti in newer 2.4.x Kernels

cli and sti in newer 2.4.x Kernels

Post by Sven Geggu » Thu, 01 May 2003 16:52:57



Hi there,

a device driver I wrote contains calls to cli and sti.

The CPU specs require Interrupts to be disabled for this settings.

This worked fine with some older 2.4.x Kernels, but is not working with
2.4.17 or newer anymore.

Can I savely disable Interrupts using inline assembler code?

Sven

--
The source code is not comprehensible
                 (found in bug section of man 8 telnetd on Redhat Linux)


 
 
 

cli and sti in newer 2.4.x Kernels

Post by Michael Schnel » Thu, 01 May 2003 18:20:26


Quote:

> Can I savely disable Interrupts using inline assembler code?

Why would you want to do this ? There are several C macros intended for
driver use. Do you write the device driver completely in ASM ? AFAIK
this is not recommended <g>.

-Michael

 
 
 

cli and sti in newer 2.4.x Kernels

Post by Sven Geggu » Thu, 01 May 2003 21:33:27



> Why would you want to do this ? There are several C macros intended for
> driver use. Do you write the device driver completely in ASM ? AFAIK
> this is not recommended <g>.

cli and sti are no longer exported functions which are usable in a driver.
Can you tell me another macro to use?

Sven

--
"Software is like sex; it's better when it's free"
                                      (Linus Torvalds)


 
 
 

cli and sti in newer 2.4.x Kernels

Post by Michael Schnel » Thu, 01 May 2003 23:02:19


I suppose cli/sti should nt be used in a multi-processor environment. So
they are obsolete. I think using spin_lock is the recommended way for
low level synchronizing.

cli() _is_ present in the kernel source. e.g. an implementation of the
spin_lock() macro in spinlock.h uses it.

-Michael