On 28 October 2011 08:27, Markus Armbruster <arm...@redhat.com> wrote: > Andreas Färber <afaer...@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