Path: blob/master/arch/powerpc/platforms/iseries/smp.c
10820 views
/*1* SMP support for iSeries machines.2*3* Dave Engebretsen, Peter Bergner, and4* Mike Corrigan {engebret|bergner|mikec}@us.ibm.com5*6* Plus various changes from other IBM teams...7*8* This program is free software; you can redistribute it and/or9* modify it under the terms of the GNU General Public License10* as published by the Free Software Foundation; either version11* 2 of the License, or (at your option) any later version.12*/1314#undef DEBUG1516#include <linux/kernel.h>17#include <linux/module.h>18#include <linux/sched.h>19#include <linux/smp.h>20#include <linux/interrupt.h>21#include <linux/kernel_stat.h>22#include <linux/delay.h>23#include <linux/init.h>24#include <linux/spinlock.h>25#include <linux/cache.h>26#include <linux/err.h>27#include <linux/sysdev.h>28#include <linux/cpu.h>2930#include <asm/ptrace.h>31#include <asm/atomic.h>32#include <asm/irq.h>33#include <asm/page.h>34#include <asm/pgtable.h>35#include <asm/io.h>36#include <asm/smp.h>37#include <asm/paca.h>38#include <asm/iseries/hv_call.h>39#include <asm/time.h>40#include <asm/machdep.h>41#include <asm/cputable.h>42#include <asm/system.h>4344static void smp_iSeries_cause_ipi(int cpu, unsigned long data)45{46HvCall_sendIPI(&(paca[cpu]));47}4849static int smp_iSeries_probe(void)50{51return cpumask_weight(cpu_possible_mask);52}5354static int smp_iSeries_kick_cpu(int nr)55{56BUG_ON((nr < 0) || (nr >= NR_CPUS));5758/* Verify that our partition has a processor nr */59if (lppaca_of(nr).dyn_proc_status >= 2)60return -ENOENT;6162/* The processor is currently spinning, waiting63* for the cpu_start field to become non-zero64* After we set cpu_start, the processor will65* continue on to secondary_start in iSeries_head.S66*/67paca[nr].cpu_start = 1;6869return 0;70}7172static void __devinit smp_iSeries_setup_cpu(int nr)73{74}7576static struct smp_ops_t iSeries_smp_ops = {77.message_pass = smp_muxed_ipi_message_pass,78.cause_ipi = smp_iSeries_cause_ipi,79.probe = smp_iSeries_probe,80.kick_cpu = smp_iSeries_kick_cpu,81.setup_cpu = smp_iSeries_setup_cpu,82};8384/* This is called very early. */85void __init smp_init_iSeries(void)86{87smp_ops = &iSeries_smp_ops;88}899091