Skip to contentSkip to conversation

I386 cli

DISCUSSION David Grothe 7 participants 11 messages Oct 22, 2002 – Oct 23, 2002

lore
Share & tools
lore
#0 lore raw

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it. Thanks,
Dave

#1 lore raw
Quoted 5 lines · David Grothe

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it.

I'm sure there is no definition because "cli" is the native assembler instruction on x86.

--
Erich Stefan Boleyn <[email protected]> http://www.uruk.org/
"Reality is truly stranger than fiction; Probably why fiction is so popular"

#2 lore raw
Quoted 10 lines · On Tue, Oct 22, 2002 at 01:08:43PM -0700, [email protected] wrote:
Quoted 5 lines · David Grothe

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it.

I'm sure there is no definition because "cli" is the native assembler instruction on x86.

Wrong reason. Furthermore, cli(), meaning 'global interrupt disable, across all processors', is not doable with a single instruction anyway. It's not defined, because it should not be used - usually the usage of cli() means a bug.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs
#3 lore raw

Vojtech Pavlik <[email protected]> wrote:

...

Quoted 7 lines
Quoted 2 lines

I'm sure there is no definition because "cli" is the native assembler instruction on x86.

Wrong reason. Furthermore, cli(), meaning 'global interrupt disable, across all processors', is not doable with a single instruction anyway. It's not defined, because it should not be used - usually the usage of cli() means a bug.

Yeah, I noticed I made a thinko here by not looking at the file itself, and assuming it was just a direct assembler hack... essentially the C-level variant of what is called in most OSes "splhi/spllo" rather than "cli/sti", probably because that was how it was originally used.

Good that it's finally getting purged.

--
Erich Stefan Boleyn <[email protected]> http://www.uruk.org/
"Reality is truly stranger than fiction; Probably why fiction is so popular"

#4 lore raw
In reply to [email protected]
Quoted 10 lines · [email protected] wrote:
Quoted 5 lines · David Grothe

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it.

I'm sure there is no definition because "cli" is the native assembler instruction on x86.

Whoops, foot-in-mouth... those were C level definitions, not assembler macros.

--
Erich Stefan Boleyn <[email protected]> http://www.uruk.org/
"Reality is truly stranger than fiction; Probably why fiction is so popular"

#5 lore raw
In reply to David Grothe
Quoted 5 lines · David Grothe

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it.

cli() is dead.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs
#6 lore raw
In reply to David Grothe
Quoted 5 lines · David Grothe

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it.

cli no longer exists in the kernel
the other architectures have a broken definition probably that needs to go away as well.

#7 lore raw
In reply to David Grothe
Quoted 5 lines · David Grothe

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it.

The old style cli/global irq lock stuff has been exterminated. There is no direct equivalent any more.

#8 lore raw
In reply to David Grothe
Quoted 5 lines · David Grothe

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it.

I would advise you to read: Documentation/cli-sti-removal.txt [I recall someone mentioned this documents were slightly out-dated - Ingo?]

The short version is that cli() is no loger valid, drivers using it does not compile.

Sam

#9 lore raw

Thanks, Sam. That's the answer that I was looking for. Wish I had thought to look in the Documentation directory first so as not to have to bother you. -- Dave

Quoted 6 lines · Sam Ravnborg

I would advise you to read: Documentation/cli-sti-removal.txt [I recall someone mentioned this documents were slightly out-dated - Ingo?]

The short version is that cli() is no loger valid, drivers using it does not compile.

Sam

#10 lore raw
In reply to David Grothe
Quoted 7 lines · David Grothe

In 2.5.41every architecture except Intel 386 has a "#define cli <something>" in its asm-arch/system.h file. Is there supposed to be such a define in asm-i386/system.h? If not, where does the "official" definition of cli() live for Intel? Or what is the include file that one needs to pick it up? I can't find it.
Thanks,
Dave

Grep for 'spin_lock'. You can't just use cli alone. It won't protect the critical section. You probably need:

	spin_lock_irqsave(&lock, flags);
        //.... critical section
	spin_unlock_irqrestore(&lock, flags);

Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Bush : The Fourth Reich of America