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