2002-10-22 19:57:27

by David Grothe

[permalink] [raw]
Subject: I386 cli

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


2002-10-22 20:06:49

by Alan

[permalink] [raw]
Subject: Re: I386 cli

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.

2002-10-22 20:04:46

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: I386 cli

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

2002-10-22 20:02:39

by Erich Boleyn

[permalink] [raw]
Subject: Re: I386 cli


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"

2002-10-22 20:06:24

by Arjan van de Ven

[permalink] [raw]
Subject: Re: I386 cli

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.




Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2002-10-22 20:15:53

by Sam Ravnborg

[permalink] [raw]
Subject: Re: I386 cli

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

2002-10-22 20:42:14

by Erich Boleyn

[permalink] [raw]
Subject: Re: I386 cli


[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"

2002-10-22 20:40:46

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: I386 cli

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

2002-10-22 20:49:58

by Erich Boleyn

[permalink] [raw]
Subject: Re: I386 cli


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"

2002-10-22 21:22:04

by David Grothe

[permalink] [raw]
Subject: Re: I386 cli

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

2002-10-23 11:54:58

by Richard B. Johnson

[permalink] [raw]
Subject: Re: I386 cli

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