qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Dr. David Alan Gilbert" <david.gilbert@linaro.org>,
	patches@linaro.org, "Jan Kiszka" <jan.kiszka@siemens.com>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2 1/3] qemu-tls.h: Add abstraction layer for TLS variables
Date: Fri, 28 Oct 2011 08:45:33 +0100	[thread overview]
Message-ID: <CAFEAcA9jc8fgLqbAMF+=oDECjzmnFwp1GDu0fSYOjY2Gotjn6Q@mail.gmail.com> (raw)
In-Reply-To: <m3vcr94ltu.fsf@blackfin.pond.sub.org>

On 28 October 2011 08:27, Markus Armbruster <armbru@redhat.com> wrote:
> Andreas Färber <afaerber@suse.de> 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
>
>  * Copyright (c) 2011 Red Hat, Inc
>  * 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)  __thread __typeof__(type) tls__##x
>>> +#define get_tls(x)           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)  __typeof__(type) tls__##x
>>> +#define get_tls(x)           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

  reply	other threads:[~2011-10-28  7:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 11:37 [Qemu-devel] [PATCH v2 0/3] TLS abstraction layer for thread-local cpu_single_env on Linux Peter Maydell
2011-10-27 11:37 ` [Qemu-devel] [PATCH v2 1/3] qemu-tls.h: Add abstraction layer for TLS variables Peter Maydell
2011-10-27 15:04   ` Andreas Färber
2011-10-27 15:08     ` Paolo Bonzini
2011-10-27 15:15     ` Peter Maydell
2011-10-27 15:18       ` Paolo Bonzini
2011-10-27 16:18     ` Andreas Färber
2011-10-28  7:27     ` Markus Armbruster
2011-10-28  7:45       ` Peter Maydell [this message]
2011-10-27 11:37 ` [Qemu-devel] [PATCH v2 2/3] darwin-user/main.c: Drop unused cpu_single_env definition Peter Maydell
2011-10-27 13:22   ` Andreas Färber
2011-10-27 11:37 ` [Qemu-devel] [PATCH v2 3/3] Make cpu_single_env thread-local Peter Maydell
2011-10-27 15:10   ` Andreas Färber
2011-10-27 15:12     ` Paolo Bonzini
2011-10-27 16:20     ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA9jc8fgLqbAMF+=oDECjzmnFwp1GDu0fSYOjY2Gotjn6Q@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=david.gilbert@linaro.org \
    --cc=jan.kiszka@siemens.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).