Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 2 | /* |
| 3 | * sun4m SMP support. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * |
| 5 | * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) |
| 6 | */ |
| 7 | |
Tkhai Kirill | 62f0828 | 2012-04-04 21:49:26 +0200 | [diff] [blame] | 8 | #include <linux/clockchips.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #include <linux/interrupt.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <linux/profile.h> |
Adrian Bunk | 6c81c32 | 2008-02-06 01:37:51 -0800 | [diff] [blame] | 11 | #include <linux/delay.h> |
Ingo Molnar | 68e21be2 | 2017-02-01 19:08:20 +0100 | [diff] [blame] | 12 | #include <linux/sched/mm.h> |
Robert Reif | 4245e59 | 2008-10-12 20:52:26 -0700 | [diff] [blame] | 13 | #include <linux/cpu.h> |
Adrian Bunk | 6c81c32 | 2008-02-06 01:37:51 -0800 | [diff] [blame] | 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <asm/cacheflush.h> |
Sam Ravnborg | bde4d8b | 2012-03-30 15:53:50 +0200 | [diff] [blame] | 16 | #include <asm/switch_to.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <asm/tlbflush.h> |
Tkhai Kirill | 62f0828 | 2012-04-04 21:49:26 +0200 | [diff] [blame] | 18 | #include <asm/timer.h> |
David S. Miller | 5d83d66 | 2012-05-13 20:49:31 -0700 | [diff] [blame] | 19 | #include <asm/oplib.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
Al Viro | 32231a6 | 2007-07-21 19:18:57 -0700 | [diff] [blame] | 21 | #include "irq.h" |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 22 | #include "kernel.h" |
Al Viro | 32231a6 | 2007-07-21 19:18:57 -0700 | [diff] [blame] | 23 | |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 24 | #define IRQ_IPI_SINGLE 12 |
| 25 | #define IRQ_IPI_MASK 13 |
| 26 | #define IRQ_IPI_RESCHED 14 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | #define IRQ_CROSS_CALL 15 |
| 28 | |
Wu Fengguang | 1a8a27c | 2009-01-07 18:09:10 -0800 | [diff] [blame] | 29 | static inline unsigned long |
| 30 | swap_ulong(volatile unsigned long *ptr, unsigned long val) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | { |
| 32 | __asm__ __volatile__("swap [%1], %0\n\t" : |
| 33 | "=&r" (val), "=&r" (ptr) : |
| 34 | "0" (val), "1" (ptr)); |
| 35 | return val; |
| 36 | } |
| 37 | |
Paul Gortmaker | 2066aad | 2013-06-17 15:43:14 -0400 | [diff] [blame] | 38 | void sun4m_cpu_pre_starting(void *arg) |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 39 | { |
| 40 | } |
| 41 | |
Paul Gortmaker | 2066aad | 2013-06-17 15:43:14 -0400 | [diff] [blame] | 42 | void sun4m_cpu_pre_online(void *arg) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | { |
| 44 | int cpuid = hard_smp_processor_id(); |
| 45 | |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 46 | /* Allow master to continue. The master will then give us the |
| 47 | * go-ahead by setting the smp_commenced_mask and will wait without |
| 48 | * timeouts until our setup is completed fully (signified by |
| 49 | * our bit being set in the cpu_online_mask). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | */ |
Wu Fengguang | 1a8a27c | 2009-01-07 18:09:10 -0800 | [diff] [blame] | 51 | swap_ulong(&cpu_callin_map[cpuid], 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 53 | /* XXX: What's up with all the flushes? */ |
David S. Miller | 5d83d66 | 2012-05-13 20:49:31 -0700 | [diff] [blame] | 54 | local_ops->cache_all(); |
| 55 | local_ops->tlb_all(); |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 56 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | /* Fix idle thread fields. */ |
| 58 | __asm__ __volatile__("ld [%0], %%g6\n\t" |
| 59 | : : "r" (¤t_set[cpuid]) |
| 60 | : "memory" /* paranoid */); |
| 61 | |
| 62 | /* Attach to the address space of init_task. */ |
Vegard Nossum | f1f1007 | 2017-02-27 14:30:07 -0800 | [diff] [blame] | 63 | mmgrab(&init_mm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | current->active_mm = &init_mm; |
| 65 | |
KOSAKI Motohiro | fb1fece | 2011-05-16 13:38:07 -0700 | [diff] [blame] | 66 | while (!cpumask_test_cpu(cpuid, &smp_commenced_mask)) |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 67 | mb(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | } |
| 69 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | /* |
| 71 | * Cycle through the processors asking the PROM to start each one. |
| 72 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | void __init smp4m_boot_cpus(void) |
| 74 | { |
Tkhai Kirill | 62f0828 | 2012-04-04 21:49:26 +0200 | [diff] [blame] | 75 | sun4m_unmask_profile_irq(); |
David S. Miller | 5d83d66 | 2012-05-13 20:49:31 -0700 | [diff] [blame] | 76 | local_ops->cache_all(); |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 77 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |
Paul Gortmaker | 2066aad | 2013-06-17 15:43:14 -0400 | [diff] [blame] | 79 | int smp4m_boot_one_cpu(int i, struct task_struct *idle) |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 80 | { |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 81 | unsigned long *entry = &sun4m_cpu_startup; |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 82 | int timeout; |
| 83 | int cpu_node; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 85 | cpu_find_by_mid(i, &cpu_node); |
Thomas Gleixner | f0a2bc7 | 2012-04-20 13:05:56 +0000 | [diff] [blame] | 86 | current_set[i] = task_thread_info(idle); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 88 | /* See trampoline.S for details... */ |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 89 | entry += ((i - 1) * 3); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 91 | /* |
| 92 | * Initialize the contexts table |
| 93 | * Since the call to prom_startcpu() trashes the structure, |
| 94 | * we need to re-initialize it for each cpu |
| 95 | */ |
| 96 | smp_penguin_ctable.which_io = 0; |
| 97 | smp_penguin_ctable.phys_addr = (unsigned int) srmmu_ctx_table_phys; |
| 98 | smp_penguin_ctable.reg_size = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 100 | /* whirrr, whirrr, whirrrrrrrrr... */ |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 101 | printk(KERN_INFO "Starting CPU %d at %p\n", i, entry); |
David S. Miller | 5d83d66 | 2012-05-13 20:49:31 -0700 | [diff] [blame] | 102 | local_ops->cache_all(); |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 103 | prom_startcpu(cpu_node, &smp_penguin_ctable, 0, (char *)entry); |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 104 | |
| 105 | /* wheee... it's going... */ |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 106 | for (timeout = 0; timeout < 10000; timeout++) { |
| 107 | if (cpu_callin_map[i]) |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 108 | break; |
| 109 | udelay(200); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | } |
| 111 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 112 | if (!(cpu_callin_map[i])) { |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 113 | printk(KERN_ERR "Processor %d is stuck.\n", i); |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 114 | return -ENODEV; |
| 115 | } |
| 116 | |
David S. Miller | 5d83d66 | 2012-05-13 20:49:31 -0700 | [diff] [blame] | 117 | local_ops->cache_all(); |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 118 | return 0; |
| 119 | } |
| 120 | |
| 121 | void __init smp4m_smp_done(void) |
| 122 | { |
| 123 | int i, first; |
| 124 | int *prev; |
| 125 | |
| 126 | /* setup cpu list for irq rotation */ |
| 127 | first = 0; |
| 128 | prev = &first; |
Rusty Russell | ec7c14b | 2009-03-16 14:40:24 +1030 | [diff] [blame] | 129 | for_each_online_cpu(i) { |
| 130 | *prev = i; |
| 131 | prev = &cpu_data(i).next; |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 132 | } |
| 133 | *prev = first; |
David S. Miller | 5d83d66 | 2012-05-13 20:49:31 -0700 | [diff] [blame] | 134 | local_ops->cache_all(); |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 135 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | /* Ok, they are spinning and ready to go. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | } |
| 138 | |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 139 | static void sun4m_send_ipi(int cpu, int level) |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 140 | { |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 141 | sbus_writel(SUN4M_SOFT_INT(level), &sun4m_irq_percpu[cpu]->set); |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 142 | } |
| 143 | |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 144 | static void sun4m_ipi_resched(int cpu) |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 145 | { |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 146 | sun4m_send_ipi(cpu, IRQ_IPI_RESCHED); |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 147 | } |
| 148 | |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 149 | static void sun4m_ipi_single(int cpu) |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 150 | { |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 151 | sun4m_send_ipi(cpu, IRQ_IPI_SINGLE); |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 152 | } |
| 153 | |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 154 | static void sun4m_ipi_mask_one(int cpu) |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 155 | { |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 156 | sun4m_send_ipi(cpu, IRQ_IPI_MASK); |
Daniel Hellstrom | ecbc42b | 2011-05-02 00:08:53 +0000 | [diff] [blame] | 157 | } |
| 158 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | static struct smp_funcall { |
| 160 | smpfunc_t func; |
| 161 | unsigned long arg1; |
| 162 | unsigned long arg2; |
| 163 | unsigned long arg3; |
| 164 | unsigned long arg4; |
| 165 | unsigned long arg5; |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 166 | unsigned long processors_in[SUN4M_NCPUS]; /* Set when ipi entered. */ |
| 167 | unsigned long processors_out[SUN4M_NCPUS]; /* Set when ipi exited. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | } ccall_info; |
| 169 | |
| 170 | static DEFINE_SPINLOCK(cross_call_lock); |
| 171 | |
| 172 | /* Cross calls must be serialized, at least currently. */ |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 173 | static void sun4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, |
Adrian Bunk | c61c65c | 2008-06-05 11:40:58 -0700 | [diff] [blame] | 174 | unsigned long arg2, unsigned long arg3, |
David S. Miller | 66e4f8c | 2008-08-27 20:03:22 -0700 | [diff] [blame] | 175 | unsigned long arg4) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | { |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 177 | register int ncpus = SUN4M_NCPUS; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | unsigned long flags; |
| 179 | |
| 180 | spin_lock_irqsave(&cross_call_lock, flags); |
| 181 | |
| 182 | /* Init function glue. */ |
| 183 | ccall_info.func = func; |
| 184 | ccall_info.arg1 = arg1; |
| 185 | ccall_info.arg2 = arg2; |
| 186 | ccall_info.arg3 = arg3; |
| 187 | ccall_info.arg4 = arg4; |
David S. Miller | 66e4f8c | 2008-08-27 20:03:22 -0700 | [diff] [blame] | 188 | ccall_info.arg5 = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 | |
| 190 | /* Init receive/complete mapping, plus fire the IPI's off. */ |
| 191 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | register int i; |
| 193 | |
KOSAKI Motohiro | fb1fece | 2011-05-16 13:38:07 -0700 | [diff] [blame] | 194 | cpumask_clear_cpu(smp_processor_id(), &mask); |
| 195 | cpumask_and(&mask, cpu_online_mask, &mask); |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 196 | for (i = 0; i < ncpus; i++) { |
KOSAKI Motohiro | fb1fece | 2011-05-16 13:38:07 -0700 | [diff] [blame] | 197 | if (cpumask_test_cpu(i, &mask)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | ccall_info.processors_in[i] = 0; |
| 199 | ccall_info.processors_out[i] = 0; |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 200 | sun4m_send_ipi(i, IRQ_CROSS_CALL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | } else { |
| 202 | ccall_info.processors_in[i] = 1; |
| 203 | ccall_info.processors_out[i] = 1; |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | { |
| 209 | register int i; |
| 210 | |
| 211 | i = 0; |
| 212 | do { |
KOSAKI Motohiro | fb1fece | 2011-05-16 13:38:07 -0700 | [diff] [blame] | 213 | if (!cpumask_test_cpu(i, &mask)) |
David S. Miller | 66e4f8c | 2008-08-27 20:03:22 -0700 | [diff] [blame] | 214 | continue; |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 215 | while (!ccall_info.processors_in[i]) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 | barrier(); |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 217 | } while (++i < ncpus); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 218 | |
| 219 | i = 0; |
| 220 | do { |
KOSAKI Motohiro | fb1fece | 2011-05-16 13:38:07 -0700 | [diff] [blame] | 221 | if (!cpumask_test_cpu(i, &mask)) |
David S. Miller | 66e4f8c | 2008-08-27 20:03:22 -0700 | [diff] [blame] | 222 | continue; |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 223 | while (!ccall_info.processors_out[i]) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | barrier(); |
Sam Ravnborg | aba20a8 | 2011-01-28 22:08:20 +0000 | [diff] [blame] | 225 | } while (++i < ncpus); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 226 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | spin_unlock_irqrestore(&cross_call_lock, flags); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | /* Running cross calls. */ |
| 231 | void smp4m_cross_call_irq(void) |
| 232 | { |
| 233 | int i = smp_processor_id(); |
| 234 | |
| 235 | ccall_info.processors_in[i] = 1; |
| 236 | ccall_info.func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, |
| 237 | ccall_info.arg4, ccall_info.arg5); |
| 238 | ccall_info.processors_out[i] = 1; |
| 239 | } |
| 240 | |
| 241 | void smp4m_percpu_timer_interrupt(struct pt_regs *regs) |
| 242 | { |
Al Viro | 0d84438 | 2006-10-08 14:30:44 +0100 | [diff] [blame] | 243 | struct pt_regs *old_regs; |
Tkhai Kirill | 62f0828 | 2012-04-04 21:49:26 +0200 | [diff] [blame] | 244 | struct clock_event_device *ce; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | int cpu = smp_processor_id(); |
| 246 | |
Al Viro | 0d84438 | 2006-10-08 14:30:44 +0100 | [diff] [blame] | 247 | old_regs = set_irq_regs(regs); |
| 248 | |
Tkhai Kirill | 62f0828 | 2012-04-04 21:49:26 +0200 | [diff] [blame] | 249 | ce = &per_cpu(sparc32_clockevent, cpu); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | |
Viresh Kumar | ff4aea4 | 2015-07-16 16:56:29 +0530 | [diff] [blame] | 251 | if (clockevent_state_periodic(ce)) |
Tkhai Kirill | 62f0828 | 2012-04-04 21:49:26 +0200 | [diff] [blame] | 252 | sun4m_clear_profile_irq(cpu); |
| 253 | else |
Sam Ravnborg | 08c9388 | 2012-05-14 17:30:35 +0200 | [diff] [blame] | 254 | sparc_config.load_profile_irq(cpu, 0); /* Is this needless? */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | |
Tkhai Kirill | 62f0828 | 2012-04-04 21:49:26 +0200 | [diff] [blame] | 256 | irq_enter(); |
| 257 | ce->event_handler(ce); |
| 258 | irq_exit(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | |
Al Viro | 0d84438 | 2006-10-08 14:30:44 +0100 | [diff] [blame] | 260 | set_irq_regs(old_regs); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | } |
| 262 | |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 263 | static const struct sparc32_ipi_ops sun4m_ipi_ops = { |
| 264 | .cross_call = sun4m_cross_call, |
| 265 | .resched = sun4m_ipi_resched, |
| 266 | .single = sun4m_ipi_single, |
| 267 | .mask_one = sun4m_ipi_mask_one, |
| 268 | }; |
| 269 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 270 | void __init sun4m_init_smp(void) |
| 271 | { |
Sam Ravnborg | 4ba22b1 | 2012-05-14 15:14:36 +0200 | [diff] [blame] | 272 | sparc32_ipi_ops = &sun4m_ipi_ops; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 273 | } |