From d2d2303563e2b260114bc0aa679d8c256eb0a43e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 10 May 2009 22:50:48 -0400 Subject: [PATCH] Fix precompiler error in arch_*.h, add arch-api test Signed-off-by: Mathieu Desnoyers --- Makefile | 9 +++++++-- arch_ppc.h | 2 +- arch_x86.h | 2 +- urcu-static.h | 23 ++++++++++++++++++----- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 1965a77..20024c6 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,15 @@ LDFLAGS=-lpthread SRC_DEP=`echo $^ | sed 's/[^ ]*.h//g'` -all: test_urcu test_urcu_dynamic_link test_urcu_timing \ +all: arch-api test_urcu test_urcu_dynamic_link test_urcu_timing \ test_rwlock_timing test_urcu_yield urcu-asm.S \ urcu-asm.o urcutorture urcutorture-yield liburcu.so +arch-api: api.h arch.h + # Run either make pthreads-x86 or make pthreads-ppc prior to build + # the RCU library. Architecture auto-detectection not implemented + # in the build system yet. + pthreads-x86: clean cp api_x86.h api.h cp arch_x86.h arch.h @@ -59,7 +64,7 @@ urcutorture: urcutorture.c urcu.o urcu.h rcutorture.h urcutorture-yield: urcutorture.c urcu-yield.o urcu.h rcutorture.h $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP) -.PHONY: clean install +.PHONY: clean install arch-api install: liburcu.so cp -f liburcu.so /usr/lib/ diff --git a/arch_ppc.h b/arch_ppc.h index 1a34024..40d186b 100644 --- a/arch_ppc.h +++ b/arch_ppc.h @@ -28,7 +28,7 @@ #define CONFIG_HAVE_MEM_COHERENCY #ifndef BITS_PER_LONG -#define BITS_PER_LONG (sizeof(unsigned long) * 8) +#define BITS_PER_LONG (sizeof(unsigned long) * 8) #endif #define mb() asm volatile("sync":::"memory") diff --git a/arch_x86.h b/arch_x86.h index 01b5d50..e899684 100644 --- a/arch_x86.h +++ b/arch_x86.h @@ -29,7 +29,7 @@ #define CONFIG_HAVE_MEM_COHERENCY #ifndef BITS_PER_LONG -#define BITS_PER_LONG (sizeof(unsigned long) * 8) +#define BITS_PER_LONG (__SIZEOF_LONG__ * 8) #endif #ifdef CONFIG_HAVE_FENCE diff --git a/urcu-static.h b/urcu-static.h index c47a759..f1aab2f 100644 --- a/urcu-static.h +++ b/urcu-static.h @@ -4,14 +4,27 @@ /* * urcu-static.h * - * Userspace RCU header, to be included only in LGPL-compatible code. + * Userspace RCU header. * - * Copyright February 2009 - Mathieu Desnoyers + * TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu.h for linking + * dynamically with the userspace rcu library. * - * Credits for Paul E. McKenney - * for inspiration coming from the Linux kernel RCU and rcu-preempt. + * Copyright (c) 2009 Mathieu Desnoyers + * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. * - * Distributed under LGPLv2.1 + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ -- 2.34.1