summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-10-24 20:54:00 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-10-24 20:54:00 +0000
commit0c6cd44747a3242fd2727e389901bff4e313e2d3 (patch)
tree30111736de38997d8a8323ef4e7d322921d6f82a /sys
parent0d42f712b9385b3dc336b4c2df13c4c7ac365cd5 (diff)
Turn curcpu() into an inline function instead of a macro relying on a GCC
extension.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/m88k/include/cpu.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h
index 87bd3869160..a3aa4f9e2b2 100644
--- a/sys/arch/m88k/include/cpu.h
+++ b/sys/arch/m88k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.25 2007/10/16 04:57:37 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.26 2007/10/24 20:53:59 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* Copyright (c) 1992, 1993
@@ -125,13 +125,14 @@ extern struct cpu_info m88k_cpus[MAX_CPUS];
#if defined(MULTIPROCESSOR)
-#define curcpu() \
-({ \
- struct cpu_info *cpuptr; \
- \
- __asm__ __volatile__ ("ldcr %0, cr17" : "=r" (cpuptr)); \
- cpuptr; \
-})
+static __inline__ struct cpu_info *
+curcpu(void)
+{
+ struct cpu_info *cpuptr;
+
+ __asm__ __volatile__ ("ldcr %0, cr17" : "=r" (cpuptr));
+ return cpuptr;
+}
#define CPU_IS_PRIMARY(ci) ((ci)->ci_primary != 0)