sparc32: drop unused set_irq_udt
[linux-2.6-block.git] / arch / sparc / kernel / irq.h
CommitLineData
1d05995b
SR
1#include <linux/platform_device.h>
2
32231a66 3#include <asm/btfixup.h>
d550bbd4 4#include <asm/cpu_type.h>
32231a66 5
6baa9b20
SR
6struct irq_bucket {
7 struct irq_bucket *next;
8 unsigned int real_irq;
9 unsigned int irq;
10 unsigned int pil;
11};
12
13#define SUN4D_MAX_BOARD 10
14#define SUN4D_MAX_IRQ ((SUN4D_MAX_BOARD + 2) << 5)
15
16/* Map between the irq identifier used in hw to the
17 * irq_bucket. The map is sufficient large to hold
18 * the sun4d hw identifiers.
19 */
20extern struct irq_bucket *irq_map[SUN4D_MAX_IRQ];
21
22
0399bb5b
SR
23/* sun4m specific type definitions */
24
25/* This maps direct to CPU specific interrupt registers */
26struct sun4m_irq_percpu {
27 u32 pending;
28 u32 clear;
29 u32 set;
30};
31
32/* This maps direct to global interrupt registers */
33struct sun4m_irq_global {
34 u32 pending;
35 u32 mask;
36 u32 mask_clear;
37 u32 mask_set;
38 u32 interrupt_target;
39};
40
41extern struct sun4m_irq_percpu __iomem *sun4m_irq_percpu[SUN4M_NCPUS];
42extern struct sun4m_irq_global __iomem *sun4m_irq_global;
43
62f08283
TK
44/* The following definitions describe the individual platform features: */
45#define FEAT_L10_CLOCKSOURCE (1 << 0) /* L10 timer is used as a clocksource */
46#define FEAT_L10_CLOCKEVENT (1 << 1) /* L10 timer is used as a clockevent */
47#define FEAT_L14_ONESHOT (1 << 2) /* L14 timer clockevent can oneshot */
48
bbdc2661 49/*
472bc4f2 50 * Platform specific configuration
bbdc2661
SR
51 * The individual platforms assign their platform
52 * specifics in their init functions.
53 */
472bc4f2 54struct sparc_config {
62f08283 55 void (*init_timers)(void);
1d05995b
SR
56 unsigned int (*build_device_irq)(struct platform_device *op,
57 unsigned int real_irq);
62f08283
TK
58
59 /* generic clockevent features - see FEAT_* above */
60 int features;
61
62 /* clock rate used for clock event timer */
63 int clock_rate;
64
65 /* one period for clock source timer */
66 unsigned int cs_period;
67
68 /* function to obtain offsett for cs period */
69 unsigned int (*get_cycles_offset)(void);
bbdc2661 70};
472bc4f2 71extern struct sparc_config sparc_config;
bbdc2661 72
6baa9b20
SR
73unsigned int irq_alloc(unsigned int real_irq, unsigned int pil);
74void irq_link(unsigned int irq);
75void irq_unlink(unsigned int irq);
76void handler_irq(unsigned int pil, struct pt_regs *regs);
bbdc2661 77
0f516813
AV
78/* Dave Redman (djhr@tadpole.co.uk)
79 * changed these to function pointers.. it saves cycles and will allow
80 * the irq dependencies to be split into different files at a later date
ee906c9e 81 * sun4m_irq.c etc so we could reduce the kernel size.
0f516813
AV
82 * Jakub Jelinek (jj@sunsite.mff.cuni.cz)
83 * Changed these to btfixup entities... It saves cycles :)
84 */
85
32231a66 86BTFIXUPDEF_CALL(void, clear_clock_irq, void)
32231a66
AV
87BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int)
88
32231a66
AV
89static inline void clear_clock_irq(void)
90{
91 BTFIXUP_CALL(clear_clock_irq)();
92}
93
32231a66
AV
94static inline void load_profile_irq(int cpu, int limit)
95{
96 BTFIXUP_CALL(load_profile_irq)(cpu, limit);
97}
98
32231a66
AV
99#ifdef CONFIG_SMP
100BTFIXUPDEF_CALL(void, set_cpu_int, int, int)
101BTFIXUPDEF_CALL(void, clear_cpu_int, int, int)
32231a66
AV
102
103#define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level)
104#define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level)
55dd23ec
DH
105
106/* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */
38f7f8f0 107#define SUN4D_IPI_IRQ 13
55dd23ec
DH
108
109extern void sun4d_ipi_interrupt(void);
110
32231a66 111#endif