From 0c6cd44747a3242fd2727e389901bff4e313e2d3 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Wed, 24 Oct 2007 20:54:00 +0000 Subject: Turn curcpu() into an inline function instead of a macro relying on a GCC extension. --- sys/arch/m88k/include/cpu.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'sys') 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) -- cgit v1.2.3