diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-02-16 03:37:49 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-16 03:37:49 -0500 |
commit | cc79ca691c292e9fd44f589c7940b9654e22f2f6 (patch) | |
tree | 4efe01e4f4a92f97dba326923e0a7a8af4b3bf87 /arch/powerpc/include/asm/irq.h | |
parent | 6d9285b00f776eebe459a858ebf07b56c36c60d2 (diff) |
irq_domain: Move irq_domain code from powerpc to kernel/irq
This patch only moves the code. It doesn't make any changes, and the
code is still only compiled for powerpc. Follow-on patches will generalize
the code for other architectures.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/powerpc/include/asm/irq.h')
-rw-r--r-- | arch/powerpc/include/asm/irq.h | 144 |
1 files changed, 0 insertions, 144 deletions
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h index f80f262e0597..728cc30d04ea 100644 --- a/arch/powerpc/include/asm/irq.h +++ b/arch/powerpc/include/asm/irq.h | |||
@@ -42,155 +42,11 @@ extern atomic_t ppc_n_lost_interrupts; | |||
42 | /* Same thing, used by the generic IRQ code */ | 42 | /* Same thing, used by the generic IRQ code */ |
43 | #define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS | 43 | #define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS |
44 | 44 | ||
45 | /* | ||
46 | * The host code and data structures are fairly agnostic to the fact that | ||
47 | * we use an open firmware device-tree. We do have references to struct | ||
48 | * device_node in two places: in irq_find_host() to find the host matching | ||
49 | * a given interrupt controller node, and of course as an argument to its | ||
50 | * counterpart host->ops->match() callback. However, those are treated as | ||
51 | * generic pointers by the core and the fact that it's actually a device-node | ||
52 | * pointer is purely a convention between callers and implementation. This | ||
53 | * code could thus be used on other architectures by replacing those two | ||
54 | * by some sort of arch-specific void * "token" used to identify interrupt | ||
55 | * controllers. | ||
56 | */ | ||
57 | |||
58 | struct irq_data; | 45 | struct irq_data; |
59 | extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d); | 46 | extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d); |
60 | extern irq_hw_number_t virq_to_hw(unsigned int virq); | 47 | extern irq_hw_number_t virq_to_hw(unsigned int virq); |
61 | 48 | ||
62 | /** | 49 | /** |
63 | * irq_alloc_host - Allocate a new irq_domain data structure | ||
64 | * @of_node: optional device-tree node of the interrupt controller | ||
65 | * @revmap_type: type of reverse mapping to use | ||
66 | * @revmap_arg: for IRQ_DOMAIN_MAP_LINEAR linear only: size of the map | ||
67 | * @ops: map/unmap host callbacks | ||
68 | * @inval_irq: provide a hw number in that host space that is always invalid | ||
69 | * | ||
70 | * Allocates and initialize and irq_domain structure. Note that in the case of | ||
71 | * IRQ_DOMAIN_MAP_LEGACY, the map() callback will be called before this returns | ||
72 | * for all legacy interrupts except 0 (which is always the invalid irq for | ||
73 | * a legacy controller). For a IRQ_DOMAIN_MAP_LINEAR, the map is allocated by | ||
74 | * this call as well. For a IRQ_DOMAIN_MAP_TREE, the radix tree will be allocated | ||
75 | * later during boot automatically (the reverse mapping will use the slow path | ||
76 | * until that happens). | ||
77 | */ | ||
78 | extern struct irq_domain *irq_alloc_host(struct device_node *of_node, | ||
79 | unsigned int revmap_type, | ||
80 | unsigned int revmap_arg, | ||
81 | struct irq_domain_ops *ops, | ||
82 | irq_hw_number_t inval_irq); | ||
83 | |||
84 | |||
85 | /** | ||
86 | * irq_find_host - Locates a host for a given device node | ||
87 | * @node: device-tree node of the interrupt controller | ||
88 | */ | ||
89 | extern struct irq_domain *irq_find_host(struct device_node *node); | ||
90 | |||
91 | |||
92 | /** | ||
93 | * irq_set_default_host - Set a "default" host | ||
94 | * @host: default host pointer | ||
95 | * | ||
96 | * For convenience, it's possible to set a "default" host that will be used | ||
97 | * whenever NULL is passed to irq_create_mapping(). It makes life easier for | ||
98 | * platforms that want to manipulate a few hard coded interrupt numbers that | ||
99 | * aren't properly represented in the device-tree. | ||
100 | */ | ||
101 | extern void irq_set_default_host(struct irq_domain *host); | ||
102 | |||
103 | |||
104 | /** | ||
105 | * irq_set_virq_count - Set the maximum number of virt irqs | ||
106 | * @count: number of linux virtual irqs, capped with NR_IRQS | ||
107 | * | ||
108 | * This is mainly for use by platforms like iSeries who want to program | ||
109 | * the virtual irq number in the controller to avoid the reverse mapping | ||
110 | */ | ||
111 | extern void irq_set_virq_count(unsigned int count); | ||
112 | |||
113 | |||
114 | /** | ||
115 | * irq_create_mapping - Map a hardware interrupt into linux virq space | ||
116 | * @host: host owning this hardware interrupt or NULL for default host | ||
117 | * @hwirq: hardware irq number in that host space | ||
118 | * | ||
119 | * Only one mapping per hardware interrupt is permitted. Returns a linux | ||
120 | * virq number. | ||
121 | * If the sense/trigger is to be specified, set_irq_type() should be called | ||
122 | * on the number returned from that call. | ||
123 | */ | ||
124 | extern unsigned int irq_create_mapping(struct irq_domain *host, | ||
125 | irq_hw_number_t hwirq); | ||
126 | |||
127 | |||
128 | /** | ||
129 | * irq_dispose_mapping - Unmap an interrupt | ||
130 | * @virq: linux virq number of the interrupt to unmap | ||
131 | */ | ||
132 | extern void irq_dispose_mapping(unsigned int virq); | ||
133 | |||
134 | /** | ||
135 | * irq_find_mapping - Find a linux virq from an hw irq number. | ||
136 | * @host: host owning this hardware interrupt | ||
137 | * @hwirq: hardware irq number in that host space | ||
138 | * | ||
139 | * This is a slow path, for use by generic code. It's expected that an | ||
140 | * irq controller implementation directly calls the appropriate low level | ||
141 | * mapping function. | ||
142 | */ | ||
143 | extern unsigned int irq_find_mapping(struct irq_domain *host, | ||
144 | irq_hw_number_t hwirq); | ||
145 | |||
146 | /** | ||
147 | * irq_create_direct_mapping - Allocate a virq for direct mapping | ||
148 | * @host: host to allocate the virq for or NULL for default host | ||
149 | * | ||
150 | * This routine is used for irq controllers which can choose the hardware | ||
151 | * interrupt numbers they generate. In such a case it's simplest to use | ||
152 | * the linux virq as the hardware interrupt number. | ||
153 | */ | ||
154 | extern unsigned int irq_create_direct_mapping(struct irq_domain *host); | ||
155 | |||
156 | /** | ||
157 | * irq_radix_revmap_insert - Insert a hw irq to linux virq number mapping. | ||
158 | * @host: host owning this hardware interrupt | ||
159 | * @virq: linux irq number | ||
160 | * @hwirq: hardware irq number in that host space | ||
161 | * | ||
162 | * This is for use by irq controllers that use a radix tree reverse | ||
163 | * mapping for fast lookup. | ||
164 | */ | ||
165 | extern void irq_radix_revmap_insert(struct irq_domain *host, unsigned int virq, | ||
166 | irq_hw_number_t hwirq); | ||
167 | |||
168 | /** | ||
169 | * irq_radix_revmap_lookup - Find a linux virq from a hw irq number. | ||
170 | * @host: host owning this hardware interrupt | ||
171 | * @hwirq: hardware irq number in that host space | ||
172 | * | ||
173 | * This is a fast path, for use by irq controller code that uses radix tree | ||
174 | * revmaps | ||
175 | */ | ||
176 | extern unsigned int irq_radix_revmap_lookup(struct irq_domain *host, | ||
177 | irq_hw_number_t hwirq); | ||
178 | |||
179 | /** | ||
180 | * irq_linear_revmap - Find a linux virq from a hw irq number. | ||
181 | * @host: host owning this hardware interrupt | ||
182 | * @hwirq: hardware irq number in that host space | ||
183 | * | ||
184 | * This is a fast path, for use by irq controller code that uses linear | ||
185 | * revmaps. It does fallback to the slow path if the revmap doesn't exist | ||
186 | * yet and will create the revmap entry with appropriate locking | ||
187 | */ | ||
188 | |||
189 | extern unsigned int irq_linear_revmap(struct irq_domain *host, | ||
190 | irq_hw_number_t hwirq); | ||
191 | |||
192 | |||
193 | /** | ||
194 | * irq_early_init - Init irq remapping subsystem | 50 | * irq_early_init - Init irq remapping subsystem |
195 | */ | 51 | */ |
196 | extern void irq_early_init(void); | 52 | extern void irq_early_init(void); |