irq.h (6548698f929814375fa5d62ae1db96959b0418c1) irq.h (40d50cf7ca956183f3a573bc21082e1c7d04fa7b)
1#ifdef __KERNEL__
2#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 */
11
12#include <linux/threads.h>
13#include <linux/list.h>
14#include <linux/radix-tree.h>
15
16#include <asm/types.h>
17#include <asm/atomic.h>
18
19
1#ifdef __KERNEL__
2#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 */
11
12#include <linux/threads.h>
13#include <linux/list.h>
14#include <linux/radix-tree.h>
15
16#include <asm/types.h>
17#include <asm/atomic.h>
18
19
20#define get_irq_desc(irq) (&irq_desc[(irq)])
21
22/* Define a way to iterate across irqs. */
23#define for_each_irq(i) \
24 for ((i) = 0; (i) < NR_IRQS; ++(i))
25
26extern atomic_t ppc_n_lost_interrupts;
27
28/* This number is used when no interrupt has been assigned */
29#define NO_IRQ (0)
30
31/* This is a special irq number to return from get_irq() to tell that
32 * no interrupt happened _and_ ignore it (don't count it as bad). Some
33 * platforms like iSeries rely on that.
34 */
35#define NO_IRQ_IGNORE ((unsigned int)-1)
36
20/* Define a way to iterate across irqs. */
21#define for_each_irq(i) \
22 for ((i) = 0; (i) < NR_IRQS; ++(i))
23
24extern atomic_t ppc_n_lost_interrupts;
25
26/* This number is used when no interrupt has been assigned */
27#define NO_IRQ (0)
28
29/* This is a special irq number to return from get_irq() to tell that
30 * no interrupt happened _and_ ignore it (don't count it as bad). Some
31 * platforms like iSeries rely on that.
32 */
33#define NO_IRQ_IGNORE ((unsigned int)-1)
34
37/* Total number of virq in the platform (make it a CONFIG_* option ? */
38#define NR_IRQS 512
35/* Total number of virq in the platform */
36#define NR_IRQS CONFIG_NR_IRQS
39
40/* Number of irqs reserved for the legacy controller */
41#define NUM_ISA_INTERRUPTS 16
42
37
38/* Number of irqs reserved for the legacy controller */
39#define NUM_ISA_INTERRUPTS 16
40
41/* Same thing, used by the generic IRQ code */
42#define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS
43
43/* This type is the placeholder for a hardware interrupt number. It has to
44 * be big enough to enclose whatever representation is used by a given
45 * platform.
46 */
47typedef unsigned long irq_hw_number_t;
48
49/* Interrupt controller "host" data structure. This could be defined as a
50 * irq domain controller. That is, it handles the mapping between hardware

--- 43 unchanged lines hidden (view full) ---

94 * from the firmware to a irq_hw_number_t (interrupt line number) and
95 * type (sense) that can be passed to set_irq_type(). In the absence
96 * of this callback, irq_create_of_mapping() and irq_of_parse_and_map()
97 * will return the hw number in the first cell and IRQ_TYPE_NONE for
98 * the type (which amount to keeping whatever default value the
99 * interrupt controller has for that line)
100 */
101 int (*xlate)(struct irq_host *h, struct device_node *ctrler,
44/* This type is the placeholder for a hardware interrupt number. It has to
45 * be big enough to enclose whatever representation is used by a given
46 * platform.
47 */
48typedef unsigned long irq_hw_number_t;
49
50/* Interrupt controller "host" data structure. This could be defined as a
51 * irq domain controller. That is, it handles the mapping between hardware

--- 43 unchanged lines hidden (view full) ---

95 * from the firmware to a irq_hw_number_t (interrupt line number) and
96 * type (sense) that can be passed to set_irq_type(). In the absence
97 * of this callback, irq_create_of_mapping() and irq_of_parse_and_map()
98 * will return the hw number in the first cell and IRQ_TYPE_NONE for
99 * the type (which amount to keeping whatever default value the
100 * interrupt controller has for that line)
101 */
102 int (*xlate)(struct irq_host *h, struct device_node *ctrler,
102 u32 *intspec, unsigned int intsize,
103 const u32 *intspec, unsigned int intsize,
103 irq_hw_number_t *out_hwirq, unsigned int *out_type);
104};
105
106struct irq_host {
107 struct list_head link;
108
109 /* type of reverse mapping technique */
110 unsigned int revmap_type;

--- 197 unchanged lines hidden (view full) ---

308 * @inspec: Interrupt specifier from the device-tree
309 * @intsize: Size of the interrupt specifier from the device-tree
310 *
311 * This function is identical to irq_create_mapping except that it takes
312 * as input informations straight from the device-tree (typically the results
313 * of the of_irq_map_*() functions.
314 */
315extern unsigned int irq_create_of_mapping(struct device_node *controller,
104 irq_hw_number_t *out_hwirq, unsigned int *out_type);
105};
106
107struct irq_host {
108 struct list_head link;
109
110 /* type of reverse mapping technique */
111 unsigned int revmap_type;

--- 197 unchanged lines hidden (view full) ---

309 * @inspec: Interrupt specifier from the device-tree
310 * @intsize: Size of the interrupt specifier from the device-tree
311 *
312 * This function is identical to irq_create_mapping except that it takes
313 * as input informations straight from the device-tree (typically the results
314 * of the of_irq_map_*() functions.
315 */
316extern unsigned int irq_create_of_mapping(struct device_node *controller,
316 u32 *intspec, unsigned int intsize);
317 const u32 *intspec, unsigned int intsize);
317
318/**
319 * irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
320 * @device: Device node of the device whose interrupt is to be mapped
321 * @index: Index of the interrupt to map
322 *
323 * This function is a wrapper that chains of_irq_map_one() and
324 * irq_create_of_mapping() to make things easier to callers

--- 55 unchanged lines hidden ---
318
319/**
320 * irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
321 * @device: Device node of the device whose interrupt is to be mapped
322 * @index: Index of the interrupt to map
323 *
324 * This function is a wrapper that chains of_irq_map_one() and
325 * irq_create_of_mapping() to make things easier to callers

--- 55 unchanged lines hidden ---