summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/include/sparc64.h4
-rw-r--r--sys/arch/sparc64/sparc64/ofw_machdep.c52
2 files changed, 54 insertions, 2 deletions
diff --git a/sys/arch/sparc64/include/sparc64.h b/sys/arch/sparc64/include/sparc64.h
index 350de12985e..a75189ffa83 100644
--- a/sys/arch/sparc64/include/sparc64.h
+++ b/sys/arch/sparc64/include/sparc64.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sparc64.h,v 1.6 2003/12/17 03:51:48 jason Exp $ */
+/* $OpenBSD: sparc64.h,v 1.7 2007/09/08 17:48:12 kettenis Exp $ */
/* $NetBSD: sparc64.h,v 1.3 2000/10/20 05:47:03 mrg Exp $ */
/*
@@ -50,6 +50,8 @@ paddr_t prom_alloc_phys(int len, int align);
paddr_t prom_claim_phys(paddr_t phys, int len);
int prom_free_phys(paddr_t paddr, int len);
paddr_t prom_get_msgbuf(int len, int align);
+void prom_start_cpu(int cpu, void *func, long arg);
+void prom_start_cpu_by_cpuid(int cpu, void *func, long arg);
/*
* Debug
diff --git a/sys/arch/sparc64/sparc64/ofw_machdep.c b/sys/arch/sparc64/sparc64/ofw_machdep.c
index 54f6f62202a..9cfe2908fc6 100644
--- a/sys/arch/sparc64/sparc64/ofw_machdep.c
+++ b/sys/arch/sparc64/sparc64/ofw_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofw_machdep.c,v 1.19 2007/07/28 13:22:22 kettenis Exp $ */
+/* $OpenBSD: ofw_machdep.c,v 1.20 2007/09/08 17:48:12 kettenis Exp $ */
/* $NetBSD: ofw_machdep.c,v 1.16 2001/07/20 00:07:14 eeh Exp $ */
/*
@@ -560,6 +560,56 @@ prom_get_msgbuf(len, align)
return addr; /* Kluge till we go 64-bit */
}
+#ifdef MULTIPROCESSOR
+/*
+ * Start secondary cpu, arrange 'func' as the entry.
+ */
+void
+prom_start_cpu(int cpu, void *func, long arg)
+{
+ static struct {
+ cell_t name;
+ cell_t nargs;
+ cell_t nreturns;
+ cell_t cpu;
+ cell_t func;
+ cell_t arg;
+ } args;
+
+ args.name = ADR2CELL("SUNW,start-cpu");
+ args.nargs = 3;
+ args.nreturns = 0;
+ args.cpu = cpu;
+ args.func = ADR2CELL(func);
+ args.arg = arg;
+
+ openfirmware(&args);
+}
+
+void
+prom_start_cpu_by_cpuid(int cpu, void *func, 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;
+
+ args.name = ADR2CELL("SUNW,start-cpu-by-cpuid");
+ args.nargs = 3;
+ args.nreturns = 1;
+ args.cpu = cpu;
+ args.func = ADR2CELL(func);
+ args.arg = arg;
+
+ openfirmware(&args);
+}
+#endif
+
/*
* Low-level prom I/O routines.
*/