interrupt.h 18 KB

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