diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-03-31 22:14:02 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-03-31 22:14:02 +0000 |
commit | e66dfd6cee3d241b13d2942684076f3fb034a7a6 (patch) | |
tree | 51bda2042d8cff1250bc24131ef6b5a87ac1a772 /sys/arch/sparc64/include/cpu.h | |
parent | 7faf843fd0787907444c2fc9c599095ca4b016a0 (diff) |
Make MULTIPROCESSOR kernels work on sun4v. Won't gracefully halt, powerdown
or reboot yet, but that will (hopefully) be fixed in the near future.
Diffstat (limited to 'sys/arch/sparc64/include/cpu.h')
-rw-r--r-- | sys/arch/sparc64/include/cpu.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h index a80575ebd1b..27fc8491636 100644 --- a/sys/arch/sparc64/include/cpu.h +++ b/sys/arch/sparc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.58 2008/03/23 23:46:21 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.59 2008/03/31 22:14:01 kettenis Exp $ */ /* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */ /* @@ -157,7 +157,18 @@ extern struct cpu_info *cpus; #ifdef MULTIPROCESSOR #define cpu_number() (curcpu()->ci_number) -#define curcpu() (((struct cpu_info *)CPUINFO_VA)->ci_self) + +extern __inline struct cpu_info *curcpu(void); +extern __inline struct cpu_info * +curcpu(void) +{ + if (CPU_ISSUN4V) { + __asm __volatile("nop" : : : "memory"); + return (struct cpu_info *)ldxa(0, ASI_SCRATCHPAD); + } + + return (((struct cpu_info *)CPUINFO_VA)->ci_self); +} #define CPU_IS_PRIMARY(ci) ((ci)->ci_number == 0) #define CPU_INFO_ITERATOR int |