blob: 31a35c33df6302c2be2509b777d262e24c02445d [file] [log] [blame]
Michal Simekeedbdab2009-03-27 14:25:49 +01001/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IRQ_H
10#define _ASM_MICROBLAZE_IRQ_H
11
12#define NR_IRQS 32
Remis Lima Baima0a584582009-06-18 19:55:33 +020013#include <asm-generic/irq.h>
Michal Simekeedbdab2009-03-27 14:25:49 +010014
15#include <linux/interrupt.h>
16
Michal Simekc6ba01a2010-01-14 15:16:31 +010017/* This type is the placeholder for a hardware interrupt number. It has to
18 * be big enough to enclose whatever representation is used by a given
19 * platform.
20 */
21typedef unsigned long irq_hw_number_t;
22
Michal Simekeedbdab2009-03-27 14:25:49 +010023extern unsigned int nr_irq;
24
25#define NO_IRQ (-1)
26
Michal Simekeedbdab2009-03-27 14:25:49 +010027struct pt_regs;
28extern void do_IRQ(struct pt_regs *regs);
29
Michal Simekc6ba01a2010-01-14 15:16:31 +010030/**
31 * irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
Michal Simekeedbdab2009-03-27 14:25:49 +010032 * @device: Device node of the device whose interrupt is to be mapped
33 * @index: Index of the interrupt to map
34 *
35 * This function is a wrapper that chains of_irq_map_one() and
36 * irq_create_of_mapping() to make things easier to callers
37 */
38struct device_node;
39extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index);
40
41/** FIXME - not implement
42 * irq_dispose_mapping - Unmap an interrupt
43 * @virq: linux virq number of the interrupt to unmap
44 */
45static inline void irq_dispose_mapping(unsigned int virq)
46{
47 return;
48}
49
Michal Simekc6ba01a2010-01-14 15:16:31 +010050struct irq_host;
51
52/**
53 * irq_create_mapping - Map a hardware interrupt into linux virq space
54 * @host: host owning this hardware interrupt or NULL for default host
55 * @hwirq: hardware irq number in that host space
56 *
57 * Only one mapping per hardware interrupt is permitted. Returns a linux
58 * virq number.
59 * If the sense/trigger is to be specified, set_irq_type() should be called
60 * on the number returned from that call.
61 */
62extern unsigned int irq_create_mapping(struct irq_host *host,
63 irq_hw_number_t hwirq);
64
65/**
66 * irq_create_of_mapping - Map a hardware interrupt into linux virq space
67 * @controller: Device node of the interrupt controller
68 * @inspec: Interrupt specifier from the device-tree
69 * @intsize: Size of the interrupt specifier from the device-tree
70 *
71 * This function is identical to irq_create_mapping except that it takes
72 * as input informations straight from the device-tree (typically the results
73 * of the of_irq_map_*() functions.
74 */
75extern unsigned int irq_create_of_mapping(struct device_node *controller,
76 u32 *intspec, unsigned int intsize);
77
Michal Simekeedbdab2009-03-27 14:25:49 +010078#endif /* _ASM_MICROBLAZE_IRQ_H */