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
On Tue, 2002-10-22 at 21:01, David Grothe wrote:
> 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.
On Tue, Oct 22, 2002 at 03:01:47PM -0500, David Grothe wrote:
> 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.
--
Vojtech Pavlik
SuSE Labs
David Grothe <[email protected]> wrote:
> 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"
On Tue, 2002-10-22 at 22:01, David Grothe wrote:
> 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.
On Tue, Oct 22, 2002 at 03:01:47PM -0500, David Grothe wrote:
> 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
[email protected] wrote:
> David Grothe <[email protected]> wrote:
>
> > 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"
On Tue, Oct 22, 2002 at 01:08:43PM -0700, [email protected] wrote:
> David Grothe <[email protected]> wrote:
>
> > 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.
--
Vojtech Pavlik
SuSE Labs
Vojtech Pavlik <[email protected]> wrote:
...
> > 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"
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
At 10:19 PM 10/22/2002 Tuesday, Sam Ravnborg wrote:
>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
On Tue, 22 Oct 2002, David Grothe wrote:
> 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