diff options
Diffstat (limited to 'arch/sparc/kernel/irq.h')
-rw-r--r-- | arch/sparc/kernel/irq.h | 93 |
1 files changed, 63 insertions, 30 deletions
diff --git a/arch/sparc/kernel/irq.h b/arch/sparc/kernel/irq.h index db7513881530..100b9c204e78 100644 --- a/arch/sparc/kernel/irq.h +++ b/arch/sparc/kernel/irq.h | |||
@@ -1,5 +1,62 @@ | |||
1 | #include <linux/platform_device.h> | ||
2 | |||
1 | #include <asm/btfixup.h> | 3 | #include <asm/btfixup.h> |
2 | 4 | ||
5 | struct irq_bucket { | ||
6 | struct irq_bucket *next; | ||
7 | unsigned int real_irq; | ||
8 | unsigned int irq; | ||
9 | unsigned int pil; | ||
10 | }; | ||
11 | |||
12 | #define SUN4D_MAX_BOARD 10 | ||
13 | #define SUN4D_MAX_IRQ ((SUN4D_MAX_BOARD + 2) << 5) | ||
14 | |||
15 | /* Map between the irq identifier used in hw to the | ||
16 | * irq_bucket. The map is sufficient large to hold | ||
17 | * the sun4d hw identifiers. | ||
18 | */ | ||
19 | extern struct irq_bucket *irq_map[SUN4D_MAX_IRQ]; | ||
20 | |||
21 | |||
22 | /* sun4m specific type definitions */ | ||
23 | |||
24 | /* This maps direct to CPU specific interrupt registers */ | ||
25 | struct sun4m_irq_percpu { | ||
26 | u32 pending; | ||
27 | u32 clear; | ||
28 | u32 set; | ||
29 | }; | ||
30 | |||
31 | /* This maps direct to global interrupt registers */ | ||
32 | struct sun4m_irq_global { | ||
33 | u32 pending; | ||
34 | u32 mask; | ||
35 | u32 mask_clear; | ||
36 | u32 mask_set; | ||
37 | u32 interrupt_target; | ||
38 | }; | ||
39 | |||
40 | extern struct sun4m_irq_percpu __iomem *sun4m_irq_percpu[SUN4M_NCPUS]; | ||
41 | extern struct sun4m_irq_global __iomem *sun4m_irq_global; | ||
42 | |||
43 | /* | ||
44 | * Platform specific irq configuration | ||
45 | * The individual platforms assign their platform | ||
46 | * specifics in their init functions. | ||
47 | */ | ||
48 | struct sparc_irq_config { | ||
49 | void (*init_timers)(irq_handler_t); | ||
50 | unsigned int (*build_device_irq)(struct platform_device *op, | ||
51 | unsigned int real_irq); | ||
52 | }; | ||
53 | extern struct sparc_irq_config sparc_irq_config; | ||
54 | |||
55 | unsigned int irq_alloc(unsigned int real_irq, unsigned int pil); | ||
56 | void irq_link(unsigned int irq); | ||
57 | void irq_unlink(unsigned int irq); | ||
58 | void handler_irq(unsigned int pil, struct pt_regs *regs); | ||
59 | |||
3 | /* Dave Redman (djhr@tadpole.co.uk) | 60 | /* Dave Redman (djhr@tadpole.co.uk) |
4 | * changed these to function pointers.. it saves cycles and will allow | 61 | * changed these to function pointers.. it saves cycles and will allow |
5 | * the irq dependencies to be split into different files at a later date | 62 | * the irq dependencies to be split into different files at a later date |
@@ -8,33 +65,9 @@ | |||
8 | * Changed these to btfixup entities... It saves cycles :) | 65 | * Changed these to btfixup entities... It saves cycles :) |
9 | */ | 66 | */ |
10 | 67 | ||
11 | BTFIXUPDEF_CALL(void, disable_irq, unsigned int) | ||
12 | BTFIXUPDEF_CALL(void, enable_irq, unsigned int) | ||
13 | BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int) | ||
14 | BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int) | ||
15 | BTFIXUPDEF_CALL(void, clear_clock_irq, void) | 68 | BTFIXUPDEF_CALL(void, clear_clock_irq, void) |
16 | BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) | 69 | BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) |
17 | 70 | ||
18 | static inline void __disable_irq(unsigned int irq) | ||
19 | { | ||
20 | BTFIXUP_CALL(disable_irq)(irq); | ||
21 | } | ||
22 | |||
23 | static inline void __enable_irq(unsigned int irq) | ||
24 | { | ||
25 | BTFIXUP_CALL(enable_irq)(irq); | ||
26 | } | ||
27 | |||
28 | static inline void disable_pil_irq(unsigned int irq) | ||
29 | { | ||
30 | BTFIXUP_CALL(disable_pil_irq)(irq); | ||
31 | } | ||
32 | |||
33 | static inline void enable_pil_irq(unsigned int irq) | ||
34 | { | ||
35 | BTFIXUP_CALL(enable_pil_irq)(irq); | ||
36 | } | ||
37 | |||
38 | static inline void clear_clock_irq(void) | 71 | static inline void clear_clock_irq(void) |
39 | { | 72 | { |
40 | BTFIXUP_CALL(clear_clock_irq)(); | 73 | BTFIXUP_CALL(clear_clock_irq)(); |
@@ -45,12 +78,6 @@ static inline void load_profile_irq(int cpu, int limit) | |||
45 | BTFIXUP_CALL(load_profile_irq)(cpu, limit); | 78 | BTFIXUP_CALL(load_profile_irq)(cpu, limit); |
46 | } | 79 | } |
47 | 80 | ||
48 | extern void (*sparc_init_timers)(irq_handler_t lvl10_irq); | ||
49 | |||
50 | extern void claim_ticker14(irq_handler_t irq_handler, | ||
51 | int irq, | ||
52 | unsigned int timeout); | ||
53 | |||
54 | #ifdef CONFIG_SMP | 81 | #ifdef CONFIG_SMP |
55 | BTFIXUPDEF_CALL(void, set_cpu_int, int, int) | 82 | BTFIXUPDEF_CALL(void, set_cpu_int, int, int) |
56 | BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) | 83 | BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) |
@@ -59,4 +86,10 @@ BTFIXUPDEF_CALL(void, set_irq_udt, int) | |||
59 | #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level) | 86 | #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level) |
60 | #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level) | 87 | #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level) |
61 | #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) | 88 | #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) |
89 | |||
90 | /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */ | ||
91 | #define SUN4D_IPI_IRQ 14 | ||
92 | |||
93 | extern void sun4d_ipi_interrupt(void); | ||
94 | |||
62 | #endif | 95 | #endif |