From owner-freebsd-mips@FreeBSD.ORG Tue Dec 28 11:36:48 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4E54106564A; Tue, 28 Dec 2010 11:36:48 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4DE8FC18; Tue, 28 Dec 2010 11:36:48 +0000 (UTC) Received: by iwn39 with SMTP id 39so9413022iwn.13 for ; Tue, 28 Dec 2010 03:36:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=oF1Ytu78nk+FGnDhMNV2nGjNgJiPXyBThn2gt2eThgA=; b=nYp8cgKsjVus6kR4awphNAU1N0ZBPrGERSX6ZuNa/33PmBIIbxACid103F0ltCgmCX hDO0YZy6MbfFWTYX2R1c2xpbNHpvBSk+aglDQt7O4931ujQmiOzq8JEzxbwrZC+xqts2 lCxkVWJafvUAiCv/NPgQtjvYy2zyXge8GIuHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ASBnRG56ckoCeB0X3eXFVCDhmJXva9Esxed89lFpfPTZgwToPnO/RzzF525BJp0+fm HqdOLaZmmv8THSChmdTQcinrlqrFdOHKovvDQgXxfyyVbIfdlxajG0St36HvgY4WBCTw Y6uJ3v6uMLzlWPg5InSbQEaUPVPSfLgBh+R3A= MIME-Version: 1.0 Received: by 10.231.30.200 with SMTP id v8mr13075105ibc.172.1293536207901; Tue, 28 Dec 2010 03:36:47 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.231.5.153 with HTTP; Tue, 28 Dec 2010 03:36:47 -0800 (PST) In-Reply-To: References: Date: Tue, 28 Dec 2010 12:36:47 +0100 X-Google-Sender-Auth: rNFZ-ikiGXcyHkAV9WmXAiLOB34 Message-ID: From: Robert Millan To: "Jayachandran C." Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Retrieval of TLS pointer via RDHWR X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2010 11:36:48 -0000 Not interested? Note this might become mandatory if you ever want to compile code that uses TLS with recent GCC. In any case, when executed natively, rdhwr is a speed-up compared to a sysarch() call. 2010/12/9 Robert Millan : > 2010/12/9 Jayachandran C. : >> I'm not sure that the freebsd mips toolchain supports the __thread >> directive yet. =C2=A0Were you able to test this from C? > > Yes, but not via __thread. =C2=A0I wrote a small program that sets > the TLS pointer to an arbitrary value (via MIPS_SET_TLS), > then issued rdhwr instruction using C inline assembly, and > finally verified that both values are the same. > > (the toolchain I'm using doesn't support __thread either, > but I submit this patch with the expectation that it can be > useful later on) > > -- > Robert Millan > --=20 Robert Millan