From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJh8B-00082z-GO for qemu-devel@nongnu.org; Fri, 28 Oct 2011 03:45:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJh8A-00084w-Cc for qemu-devel@nongnu.org; Fri, 28 Oct 2011 03:45:35 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:53010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJh8A-00084m-9K for qemu-devel@nongnu.org; Fri, 28 Oct 2011 03:45:34 -0400 Received: by qadc12 with SMTP id c12so4189603qad.4 for ; Fri, 28 Oct 2011 00:45:33 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1319715472-16286-1-git-send-email-peter.maydell@linaro.org> <1319715472-16286-2-git-send-email-peter.maydell@linaro.org> <4EA97304.9080500@suse.de> Date: Fri, 28 Oct 2011 08:45:33 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 1/3] qemu-tls.h: Add abstraction layer for TLS variables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: "Dr. David Alan Gilbert" , patches@linaro.org, Jan Kiszka , qemu-devel@nongnu.org, Paolo Bonzini , =?UTF-8?Q?Andreas_F=C3=A4rber?= On 28 October 2011 08:27, Markus Armbruster wrote: > Andreas F=C3=A4rber writes: > >> Am 27.10.2011 13:37, schrieb Peter Maydell: >>> + * Copyright (c) 2011 Red Hat, Inc, Linaro Limited >> >> The concatenation looks kind of funny. ;) > > I'd split into > > =C2=A0* Copyright (c) 2011 Red Hat, Inc > =C2=A0* Copyright (c) 2011 Linaro Limited >>> +#ifndef QEMU_TLS_GCC_H >>> +#define QEMU_TLS_GCC_H >> >> Extra _GCC. But does no harm. > > Unless you file "unusual" under harm, which I happen to do :) OK, I'll fix these nits and resend later this morning. >>> +#ifdef __linux__ >>> +#define DECLARE_TLS(type, x) extern DEFINE_TLS(type, x) >>> +#define DEFINE_TLS(type, x) =C2=A0__thread __typeof__(type) tls__##x >>> +#define get_tls(x) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tls__##x >>> +#else >>> +/* Dummy implementations which define plain global variables */ >>> +#define DECLARE_TLS(type, x) extern DEFINE_TLS(type, x) >>> +#define DEFINE_TLS(type, x) =C2=A0__typeof__(type) tls__##x >>> +#define get_tls(x) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tls__##x >>> +#endif > > Any particular reason for pasting tls__ onto the identifier? It means we catch accidentally using the identifier directly rather than via get_tls() at compile time. (That doesn't matter for the __thread case, obviously, but does for other implementations.) (also it means we get out of the way of the cpu_single_env macro we define in patch 3.) -- PMM