Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64 sun4v: New function prom_startcpu_by_cpuid(...



details:   https://anonhg.NetBSD.org/src/rev/2c28a233fa88
branches:  trunk
changeset: 802242:2c28a233fa88
user:      palle <palle%NetBSD.org@localhost>
date:      Sat Sep 06 20:56:39 2014 +0000

description:
sun4v: New function prom_startcpu_by_cpuid() necessary for starting cpus on sun4v

diffstat:

 sys/arch/sparc64/include/sparc64.h     |   3 +-
 sys/arch/sparc64/sparc64/ofw_machdep.c |  37 +++++++++++++++++++++++++++++++--
 2 files changed, 36 insertions(+), 4 deletions(-)

diffs (81 lines):

diff -r 973755846705 -r 2c28a233fa88 sys/arch/sparc64/include/sparc64.h
--- a/sys/arch/sparc64/include/sparc64.h        Sat Sep 06 20:54:53 2014 +0000
+++ b/sys/arch/sparc64/include/sparc64.h        Sat Sep 06 20:56:39 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sparc64.h,v 1.12 2014/01/07 20:11:35 palle Exp $       */
+/*     $NetBSD: sparc64.h,v 1.13 2014/09/06 20:56:39 palle Exp $       */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -58,5 +58,6 @@
 int  prom_stop_other(u_int);
 bool prom_has_stop_other(void);
 void prom_startcpu(u_int, void *, u_long);
+int prom_startcpu_by_cpuid(u_int, void *, u_long arg);
 
 #endif /* _MACHINE_SPARC64_H_ */
diff -r 973755846705 -r 2c28a233fa88 sys/arch/sparc64/sparc64/ofw_machdep.c
--- a/sys/arch/sparc64/sparc64/ofw_machdep.c    Sat Sep 06 20:54:53 2014 +0000
+++ b/sys/arch/sparc64/sparc64/ofw_machdep.c    Sat Sep 06 20:56:39 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_machdep.c,v 1.42 2014/05/04 09:05:39 martin Exp $  */
+/*     $NetBSD: ofw_machdep.c,v 1.43 2014/09/06 20:56:39 palle Exp $   */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.42 2014/05/04 09:05:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.43 2014/09/06 20:56:39 palle Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -536,7 +536,7 @@
 
 #ifdef MULTIPROCESSOR
 /*
- * Start secondary cpu, arrange 'func' as the entry.
+ * Start secondary cpu identified by node, arrange 'func' as the entry.
  */
 void
 prom_startcpu(u_int cpu, void *func, u_long arg)
@@ -561,6 +561,37 @@
 }
 
 /*
+ * Start secondary cpu identified by cpuid, arrange 'func' as the entry.
+ * Returns -1 in case the openfirmware method is not available.
+ * Otherwise the result value from the openfirmware call is returned.
+ */
+int
+prom_startcpu_by_cpuid(u_int cpu, void *func, u_long arg)
+{
+       static struct {
+               cell_t  name;
+               cell_t  nargs;
+               cell_t  nreturns;
+               cell_t  cpu;
+               cell_t  func;
+               cell_t  arg;
+               cell_t  status;
+       } args;
+
+       if (OF_test("SUNW,start-cpu-by-cpuid") != 0)
+               return -1;
+       
+       args.name = ADR2CELL("SUNW,start-cpu-by-cpuid");
+       args.nargs = 3;
+       args.nreturns = 1;
+       args.cpu = cpu;
+       args.func = ADR2CELL(func);
+       args.arg = arg;
+
+       return openfirmware(&args);
+}
+
+/*
  * Stop the calling cpu.
  */
 void



Home | Main Index | Thread Index | Old Index