From patchwork Mon Jun 24 19:21:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Maste X-Patchwork-Id: 253966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B14512C007B for ; Tue, 25 Jun 2013 06:41:18 +1000 (EST) Received: from localhost ([::1]:50735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrDZc-0001E0-3g for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2013 16:41:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrDZ0-0001BY-Eb for qemu-devel@nongnu.org; Mon, 24 Jun 2013 16:40:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrDYz-0002Lz-5i for qemu-devel@nongnu.org; Mon, 24 Jun 2013 16:40:38 -0400 Received: from [216.171.111.232] (port=35530 helo=freebsd.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrCKE-0008GT-Qg for qemu-devel@nongnu.org; Mon, 24 Jun 2013 15:21:18 -0400 Received: from emaste (uid 1001) (envelope-from emaste@freebsd.org) id 9cd80 by freebsd.org (DragonFly Mail Agent 1); Mon, 24 Jun 2013 15:21:17 -0400 From: Ed Maste To: qemu-devel@nongnu.org Date: Mon, 24 Jun 2013 15:21:17 -0400 Message-Id: <1372101677-46175-1-git-send-email-emaste@freebsd.org> X-Mailer: git-send-email 1.7.11.5 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 216.171.111.232 Cc: qemu-trivial@nongnu.org, Ed Maste Subject: [Qemu-devel] [PATCH] tls.h: Enable TLS on FreeBSD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Ed Maste --- I have had this in a local tree for some time, and it is needed by the BSD-user work that is now being proposed. As an aside, an abstraction was recently proposed for Open vSwtich that can use any of _Thread_local, __thread, or pthread_getspecific() which may make a convenient reference for someone wishing to implement one of the TODOs: http://openvswitch.org/pipermail/dev/2013-June/028665.html include/qemu/tls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/tls.h b/include/qemu/tls.h index b92ea9d..ae7d79d 100644 --- a/include/qemu/tls.h +++ b/include/qemu/tls.h @@ -38,7 +38,7 @@ * TODO: proper implementations via Win32 .tls sections and * POSIX pthread_getspecific. */ -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) #define DECLARE_TLS(type, x) extern DEFINE_TLS(type, x) #define DEFINE_TLS(type, x) __thread __typeof__(type) tls__##x #define tls_var(x) tls__##x