From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linux Arch list <linux-arch@vger.kernel.org>
Cc: Linus Torvalds <torvalds@osdl.org>
Subject: [RFC] Add NO_IRQ to all architectures
Date: Tue, 26 Oct 2004 12:08:11 +1000 [thread overview]
Message-ID: <1098756491.17886.18.camel@gaston> (raw)
Hi !
Here'd a patch adding a definition of NO_IRQ to all archs include/asm-*/irq.h.
This patch currently defines it to (-1) for all archs. IRQ numbers are randomly
stored in int's, unsigned int's, or all sort of things all over the kernel, but
that shouldn't be a problem in most cases. NO_IRQ is mostly to be used within a
given driver, to identify a device for which it has no IRQ assigned. This
concerns relatively few drivers, like 8250 or IDE.
At this point, I do _not_ intend to fix the probe_irq_*() API to return NO_IRQ
instead of 0, that could be done in a second step (or x86 NO_IRQ could simply
be defined to be 0 ...), but I will fix IDE in a subsequent patch.
It would be nice though if things could slowly get fixed to deal with it in a
better way.
Index: linux-work/include/asm-ppc/irq.h
===================================================================
--- linux-work.orig/include/asm-ppc/irq.h 2004-10-20 13:01:04.000000000 +1000
+++ linux-work/include/asm-ppc/irq.h 2004-10-26 11:59:09.490440560 +1000
@@ -6,6 +6,8 @@
#include <asm/machdep.h> /* ppc_md */
#include <asm/atomic.h>
+#define NO_IRQ (-1)
+
/*
* These constants are used for passing information about interrupt
* signal polarity and level/edge sensing to the low-level PIC chip
Index: linux-work/include/asm-sparc64/irq.h
===================================================================
--- linux-work.orig/include/asm-sparc64/irq.h 2004-09-24 14:36:19.000000000 +1000
+++ linux-work/include/asm-sparc64/irq.h 2004-10-26 12:01:31.954782688 +1000
@@ -16,6 +16,9 @@
#include <asm/pil.h>
#include <asm/ptrace.h>
+
+#define NO_IRQ (-1)
+
/* You should not mess with this directly. That's the job of irq.c.
*
* If you make changes here, please update hand coded assembler of
Index: linux-work/include/asm-m68k/irq.h
===================================================================
--- linux-work.orig/include/asm-m68k/irq.h 2004-09-24 14:36:00.000000000 +1000
+++ linux-work/include/asm-m68k/irq.h 2004-10-26 11:57:00.807003416 +1000
@@ -10,6 +10,8 @@
#define SYS_IRQS 8
+#define NO_IRQ (-1)
+
/*
* This should be the same as the max(NUM_X_SOURCES) for all the
* different m68k hosts compiled into the kernel.
Index: linux-work/include/asm-sparc/irq.h
===================================================================
--- linux-work.orig/include/asm-sparc/irq.h 2004-09-24 14:36:16.000000000 +1000
+++ linux-work/include/asm-sparc/irq.h 2004-10-26 12:01:19.987601976 +1000
@@ -15,6 +15,8 @@
#include <asm/system.h> /* For SUN4M_NCPUS */
#include <asm/btfixup.h>
+#define NO_IRQ (-1)
+
#define __irq_ino(irq) irq
#define __irq_pil(irq) irq
BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int)
Index: linux-work/include/asm-mips/irq.h
===================================================================
--- linux-work.orig/include/asm-mips/irq.h 2004-09-24 14:36:04.000000000 +1000
+++ linux-work/include/asm-mips/irq.h 2004-10-26 11:58:04.241359928 +1000
@@ -13,6 +13,8 @@
#include <linux/linkage.h>
#include <irq.h>
+#define NO_IRQ (-1)
+
#ifdef CONFIG_I8259
static inline int irq_canonicalize(int irq)
{
Index: linux-work/include/asm-s390/irq.h
===================================================================
--- linux-work.orig/include/asm-s390/irq.h 2004-09-24 14:36:15.000000000 +1000
+++ linux-work/include/asm-s390/irq.h 2004-10-26 12:00:05.727891168 +1000
@@ -4,6 +4,8 @@
#ifdef __KERNEL__
#include <linux/hardirq.h>
+#define NO_IRQ (-1)
+
/*
* the definition of irqs has changed in 2.5.46:
* NR_IRQS is no longer the number of i/o
Index: linux-work/include/asm-cris/irq.h
===================================================================
--- linux-work.orig/include/asm-cris/irq.h 2004-09-24 14:35:38.000000000 +1000
+++ linux-work/include/asm-cris/irq.h 2004-10-26 11:52:19.446776672 +1000
@@ -3,6 +3,8 @@
#include <asm/arch/irq.h>
+#define NO_IRQ (-1)
+
extern __inline__ int irq_canonicalize(int irq)
{
return irq;
Index: linux-work/include/asm-v850/irq.h
===================================================================
--- linux-work.orig/include/asm-v850/irq.h 2004-09-24 14:36:24.000000000 +1000
+++ linux-work/include/asm-v850/irq.h 2004-10-26 12:02:11.338795408 +1000
@@ -16,6 +16,8 @@
#include <asm/machdep.h>
+#define NO_IRQ (-1)
+
/* Default NUM_MACH_IRQS. */
#ifndef NUM_MACH_IRQS
#define NUM_MACH_IRQS NUM_CPU_IRQS
Index: linux-work/include/asm-m68knommu/irq.h
===================================================================
--- linux-work.orig/include/asm-m68knommu/irq.h 2004-09-24 14:36:01.000000000 +1000
+++ linux-work/include/asm-m68knommu/irq.h 2004-10-26 11:57:29.145695280 +1000
@@ -5,6 +5,8 @@
#include <linux/interrupt.h>
#include <asm/ptrace.h>
+#define NO_IRQ (-1)
+
#ifdef CONFIG_COLDFIRE
/*
* On the ColdFire we keep track of all vectors. That way drivers
Index: linux-work/include/asm-alpha/irq.h
===================================================================
--- linux-work.orig/include/asm-alpha/irq.h 2004-09-24 14:35:29.000000000 +1000
+++ linux-work/include/asm-alpha/irq.h 2004-10-26 11:51:03.978249632 +1000
@@ -10,6 +10,8 @@
#include <linux/linkage.h>
#include <linux/config.h>
+#define NO_IRQ (-1)
+
#if defined(CONFIG_ALPHA_GENERIC)
/* Here NR_IRQS is not exact, but rather an upper bound. This is used
Index: linux-work/include/asm-sh/irq.h
===================================================================
--- linux-work.orig/include/asm-sh/irq.h 2004-10-20 13:01:04.000000000 +1000
+++ linux-work/include/asm-sh/irq.h 2004-10-26 12:00:42.009375544 +1000
@@ -15,6 +15,8 @@
#include <asm/machvec.h>
#include <asm/ptrace.h> /* for pt_regs */
+#define NO_IRQ (-1)
+
#if defined(CONFIG_SH_HP600) || \
defined(CONFIG_SH_RTS7751R2D) || \
defined(CONFIG_SH_HS7751RVOIP)
Index: linux-work/include/asm-ia64/irq.h
===================================================================
--- linux-work.orig/include/asm-ia64/irq.h 2004-09-24 14:35:55.000000000 +1000
+++ linux-work/include/asm-ia64/irq.h 2004-10-26 11:55:58.289507520 +1000
@@ -13,6 +13,7 @@
#define NR_IRQS 256
#define NR_IRQ_VECTORS NR_IRQS
+#define NO_IRQ (-1)
static __inline__ int
irq_canonicalize (int irq)
Index: linux-work/include/asm-i386/irq.h
===================================================================
--- linux-work.orig/include/asm-i386/irq.h 2004-10-20 13:01:03.000000000 +1000
+++ linux-work/include/asm-i386/irq.h 2004-10-26 11:55:10.888713536 +1000
@@ -16,6 +16,8 @@
#include "irq_vectors.h"
#include <asm/thread_info.h>
+#define NO_IRQ (-1)
+
static __inline__ int irq_canonicalize(int irq)
{
return ((irq == 2) ? 9 : irq);
Index: linux-work/include/asm-parisc/irq.h
===================================================================
--- linux-work.orig/include/asm-parisc/irq.h 2004-09-24 14:36:10.000000000 +1000
+++ linux-work/include/asm-parisc/irq.h 2004-10-26 11:58:43.460397728 +1000
@@ -19,6 +19,7 @@
#include <linux/interrupt.h>
#include <linux/config.h>
+#define NO_IRQ (-1)
#define CPU_IRQ_REGION 1
#define TIMER_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 0)
Index: linux-work/include/asm-x86_64/irq.h
===================================================================
--- linux-work.orig/include/asm-x86_64/irq.h 2004-10-20 13:01:04.000000000 +1000
+++ linux-work/include/asm-x86_64/irq.h 2004-10-26 12:02:29.283067464 +1000
@@ -10,6 +10,8 @@
* <tomsoft@informatik.tu-chemnitz.de>
*/
+#define NO_IRQ (-1)
+
#define TIMER_IRQ 0
/*
Index: linux-work/include/asm-sh64/irq.h
===================================================================
--- linux-work.orig/include/asm-sh64/irq.h 2004-09-24 14:36:16.000000000 +1000
+++ linux-work/include/asm-sh64/irq.h 2004-10-26 12:00:54.527472504 +1000
@@ -14,6 +14,8 @@
#include <linux/config.h>
+#define NO_IRQ (-1)
+
/*
* Encoded IRQs are not considered worth to be supported.
* Main reason is that there's no per-encoded-interrupt
Index: linux-work/include/asm-m32r/irq.h
===================================================================
--- linux-work.orig/include/asm-m32r/irq.h 2004-09-24 14:35:57.000000000 +1000
+++ linux-work/include/asm-m32r/irq.h 2004-10-26 11:56:27.109126272 +1000
@@ -5,6 +5,8 @@
#include <linux/config.h>
+#define NO_IRQ (-1)
+
#if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_USRV)
/*
* IRQ definitions for M32700UT
Index: linux-work/include/asm-h8300/irq.h
===================================================================
--- linux-work.orig/include/asm-h8300/irq.h 2004-09-24 14:35:39.000000000 +1000
+++ linux-work/include/asm-h8300/irq.h 2004-10-26 11:53:21.670317256 +1000
@@ -3,6 +3,8 @@
#include <asm/ptrace.h>
+#define NO_IRQ (-1)
+
#if defined(__H8300H__)
#define NR_IRQS 64
#define EXT_IRQ0 12
next reply other threads:[~2004-10-26 2:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-26 2:08 Benjamin Herrenschmidt [this message]
2004-10-26 2:17 ` [RFC] Add NO_IRQ to all architectures William Lee Irwin III
2004-10-26 2:27 ` Linus Torvalds
2004-10-26 2:31 ` Benjamin Herrenschmidt
2004-10-26 2:41 ` William Lee Irwin III
2004-10-26 8:24 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1098756491.17886.18.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=linux-arch@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.