blob: 0e40843a1c6ed58273c1a0e2eb22841e9007e977 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifdef __KERNEL__
Paul Mackerras1b923132005-10-10 22:54:57 +10002#ifndef _ASM_POWERPC_IRQ_H
3#define _ASM_POWERPC_IRQ_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Grant Likelybae1d8f2012-02-14 14:06:50 -070012#include <linux/irqdomain.h>
Paul Mackerras1b923132005-10-10 22:54:57 +100013#include <linux/threads.h>
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100014#include <linux/list.h>
15#include <linux/radix-tree.h>
Paul Mackerras1b923132005-10-10 22:54:57 +100016
17#include <asm/types.h>
Arun Sharma600634972011-07-26 16:09:06 -070018#include <linux/atomic.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100020
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100021extern atomic_t ppc_n_lost_interrupts;
22
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100023/* This number is used when no interrupt has been assigned */
24#define NO_IRQ (0)
25
Michael Ellerman551b81f2009-10-13 19:44:44 +000026/* Total number of virq in the platform */
27#define NR_IRQS CONFIG_NR_IRQS
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100028
Michael Ellermancd015702009-10-13 19:45:03 +000029/* Same thing, used by the generic IRQ code */
30#define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS
31
Olof Johansson35923f122007-06-04 14:47:04 +100032extern irq_hw_number_t virq_to_hw(unsigned int virq);
Benjamin Herrenschmidt0b05ac62011-04-04 13:46:58 +100033
Michael Ellerman40681b92006-08-02 11:13:50 +100034/**
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100035 * irq_early_init - Init irq remapping subsystem
36 */
37extern void irq_early_init(void);
38
39static __inline__ int irq_canonicalize(int irq)
40{
41 return irq;
42}
43
Paul Mackerras1b923132005-10-10 22:54:57 +100044extern int distribute_irqs;
45
46struct irqaction;
47struct pt_regs;
48
Paul Mackerrasc6622f62006-02-24 10:06:59 +110049#define __ARCH_HAS_DO_SOFTIRQ
50
Kumar Galabcf0b082008-04-30 03:49:55 -050051#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
52/*
53 * Per-cpu stacks for handling critical, debug and machine check
54 * level interrupts.
55 */
56extern struct thread_info *critirq_ctx[NR_CPUS];
57extern struct thread_info *dbgirq_ctx[NR_CPUS];
58extern struct thread_info *mcheckirq_ctx[NR_CPUS];
59extern void exc_lvl_ctx_init(void);
60#else
61#define exc_lvl_ctx_init()
62#endif
63
Paul Mackerras1b923132005-10-10 22:54:57 +100064/*
65 * Per-cpu stacks for handling hard and soft interrupts.
66 */
67extern struct thread_info *hardirq_ctx[NR_CPUS];
68extern struct thread_info *softirq_ctx[NR_CPUS];
69
70extern void irq_ctx_init(void);
71extern void call_do_softirq(struct thread_info *tp);
David Howells7d12e782006-10-05 14:55:46 +010072extern int call_handle_irq(int irq, void *p1,
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +100073 struct thread_info *tp, void *func);
Paul Mackerrasf2783c12005-10-20 09:23:26 +100074extern void do_IRQ(struct pt_regs *regs);
75
Stuart Yoder6ec36b52011-05-19 08:54:26 -050076int irq_choose_cpu(const struct cpumask *mask);
77
Linus Torvalds1da177e2005-04-16 15:20:36 -070078#endif /* _ASM_IRQ_H */
79#endif /* __KERNEL__ */