Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SPARC32]: clean include/asm-sparc/irq.h

Move stuff used only by arch/sparc/kernel/* into arch/sparc/kernel/irq.h
and into individual files in there (e.g. macros internal to sun4m_irq.c,
etc.)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Al Viro and committed by
David S. Miller
32231a66 196bffa5

+151 -136
+2
arch/sparc/kernel/irq.c
··· 47 47 #include <asm/cacheflush.h> 48 48 #include <asm/irq_regs.h> 49 49 50 + #include "irq.h" 51 + 50 52 #ifdef CONFIG_SMP 51 53 #define SMP_NOP2 "nop; nop;\n\t" 52 54 #define SMP_NOP3 "nop; nop; nop;\n\t"
+48
arch/sparc/kernel/irq.h
··· 1 + #include <asm/btfixup.h> 2 + 3 + BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int) 4 + BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int) 5 + BTFIXUPDEF_CALL(void, clear_clock_irq, void) 6 + BTFIXUPDEF_CALL(void, clear_profile_irq, int) 7 + BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) 8 + 9 + static inline void disable_pil_irq(unsigned int irq) 10 + { 11 + BTFIXUP_CALL(disable_pil_irq)(irq); 12 + } 13 + 14 + static inline void enable_pil_irq(unsigned int irq) 15 + { 16 + BTFIXUP_CALL(enable_pil_irq)(irq); 17 + } 18 + 19 + static inline void clear_clock_irq(void) 20 + { 21 + BTFIXUP_CALL(clear_clock_irq)(); 22 + } 23 + 24 + static inline void clear_profile_irq(int irq) 25 + { 26 + BTFIXUP_CALL(clear_profile_irq)(irq); 27 + } 28 + 29 + static inline void load_profile_irq(int cpu, int limit) 30 + { 31 + BTFIXUP_CALL(load_profile_irq)(cpu, limit); 32 + } 33 + 34 + extern void (*sparc_init_timers)(irq_handler_t lvl10_irq); 35 + 36 + extern void claim_ticker14(irq_handler_t irq_handler, 37 + int irq, 38 + unsigned int timeout); 39 + 40 + #ifdef CONFIG_SMP 41 + BTFIXUPDEF_CALL(void, set_cpu_int, int, int) 42 + BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) 43 + BTFIXUPDEF_CALL(void, set_irq_udt, int) 44 + 45 + #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level) 46 + #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level) 47 + #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) 48 + #endif
+1
arch/sparc/kernel/pcic.c
··· 36 36 #include <asm/uaccess.h> 37 37 #include <asm/irq_regs.h> 38 38 39 + #include "irq.h" 39 40 40 41 /* 41 42 * I studied different documents and many live PROMs both from 2.30
+2
arch/sparc/kernel/smp.c
··· 33 33 #include <asm/tlbflush.h> 34 34 #include <asm/cpudata.h> 35 35 36 + #include "irq.h" 37 + 36 38 int smp_num_cpus = 1; 37 39 volatile unsigned long cpu_callin_map[NR_CPUS] __initdata = {0,}; 38 40 unsigned char boot_cpu_id = 0;
+15
arch/sparc/kernel/sun4c_irq.c
··· 18 18 #include <linux/interrupt.h> 19 19 #include <linux/slab.h> 20 20 #include <linux/init.h> 21 + #include "irq.h" 21 22 22 23 #include <asm/ptrace.h> 23 24 #include <asm/processor.h> ··· 40 39 static struct resource sun4c_timer_eb = { "sun4c_timer" }; 41 40 static struct resource sun4c_intr_eb = { "sun4c_intr" }; 42 41 #endif 42 + 43 + /* 44 + * Bit field defines for the interrupt registers on various 45 + * Sparc machines. 46 + */ 47 + 48 + /* The sun4c interrupt register. */ 49 + #define SUN4C_INT_ENABLE 0x01 /* Allow interrupts. */ 50 + #define SUN4C_INT_E14 0x80 /* Enable level 14 IRQ. */ 51 + #define SUN4C_INT_E10 0x20 /* Enable level 10 IRQ. */ 52 + #define SUN4C_INT_E8 0x10 /* Enable level 8 IRQ. */ 53 + #define SUN4C_INT_E6 0x08 /* Enable level 6 IRQ. */ 54 + #define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */ 55 + #define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */ 43 56 44 57 /* Pointer to the interrupt enable byte 45 58 *
+2
arch/sparc/kernel/sun4d_irq.c
··· 39 39 #include <asm/cacheflush.h> 40 40 #include <asm/irq_regs.h> 41 41 42 + #include "irq.h" 43 + 42 44 /* If you trust current SCSI layer to handle different SCSI IRQs, enable this. I don't trust it... -jj */ 43 45 /* #define DISTRIBUTE_IRQS */ 44 46
+1
arch/sparc/kernel/sun4d_smp.c
··· 36 36 #include <asm/cacheflush.h> 37 37 #include <asm/cpudata.h> 38 38 39 + #include "irq.h" 39 40 #define IRQ_CROSS_CALL 15 40 41 41 42 extern ctxd_t *srmmu_ctx_table_phys;
+74
arch/sparc/kernel/sun4m_irq.c
··· 38 38 #include <asm/sbus.h> 39 39 #include <asm/cacheflush.h> 40 40 41 + #include "irq.h" 42 + 43 + /* On the sun4m, just like the timers, we have both per-cpu and master 44 + * interrupt registers. 45 + */ 46 + 47 + /* These registers are used for sending/receiving irqs from/to 48 + * different cpu's. 49 + */ 50 + struct sun4m_intreg_percpu { 51 + unsigned int tbt; /* Interrupts still pending for this cpu. */ 52 + 53 + /* These next two registers are WRITE-ONLY and are only 54 + * "on bit" sensitive, "off bits" written have NO affect. 55 + */ 56 + unsigned int clear; /* Clear this cpus irqs here. */ 57 + unsigned int set; /* Set this cpus irqs here. */ 58 + unsigned char space[PAGE_SIZE - 12]; 59 + }; 60 + 61 + /* 62 + * djhr 63 + * Actually the clear and set fields in this struct are misleading.. 64 + * according to the SLAVIO manual (and the same applies for the SEC) 65 + * the clear field clears bits in the mask which will ENABLE that IRQ 66 + * the set field sets bits in the mask to DISABLE the IRQ. 67 + * 68 + * Also the undirected_xx address in the SLAVIO is defined as 69 + * RESERVED and write only.. 70 + * 71 + * DAVEM_NOTE: The SLAVIO only specifies behavior on uniprocessor 72 + * sun4m machines, for MP the layout makes more sense. 73 + */ 74 + struct sun4m_intregs { 75 + struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS]; 76 + unsigned int tbt; /* IRQ's that are still pending. */ 77 + unsigned int irqs; /* Master IRQ bits. */ 78 + 79 + /* Again, like the above, two these registers are WRITE-ONLY. */ 80 + unsigned int clear; /* Clear master IRQ's by setting bits here. */ 81 + unsigned int set; /* Set master IRQ's by setting bits here. */ 82 + 83 + /* This register is both READ and WRITE. */ 84 + unsigned int undirected_target; /* Which cpu gets undirected irqs. */ 85 + }; 86 + 41 87 static unsigned long dummy; 42 88 43 89 struct sun4m_intregs *sun4m_interrupts; 44 90 unsigned long *irq_rcvreg = &dummy; 91 + 92 + /* Dave Redman (djhr@tadpole.co.uk) 93 + * The sun4m interrupt registers. 94 + */ 95 + #define SUN4M_INT_ENABLE 0x80000000 96 + #define SUN4M_INT_E14 0x00000080 97 + #define SUN4M_INT_E10 0x00080000 98 + 99 + #define SUN4M_HARD_INT(x) (0x000000001 << (x)) 100 + #define SUN4M_SOFT_INT(x) (0x000010000 << (x)) 101 + 102 + #define SUN4M_INT_MASKALL 0x80000000 /* mask all interrupts */ 103 + #define SUN4M_INT_MODULE_ERR 0x40000000 /* module error */ 104 + #define SUN4M_INT_M2S_WRITE 0x20000000 /* write buffer error */ 105 + #define SUN4M_INT_ECC 0x10000000 /* ecc memory error */ 106 + #define SUN4M_INT_FLOPPY 0x00400000 /* floppy disk */ 107 + #define SUN4M_INT_MODULE 0x00200000 /* module interrupt */ 108 + #define SUN4M_INT_VIDEO 0x00100000 /* onboard video */ 109 + #define SUN4M_INT_REALTIME 0x00080000 /* system timer */ 110 + #define SUN4M_INT_SCSI 0x00040000 /* onboard scsi */ 111 + #define SUN4M_INT_AUDIO 0x00020000 /* audio/isdn */ 112 + #define SUN4M_INT_ETHERNET 0x00010000 /* onboard ethernet */ 113 + #define SUN4M_INT_SERIAL 0x00008000 /* serial ports */ 114 + #define SUN4M_INT_KBDMS 0x00004000 /* keyboard/mouse */ 115 + #define SUN4M_INT_SBUSBITS 0x00003F80 /* sbus int bits */ 116 + 117 + #define SUN4M_INT_SBUS(x) (1 << (x+7)) 118 + #define SUN4M_INT_VME(x) (1 << (x)) 45 119 46 120 /* These tables only apply for interrupts greater than 15.. 47 121 *
+2
arch/sparc/kernel/sun4m_smp.c
··· 31 31 #include <asm/oplib.h> 32 32 #include <asm/cpudata.h> 33 33 34 + #include "irq.h" 35 + 34 36 #define IRQ_RESCHEDULE 13 35 37 #define IRQ_STOP_CPU 14 36 38 #define IRQ_CROSS_CALL 15
+2
arch/sparc/kernel/tick14.c
··· 25 25 #include <asm/irq.h> 26 26 #include <asm/io.h> 27 27 28 + #include "irq.h" 29 + 28 30 extern unsigned long lvl14_save[5]; 29 31 static unsigned long *linux_lvl14 = NULL; 30 32 static unsigned long obp_lvl14[4];
+2
arch/sparc/kernel/time.c
··· 44 44 #include <asm/of_device.h> 45 45 #include <asm/irq_regs.h> 46 46 47 + #include "irq.h" 48 + 47 49 DEFINE_SPINLOCK(rtc_lock); 48 50 enum sparc_clock_type sp_clock_typ; 49 51 DEFINE_SPINLOCK(mostek_lock);
-136
include/asm-sparc/irq.h
··· 14 14 #include <asm/system.h> /* For SUN4M_NCPUS */ 15 15 #include <asm/btfixup.h> 16 16 17 - #define __irq_ino(irq) irq 18 - #define __irq_pil(irq) irq 19 - 20 17 #define NR_IRQS 16 21 18 22 19 #define irq_canonicalize(irq) (irq) ··· 27 30 */ 28 31 BTFIXUPDEF_CALL(void, disable_irq, unsigned int) 29 32 BTFIXUPDEF_CALL(void, enable_irq, unsigned int) 30 - BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int) 31 - BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int) 32 - BTFIXUPDEF_CALL(void, clear_clock_irq, void) 33 - BTFIXUPDEF_CALL(void, clear_profile_irq, int) 34 - BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) 35 33 36 34 static inline void disable_irq_nosync(unsigned int irq) 37 35 { ··· 43 51 BTFIXUP_CALL(enable_irq)(irq); 44 52 } 45 53 46 - static inline void disable_pil_irq(unsigned int irq) 47 - { 48 - BTFIXUP_CALL(disable_pil_irq)(irq); 49 - } 50 - 51 - static inline void enable_pil_irq(unsigned int irq) 52 - { 53 - BTFIXUP_CALL(enable_pil_irq)(irq); 54 - } 55 - 56 - static inline void clear_clock_irq(void) 57 - { 58 - BTFIXUP_CALL(clear_clock_irq)(); 59 - } 60 - 61 - static inline void clear_profile_irq(int irq) 62 - { 63 - BTFIXUP_CALL(clear_profile_irq)(irq); 64 - } 65 - 66 - static inline void load_profile_irq(int cpu, int limit) 67 - { 68 - BTFIXUP_CALL(load_profile_irq)(cpu, limit); 69 - } 70 - 71 - extern void (*sparc_init_timers)(irq_handler_t lvl10_irq); 72 - extern void claim_ticker14(irq_handler_t irq_handler, 73 - int irq, 74 - unsigned int timeout); 75 - 76 - #ifdef CONFIG_SMP 77 - BTFIXUPDEF_CALL(void, set_cpu_int, int, int) 78 - BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) 79 - BTFIXUPDEF_CALL(void, set_irq_udt, int) 80 - 81 - #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level) 82 - #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level) 83 - #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) 84 - #endif 85 - 86 54 extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname); 87 - 88 - /* On the sun4m, just like the timers, we have both per-cpu and master 89 - * interrupt registers. 90 - */ 91 - 92 - /* These registers are used for sending/receiving irqs from/to 93 - * different cpu's. 94 - */ 95 - struct sun4m_intreg_percpu { 96 - unsigned int tbt; /* Interrupts still pending for this cpu. */ 97 - 98 - /* These next two registers are WRITE-ONLY and are only 99 - * "on bit" sensitive, "off bits" written have NO affect. 100 - */ 101 - unsigned int clear; /* Clear this cpus irqs here. */ 102 - unsigned int set; /* Set this cpus irqs here. */ 103 - unsigned char space[PAGE_SIZE - 12]; 104 - }; 105 - 106 - /* 107 - * djhr 108 - * Actually the clear and set fields in this struct are misleading.. 109 - * according to the SLAVIO manual (and the same applies for the SEC) 110 - * the clear field clears bits in the mask which will ENABLE that IRQ 111 - * the set field sets bits in the mask to DISABLE the IRQ. 112 - * 113 - * Also the undirected_xx address in the SLAVIO is defined as 114 - * RESERVED and write only.. 115 - * 116 - * DAVEM_NOTE: The SLAVIO only specifies behavior on uniprocessor 117 - * sun4m machines, for MP the layout makes more sense. 118 - */ 119 - struct sun4m_intregs { 120 - struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS]; 121 - unsigned int tbt; /* IRQ's that are still pending. */ 122 - unsigned int irqs; /* Master IRQ bits. */ 123 - 124 - /* Again, like the above, two these registers are WRITE-ONLY. */ 125 - unsigned int clear; /* Clear master IRQ's by setting bits here. */ 126 - unsigned int set; /* Set master IRQ's by setting bits here. */ 127 - 128 - /* This register is both READ and WRITE. */ 129 - unsigned int undirected_target; /* Which cpu gets undirected irqs. */ 130 - }; 131 - 132 - extern struct sun4m_intregs *sun4m_interrupts; 133 - 134 - /* 135 - * Bit field defines for the interrupt registers on various 136 - * Sparc machines. 137 - */ 138 - 139 - /* The sun4c interrupt register. */ 140 - #define SUN4C_INT_ENABLE 0x01 /* Allow interrupts. */ 141 - #define SUN4C_INT_E14 0x80 /* Enable level 14 IRQ. */ 142 - #define SUN4C_INT_E10 0x20 /* Enable level 10 IRQ. */ 143 - #define SUN4C_INT_E8 0x10 /* Enable level 8 IRQ. */ 144 - #define SUN4C_INT_E6 0x08 /* Enable level 6 IRQ. */ 145 - #define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */ 146 - #define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */ 147 - 148 - /* Dave Redman (djhr@tadpole.co.uk) 149 - * The sun4m interrupt registers. 150 - */ 151 - #define SUN4M_INT_ENABLE 0x80000000 152 - #define SUN4M_INT_E14 0x00000080 153 - #define SUN4M_INT_E10 0x00080000 154 - 155 - #define SUN4M_HARD_INT(x) (0x000000001 << (x)) 156 - #define SUN4M_SOFT_INT(x) (0x000010000 << (x)) 157 - 158 - #define SUN4M_INT_MASKALL 0x80000000 /* mask all interrupts */ 159 - #define SUN4M_INT_MODULE_ERR 0x40000000 /* module error */ 160 - #define SUN4M_INT_M2S_WRITE 0x20000000 /* write buffer error */ 161 - #define SUN4M_INT_ECC 0x10000000 /* ecc memory error */ 162 - #define SUN4M_INT_FLOPPY 0x00400000 /* floppy disk */ 163 - #define SUN4M_INT_MODULE 0x00200000 /* module interrupt */ 164 - #define SUN4M_INT_VIDEO 0x00100000 /* onboard video */ 165 - #define SUN4M_INT_REALTIME 0x00080000 /* system timer */ 166 - #define SUN4M_INT_SCSI 0x00040000 /* onboard scsi */ 167 - #define SUN4M_INT_AUDIO 0x00020000 /* audio/isdn */ 168 - #define SUN4M_INT_ETHERNET 0x00010000 /* onboard ethernet */ 169 - #define SUN4M_INT_SERIAL 0x00008000 /* serial ports */ 170 - #define SUN4M_INT_KBDMS 0x00004000 /* keyboard/mouse */ 171 - #define SUN4M_INT_SBUSBITS 0x00003F80 /* sbus int bits */ 172 - 173 - #define SUN4M_INT_SBUS(x) (1 << (x+7)) 174 - #define SUN4M_INT_VME(x) (1 << (x)) 175 55 176 56 #endif