public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* Interrupts & total mess
@ 2004-10-21  6:05 Benjamin Herrenschmidt
  2004-10-21  6:07 ` Benjamin Herrenschmidt
  2004-10-21  7:26 ` Russell King
  0 siblings, 2 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2004-10-21  6:05 UTC (permalink / raw)
  To: Linux Arch list

Ok so my simple project of adding NO_IRQ definitions all over the place
is turning into a nightmare for various reasons (the probe_irq_* stuff
beeing one of them, as it currently prevents using -1, so I'm leaning
toward defining NO_IRQ as beeing INT_MIN, nothing against that ?)

However, while trying to do that in a simple way, that is with a
 #ifndef NO_IRQ
 #define NO_IRQ		(INT_MIN)
 #endif

Somewhere in some generic piece of include after we has some asm/* stuff
included to let the arch a chance to override it, I figured that, first,
there are a number of places where "irq" is defined as beeing unsigned
long... So neither INT_MIN nor -1 are appropriate. Then I noticed while
looking for the right files to add this stuff that we have, at least:

include/linux/interrupts.h
include/linux/irq.h
include/linux/hardirq.h
include/asm-*/irq.h
include/asm-*/hw_irq.h
include/asm-*/hardirq.h

Which is seriously starting to make no sense, especially when you don't
really know who is including who, with also the strange rule of never
including linux/irq.h directly from a driver since the arch may not use
the definitions in there, etc... it's a complete can of worms...

So basically, linux/irq.h should be asm-generic/irq.h right ?

Then, all of the CONFIG_HARDIRQS_GENERIC stuff in linux/interrupts.h
should be moved there as well, since that's pretty much what the things
in linux/irq.h already define.

So our path should be:

toplevel include
	linux/interrupts.h (or rename it to linux/irq.h)
	  asm/irq.h (the arch implementation)
	    [asm-generic/irq.h] (optionally using the common defs)

but I'm not sure what to do with the various hardirq.h & hw_irq.h
thingies, at least one of the 2 arch ones should die.

I'm ready to start the (painful) work of cleaning that up, though
that will probably end up in a giga-patch touching hundreds of files
(just to change a #include directive most of the time) though I won't
fix all archs, I prefer not mucking aroudn with things I don't
understand.

But I'm not sure what we want to do here, so let's discuss it a bit.

Ben.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Interrupts & total mess
  2004-10-21  6:05 Interrupts & total mess Benjamin Herrenschmidt
@ 2004-10-21  6:07 ` Benjamin Herrenschmidt
  2004-10-21  7:26 ` Russell King
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2004-10-21  6:07 UTC (permalink / raw)
  To: Linux Arch list

On Thu, 2004-10-21 at 16:05, Benjamin Herrenschmidt wrote:
> Ok so my simple project of adding NO_IRQ definitions all over the place
> is turning into a nightmare for various reasons (the probe_irq_* stuff
> beeing one of them, as it currently prevents using -1, so I'm leaning
> toward defining NO_IRQ as beeing INT_MIN, nothing against that ?)
>
> .../...

Don't reply here, I'm re-posting that to LKML instead ...

Ben.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Interrupts & total mess
  2004-10-21  6:05 Interrupts & total mess Benjamin Herrenschmidt
  2004-10-21  6:07 ` Benjamin Herrenschmidt
@ 2004-10-21  7:26 ` Russell King
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King @ 2004-10-21  7:26 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Linux Arch list

On Thu, Oct 21, 2004 at 04:05:32PM +1000, Benjamin Herrenschmidt wrote:
> Which is seriously starting to make no sense, especially when you don't
> really know who is including who, with also the strange rule of never
> including linux/irq.h directly from a driver since the arch may not use
> the definitions in there, etc... it's a complete can of worms...
> 
> So basically, linux/irq.h should be asm-generic/irq.h right ?

Correct, which is why I recently sent a patch to lkml to remove the
wrongly placed include file - in the hope that someone who cares about
it would fix it as you're suggesting (and that other people can suffer
some of the repeated breakage caused by that misplaced file.)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-21  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-21  6:05 Interrupts & total mess Benjamin Herrenschmidt
2004-10-21  6:07 ` Benjamin Herrenschmidt
2004-10-21  7:26 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox