interrupt.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. /* interrupt.h */
  2. #ifndef _LINUX_INTERRUPT_H
  3. #define _LINUX_INTERRUPT_H
  4. #include <linux/kernel.h>
  5. #include <linux/linkage.h>
  6. #include <linux/bitops.h>
  7. #include <linux/preempt.h>
  8. #include <linux/cpumask.h>
  9. #include <linux/irqreturn.h>
  10. #include <linux/irqnr.h>
  11. #include <linux/hardirq.h>
  12. #include <linux/sched.h>
  13. #include <linux/irqflags.h>
  14. #include <linux/smp.h>
  15. #include <linux/percpu.h>
  16. #include <linux/hrtimer.h>
  17. #include <asm/atomic.h>
  18. #include <asm/ptrace.h>
  19. #include <asm/system.h>
  20. /*
  21. * These correspond to the IORESOURCE_IRQ_* defines in
  22. * linux/ioport.h to select the interrupt line behaviour. When
  23. * requesting an interrupt without specifying a IRQF_TRIGGER, the
  24. * setting should be assumed to be "as already configured", which
  25. * may be as per machine or firmware initialisation.
  26. */
  27. #define IRQF_TRIGGER_NONE 0x00000000
  28. #define IRQF_TRIGGER_RISING 0x00000001
  29. #define IRQF_TRIGGER_FALLING 0x00000002
  30. #define IRQF_TRIGGER_HIGH 0x00000004
  31. #define IRQF_TRIGGER_LOW 0x00000008
  32. #define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \
  33. IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
  34. #define IRQF_TRIGGER_PROBE 0x00000010
  35. /*
  36. * These flags used only by the kernel as part of the
  37. * irq handling routines.
  38. *
  39. * IRQF_DISABLED - keep irqs disabled when calling the action handler
  40. * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
  41. * IRQF_SHARED - allow sharing the irq among several devices
  42. * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
  43. * IRQF_TIMER - Flag to mark this interrupt as timer interrupt
  44. * IRQF_PERCPU - Interrupt is per cpu
  45. * IRQF_NOBALANCING - Flag to exclude this interrupt from irq balancing
  46. * IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is
  47. * registered first in an shared interrupt is considered for
  48. * performance reasons)
  49. * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished.
  50. * Used by threaded interrupts which need to keep the
  51. * irq line disabled until the threaded handler has been run.
  52. */
  53. #define IRQF_DISABLED 0x00000020
  54. #define IRQF_SAMPLE_RANDOM 0x00000040
  55. #define IRQF_SHARED 0x00000080
  56. #define IRQF_PROBE_SHARED 0x00000100
  57. #define IRQF_TIMER 0x00000200
  58. #define IRQF_PERCPU 0x00000400
  59. #define IRQF_NOBALANCING 0x00000800
  60. #define IRQF_IRQPOLL 0x00001000
  61. #define IRQF_ONESHOT 0x00002000
  62. /*
  63. * Bits used by threaded handlers:
  64. * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run
  65. * IRQTF_DIED - handler thread died
  66. * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
  67. * IRQTF_AFFINITY - irq thread is requested to adjust affinity
  68. */
  69. enum {
  70. IRQTF_RUNTHREAD,
  71. IRQTF_DIED,
  72. IRQTF_WARNED,
  73. IRQTF_AFFINITY,
  74. };
  75. typedef irqreturn_t (*irq_handler_t)(int, void *);
  76. /**
  77. * struct irqaction - per interrupt action descriptor
  78. * @handler: interrupt handler function
  79. * @flags: flags (see IRQF_* above)
  80. * @mask: no comment as it is useless and about to be removed
  81. * @name: name of the device
  82. * @dev_id: cookie to identify the device
  83. * @next: pointer to the next irqaction for shared interrupts
  84. * @irq: interrupt number
  85. * @dir: pointer to the proc/irq/NN/name entry
  86. * @thread_fn: interupt handler function for threaded interrupts
  87. * @thread: thread pointer for threaded interrupts
  88. * @thread_flags: flags related to @thread
  89. */
  90. struct irqaction {
  91. irq_handler_t handler;
  92. unsigned long flags;
  93. cpumask_t mask;
  94. const char *name;
  95. void *dev_id;
  96. struct irqaction *next;
  97. int irq;
  98. struct proc_dir_entry *dir;
  99. irq_handler_t thread_fn;
  100. struct task_struct *thread;
  101. unsigned long thread_flags;
  102. };
  103. extern irqreturn_t no_action(int cpl, void *dev_id);
  104. #ifdef CONFIG_GENERIC_HARDIRQS
  105. extern int __must_check
  106. request_threaded_irq(unsigned int irq, irq_handler_t handler,
  107. irq_handler_t thread_fn,
  108. unsigned long flags, const char *name, void *dev);
  109. static inline int __must_check
  110. request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
  111. const char *name, void *dev)
  112. {
  113. return request_threaded_irq(irq, handler, NULL, flags, name, dev);
  114. }
  115. extern void exit_irq_thread(void);
  116. #else
  117. extern int __must_check
  118. request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
  119. const char *name, void *dev);
  120. /*
  121. * Special function to avoid ifdeffery in kernel/irq/devres.c which
  122. * gets magically built by GENERIC_HARDIRQS=n architectures (sparc,
  123. * m68k). I really love these $@%#!* obvious Makefile references:
  124. * ../../../kernel/irq/devres.o
  125. */
  126. static inline int __must_check
  127. request_threaded_irq(unsigned int irq, irq_handler_t handler,
  128. irq_handler_t thread_fn,
  129. unsigned long flags, const char *name, void *dev)
  130. {
  131. return request_irq(irq, handler, flags, name, dev);
  132. }
  133. static inline void exit_irq_thread(void) { }
  134. #endif
  135. extern void free_irq(unsigned int, void *);
  136. struct device;
  137. extern int __must_check
  138. devm_request_threaded_irq(struct device *dev, unsigned int irq,
  139. irq_handler_t handler, irq_handler_t thread_fn,
  140. unsigned long irqflags, const char *devname,
  141. void *dev_id);
  142. static inline int __must_check
  143. devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler,
  144. unsigned long irqflags, const char *devname, void *dev_id)
  145. {
  146. return devm_request_threaded_irq(dev, irq, handler, NULL, irqflags,
  147. devname, dev_id);
  148. }
  149. extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
  150. /*
  151. * On lockdep we dont want to enable hardirqs in hardirq
  152. * context. Use local_irq_enable_in_hardirq() to annotate
  153. * kernel code that has to do this nevertheless (pretty much
  154. * the only valid case is for old/broken hardware that is
  155. * insanely slow).
  156. *
  157. * NOTE: in theory this might break fragile code that relies
  158. * on hardirq delivery - in practice we dont seem to have such
  159. * places left. So the only effect should be slightly increased
  160. * irqs-off latencies.
  161. */
  162. #ifdef CONFIG_LOCKDEP
  163. # define local_irq_enable_in_hardirq() do { } while (0)
  164. #else
  165. # define local_irq_enable_in_hardirq() local_irq_enable()
  166. #endif
  167. extern void disable_irq_nosync(unsigned int irq);
  168. extern void disable_irq(unsigned int irq);
  169. extern void enable_irq(unsigned int irq);
  170. /* The following three functions are for the core kernel use only. */
  171. #ifdef CONFIG_GENERIC_HARDIRQS
  172. extern void suspend_device_irqs(void);
  173. extern void resume_device_irqs(void);
  174. #ifdef CONFIG_PM_SLEEP
  175. extern int check_wakeup_irqs(void);
  176. #else
  177. static inline int check_wakeup_irqs(void) { return 0; }
  178. #endif
  179. #else
  180. static inline void suspend_device_irqs(void) { };
  181. static inline void resume_device_irqs(void) { };
  182. static inline int check_wakeup_irqs(void) { return 0; }
  183. #endif
  184. #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
  185. extern cpumask_var_t irq_default_affinity;
  186. extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
  187. extern int irq_can_set_affinity(unsigned int irq);
  188. extern int irq_select_affinity(unsigned int irq);
  189. #else /* CONFIG_SMP */
  190. static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
  191. {
  192. return -EINVAL;
  193. }
  194. static inline int irq_can_set_affinity(unsigned int irq)
  195. {
  196. return 0;
  197. }
  198. static inline int irq_select_affinity(unsigned int irq) { return 0; }
  199. #endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */
  200. #ifdef CONFIG_GENERIC_HARDIRQS
  201. /*
  202. * Special lockdep variants of irq disabling/enabling.
  203. * These should be used for locking constructs that
  204. * know that a particular irq context which is disabled,
  205. * and which is the only irq-context user of a lock,
  206. * that it's safe to take the lock in the irq-disabled
  207. * section without disabling hardirqs.
  208. *
  209. * On !CONFIG_LOCKDEP they are equivalent to the normal
  210. * irq disable/enable methods.
  211. */
  212. static inline void disable_irq_nosync_lockdep(unsigned int irq)
  213. {
  214. disable_irq_nosync(irq);
  215. #ifdef CONFIG_LOCKDEP
  216. local_irq_disable();
  217. #endif
  218. }
  219. static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
  220. {
  221. disable_irq_nosync(irq);
  222. #ifdef CONFIG_LOCKDEP
  223. local_irq_save(*flags);
  224. #endif
  225. }
  226. static inline void disable_irq_lockdep(unsigned int irq)
  227. {
  228. disable_irq(irq);
  229. #ifdef CONFIG_LOCKDEP
  230. local_irq_disable();
  231. #endif
  232. }
  233. static inline void enable_irq_lockdep(unsigned int irq)
  234. {
  235. #ifdef CONFIG_LOCKDEP
  236. local_irq_enable();
  237. #endif
  238. enable_irq(irq);
  239. }
  240. static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
  241. {
  242. #ifdef CONFIG_LOCKDEP
  243. local_irq_restore(*flags);
  244. #endif
  245. enable_irq(irq);
  246. }
  247. /* IRQ wakeup (PM) control: */
  248. extern int set_irq_wake(unsigned int irq, unsigned int on);
  249. static inline int enable_irq_wake(unsigned int irq)
  250. {
  251. return set_irq_wake(irq, 1);
  252. }
  253. static inline int disable_irq_wake(unsigned int irq)
  254. {
  255. return set_irq_wake(irq, 0);
  256. }
  257. #else /* !CONFIG_GENERIC_HARDIRQS */
  258. /*
  259. * NOTE: non-genirq architectures, if they want to support the lock
  260. * validator need to define the methods below in their asm/irq.h
  261. * files, under an #ifdef CONFIG_LOCKDEP section.
  262. */
  263. #ifndef CONFIG_LOCKDEP
  264. # define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq)
  265. # define disable_irq_nosync_lockdep_irqsave(irq, flags) \
  266. disable_irq_nosync(irq)
  267. # define disable_irq_lockdep(irq) disable_irq(irq)
  268. # define enable_irq_lockdep(irq) enable_irq(irq)
  269. # define enable_irq_lockdep_irqrestore(irq, flags) \
  270. enable_irq(irq)
  271. # endif
  272. static inline int enable_irq_wake(unsigned int irq)
  273. {
  274. return 0;
  275. }
  276. static inline int disable_irq_wake(unsigned int irq)
  277. {
  278. return 0;
  279. }
  280. #endif /* CONFIG_GENERIC_HARDIRQS */
  281. #ifndef __ARCH_SET_SOFTIRQ_PENDING
  282. #define set_softirq_pending(x) (local_softirq_pending() = (x))
  283. #define or_softirq_pending(x) (local_softirq_pending() |= (x))
  284. #endif
  285. /* Some architectures might implement lazy enabling/disabling of
  286. * interrupts. In some cases, such as stop_machine, we might want
  287. * to ensure that after a local_irq_disable(), interrupts have
  288. * really been disabled in hardware. Such architectures need to
  289. * implement the following hook.
  290. */
  291. #ifndef hard_irq_disable
  292. #define hard_irq_disable() do { } while(0)
  293. #endif
  294. /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
  295. frequency threaded job scheduling. For almost all the purposes
  296. tasklets are more than enough. F.e. all serial device BHs et
  297. al. should be converted to tasklets, not to softirqs.
  298. */
  299. enum
  300. {
  301. HI_SOFTIRQ=0,
  302. TIMER_SOFTIRQ,
  303. NET_TX_SOFTIRQ,
  304. NET_RX_SOFTIRQ,
  305. BLOCK_SOFTIRQ,
  306. BLOCK_IOPOLL_SOFTIRQ,
  307. TASKLET_SOFTIRQ,
  308. SCHED_SOFTIRQ,
  309. HRTIMER_SOFTIRQ,
  310. RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
  311. NR_SOFTIRQS
  312. };
  313. /* map softirq index to softirq name. update 'softirq_to_name' in
  314. * kernel/softirq.c when adding a new softirq.
  315. */
  316. extern char *softirq_to_name[NR_SOFTIRQS];
  317. /* softirq mask and active fields moved to irq_cpustat_t in
  318. * asm/hardirq.h to get better cache usage. KAO
  319. */
  320. struct softirq_action
  321. {
  322. void (*action)(struct softirq_action *);
  323. };
  324. asmlinkage void do_softirq(void);
  325. asmlinkage void __do_softirq(void);
  326. extern void open_softirq(int nr, void (*action)(struct softirq_action *));
  327. extern void softirq_init(void);
  328. #define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)
  329. extern void raise_softirq_irqoff(unsigned int nr);
  330. extern void raise_softirq(unsigned int nr);
  331. extern void wakeup_softirqd(void);
  332. /* This is the worklist that queues up per-cpu softirq work.
  333. *
  334. * send_remote_sendirq() adds work to these lists, and
  335. * the softirq handler itself dequeues from them. The queues
  336. * are protected by disabling local cpu interrupts and they must
  337. * only be accessed by the local cpu that they are for.
  338. */
  339. DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list);
  340. /* Try to send a softirq to a remote cpu. If this cannot be done, the
  341. * work will be queued to the local cpu.
  342. */
  343. extern void send_remote_softirq(struct call_single_data *cp, int cpu, int softirq);
  344. /* Like send_remote_softirq(), but the caller must disable local cpu interrupts
  345. * and compute the current cpu, passed in as 'this_cpu'.
  346. */
  347. extern void __send_remote_softirq(struct call_single_data *cp, int cpu,
  348. int this_cpu, int softirq);
  349. /* Tasklets --- multithreaded analogue of BHs.
  350. Main feature differing them of generic softirqs: tasklet
  351. is running only on one CPU simultaneously.
  352. Main feature differing them of BHs: different tasklets
  353. may be run simultaneously on different CPUs.
  354. Properties:
  355. * If tasklet_schedule() is called, then tasklet is guaranteed
  356. to be executed on some cpu at least once after this.
  357. * If the tasklet is already scheduled, but its excecution is still not
  358. started, it will be executed only once.
  359. * If this tasklet is already running on another CPU (or schedule is called
  360. from tasklet itself), it is rescheduled for later.
  361. * Tasklet is strictly serialized wrt itself, but not
  362. wrt another tasklets. If client needs some intertask synchronization,
  363. he makes it with spinlocks.
  364. */
  365. struct tasklet_struct
  366. {
  367. struct tasklet_struct *next;
  368. unsigned long state;
  369. atomic_t count;
  370. void (*func)(unsigned long);
  371. unsigned long data;
  372. };
  373. #define DECLARE_TASKLET(name, func, data) \
  374. struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
  375. #define DECLARE_TASKLET_DISABLED(name, func, data) \
  376. struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
  377. enum
  378. {
  379. TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */
  380. TASKLET_STATE_RUN /* Tasklet is running (SMP only) */
  381. };
  382. #ifdef CONFIG_SMP
  383. static inline int tasklet_trylock(struct tasklet_struct *t)
  384. {
  385. return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state);
  386. }
  387. static inline void tasklet_unlock(struct tasklet_struct *t)
  388. {
  389. smp_mb__before_clear_bit();
  390. clear_bit(TASKLET_STATE_RUN, &(t)->state);
  391. }
  392. static inline void tasklet_unlock_wait(struct tasklet_struct *t)
  393. {
  394. while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
  395. }
  396. #else
  397. #define tasklet_trylock(t) 1
  398. #define tasklet_unlock_wait(t) do { } while (0)
  399. #define tasklet_unlock(t) do { } while (0)
  400. #endif
  401. extern void __tasklet_schedule(struct tasklet_struct *t);
  402. static inline void tasklet_schedule(struct tasklet_struct *t)
  403. {
  404. if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
  405. __tasklet_schedule(t);
  406. }
  407. extern void __tasklet_hi_schedule(struct tasklet_struct *t);
  408. static inline void tasklet_hi_schedule(struct tasklet_struct *t)
  409. {
  410. if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
  411. __tasklet_hi_schedule(t);
  412. }
  413. extern void __tasklet_hi_schedule_first(struct tasklet_struct *t);
  414. /*
  415. * This version avoids touching any other tasklets. Needed for kmemcheck
  416. * in order not to take any page faults while enqueueing this tasklet;
  417. * consider VERY carefully whether you really need this or
  418. * tasklet_hi_schedule()...
  419. */
  420. static inline void tasklet_hi_schedule_first(struct tasklet_struct *t)
  421. {
  422. if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
  423. __tasklet_hi_schedule_first(t);
  424. }
  425. static inline void tasklet_disable_nosync(struct tasklet_struct *t)
  426. {
  427. atomic_inc(&t->count);
  428. smp_mb__after_atomic_inc();
  429. }
  430. static inline void tasklet_disable(struct tasklet_struct *t)
  431. {
  432. tasklet_disable_nosync(t);
  433. tasklet_unlock_wait(t);
  434. smp_mb();
  435. }
  436. static inline void tasklet_enable(struct tasklet_struct *t)
  437. {
  438. smp_mb__before_atomic_dec();
  439. atomic_dec(&t->count);
  440. }
  441. static inline void tasklet_hi_enable(struct tasklet_struct *t)
  442. {
  443. smp_mb__before_atomic_dec();
  444. atomic_dec(&t->count);
  445. }
  446. extern void tasklet_kill(struct tasklet_struct *t);
  447. extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
  448. extern void tasklet_init(struct tasklet_struct *t,
  449. void (*func)(unsigned long), unsigned long data);
  450. struct tasklet_hrtimer {
  451. struct hrtimer timer;
  452. struct tasklet_struct tasklet;
  453. enum hrtimer_restart (*function)(struct hrtimer *);
  454. };
  455. extern void
  456. tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
  457. enum hrtimer_restart (*function)(struct hrtimer *),
  458. clockid_t which_clock, enum hrtimer_mode mode);
  459. static inline
  460. int tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
  461. const enum hrtimer_mode mode)
  462. {
  463. return hrtimer_start(&ttimer->timer, time, mode);
  464. }
  465. static inline
  466. void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
  467. {
  468. hrtimer_cancel(&ttimer->timer);
  469. tasklet_kill(&ttimer->tasklet);
  470. }
  471. /*
  472. * Autoprobing for irqs:
  473. *
  474. * probe_irq_on() and probe_irq_off() provide robust primitives
  475. * for accurate IRQ probing during kernel initialization. They are
  476. * reasonably simple to use, are not "fooled" by spurious interrupts,
  477. * and, unlike other attempts at IRQ probing, they do not get hung on
  478. * stuck interrupts (such as unused PS2 mouse interfaces on ASUS boards).
  479. *
  480. * For reasonably foolproof probing, use them as follows:
  481. *
  482. * 1. clear and/or mask the device's internal interrupt.
  483. * 2. sti();
  484. * 3. irqs = probe_irq_on(); // "take over" all unassigned idle IRQs
  485. * 4. enable the device and cause it to trigger an interrupt.
  486. * 5. wait for the device to interrupt, using non-intrusive polling or a delay.
  487. * 6. irq = probe_irq_off(irqs); // get IRQ number, 0=none, negative=multiple
  488. * 7. service the device to clear its pending interrupt.
  489. * 8. loop again if paranoia is required.
  490. *
  491. * probe_irq_on() returns a mask of allocated irq's.
  492. *
  493. * probe_irq_off() takes the mask as a parameter,
  494. * and returns the irq number which occurred,
  495. * or zero if none occurred, or a negative irq number
  496. * if more than one irq occurred.
  497. */
  498. #if defined(CONFIG_GENERIC_HARDIRQS) && !defined(CONFIG_GENERIC_IRQ_PROBE)
  499. static inline unsigned long probe_irq_on(void)
  500. {
  501. return 0;
  502. }
  503. static inline int probe_irq_off(unsigned long val)
  504. {
  505. return 0;
  506. }
  507. static inline unsigned int probe_irq_mask(unsigned long val)
  508. {
  509. return 0;
  510. }
  511. #else
  512. extern unsigned long probe_irq_on(void); /* returns 0 on failure */
  513. extern int probe_irq_off(unsigned long); /* returns 0 or negative on failure */
  514. extern unsigned int probe_irq_mask(unsigned long); /* returns mask of ISA interrupts */
  515. #endif
  516. #ifdef CONFIG_PROC_FS
  517. /* Initialize /proc/irq/ */
  518. extern void init_irq_proc(void);
  519. #else
  520. static inline void init_irq_proc(void)
  521. {
  522. }
  523. #endif
  524. #if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ)
  525. extern void debug_poll_all_shared_irqs(void);
  526. #else
  527. static inline void debug_poll_all_shared_irqs(void) { }
  528. #endif
  529. int show_interrupts(struct seq_file *p, void *v);
  530. struct irq_desc;
  531. extern int early_irq_init(void);
  532. extern int arch_probe_nr_irqs(void);
  533. extern int arch_early_irq_init(void);
  534. extern int arch_init_chip_data(struct irq_desc *desc, int node);
  535. #endif