Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86...
[deliverable/linux.git] / arch / sparc / kernel / sun4d_irq.c
index 4156bf6657fbcc6c9f00b3eed122344fd25bb237..d3cb76ce418bde420d5d7e397679091ba5cd5cf8 100644 (file)
@@ -60,9 +60,7 @@ static struct sun4d_timer_regs __iomem *sun4d_timers;
 #define MAX_STATIC_ALLOC       4
 extern struct irqaction static_irqaction[MAX_STATIC_ALLOC];
 extern int static_irq_count;
-#ifdef CONFIG_SMP
 static unsigned char sbus_tid[32];
-#endif
 
 static struct irqaction *irq_action[NR_IRQS];
 extern spinlock_t irq_action_lock;
@@ -81,9 +79,9 @@ static int sbus_to_pil[] = {
 };
 
 static int nsbi;
-#ifdef CONFIG_SMP
+
+/* Exported for sun4d_smp.c */
 DEFINE_SPINLOCK(sun4d_imsk_lock);
-#endif
 
 int show_sun4d_interrupts(struct seq_file *p, void *v)
 {
@@ -349,36 +347,28 @@ out:
 
 static void sun4d_disable_irq(unsigned int irq)
 {
-#ifdef CONFIG_SMP
        int tid = sbus_tid[(irq >> 5) - 1];
        unsigned long flags;
-#endif 
        
-       if (irq < NR_IRQS) return;
-#ifdef CONFIG_SMP
+       if (irq < NR_IRQS)
+               return;
+
        spin_lock_irqsave(&sun4d_imsk_lock, flags);
        cc_set_imsk_other(tid, cc_get_imsk_other(tid) | (1 << sbus_to_pil[(irq >> 2) & 7]));
        spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
-#else          
-       cc_set_imsk(cc_get_imsk() | (1 << sbus_to_pil[(irq >> 2) & 7]));
-#endif
 }
 
 static void sun4d_enable_irq(unsigned int irq)
 {
-#ifdef CONFIG_SMP
        int tid = sbus_tid[(irq >> 5) - 1];
        unsigned long flags;
-#endif 
        
-       if (irq < NR_IRQS) return;
-#ifdef CONFIG_SMP
+       if (irq < NR_IRQS)
+               return;
+
        spin_lock_irqsave(&sun4d_imsk_lock, flags);
        cc_set_imsk_other(tid, cc_get_imsk_other(tid) & ~(1 << sbus_to_pil[(irq >> 2) & 7]));
        spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
-#else          
-       cc_set_imsk(cc_get_imsk() & ~(1 << sbus_to_pil[(irq >> 2) & 7]));
-#endif
 }
 
 #ifdef CONFIG_SMP
@@ -458,11 +448,6 @@ static void sun4d_clear_clock_irq(void)
        sbus_readl(&sun4d_timers->l10_timer_limit);
 }
 
-static void sun4d_clear_profile_irq(int cpu)
-{
-       bw_get_prof_limit(cpu);
-}
-
 static void sun4d_load_profile_irq(int cpu, unsigned int limit)
 {
        bw_set_prof_limit(cpu, limit);
@@ -541,7 +526,6 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn)
        sbus_writel((((1000000/HZ) + 1) << 10), &sun4d_timers->l10_timer_limit);
 
        master_l10_counter = &sun4d_timers->l10_cur_count;
-       master_l10_limit = &sun4d_timers->l10_timer_limit;
 
        err = request_irq(TIMER_IRQ, counter_fn,
                          (IRQF_DISABLED | SA_STATIC_ALLOC),
@@ -557,6 +541,11 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn)
 void __init sun4d_init_sbi_irq(void)
 {
        struct device_node *dp;
+       int target_cpu = 0;
+
+#ifdef CONFIG_SMP
+       target_cpu = boot_cpu_id;
+#endif
 
        nsbi = 0;
        for_each_node_by_name(dp, "sbi")
@@ -571,14 +560,9 @@ void __init sun4d_init_sbi_irq(void)
                int board = of_getintprop_default(dp, "board#", 0);
                unsigned int mask;
 
-#ifdef CONFIG_SMP      
-               {
-                       extern unsigned char boot_cpu_id;
-               
-                       set_sbi_tid(devid, boot_cpu_id << 3);
-                       sbus_tid[board] = boot_cpu_id;
-               }
-#endif
+               set_sbi_tid(devid, target_cpu << 3);
+               sbus_tid[board] = target_cpu;
+
                /* Get rid of pending irqs from PROM */
                mask = acquire_sbi(devid, 0xffffffff);
                if (mask) {
@@ -595,7 +579,6 @@ void __init sun4d_init_IRQ(void)
        BTFIXUPSET_CALL(enable_irq, sun4d_enable_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(disable_irq, sun4d_disable_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
-       BTFIXUPSET_CALL(clear_profile_irq, sun4d_clear_profile_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM);
        sparc_init_timers = sun4d_init_timers;
 #ifdef CONFIG_SMP
This page took 0.030452 seconds and 5 git commands to generate.