From owner-svn-src-head@FreeBSD.ORG Mon Apr 16 20:04:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BE8E1065674 for ; Mon, 16 Apr 2012 20:04:18 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta07.emeryville.ca.mail.comcast.net (qmta07.emeryville.ca.mail.comcast.net [76.96.30.64]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8C48FC1E for ; Mon, 16 Apr 2012 20:04:18 +0000 (UTC) Received: from omta19.emeryville.ca.mail.comcast.net ([76.96.30.76]) by qmta07.emeryville.ca.mail.comcast.net with comcast id yipC1i0011eYJf8A7k3CYj; Mon, 16 Apr 2012 20:03:12 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta19.emeryville.ca.mail.comcast.net with comcast id yk3A1i01l4NgCEG01k3B8u; Mon, 16 Apr 2012 20:03:12 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q3GK39fw064637; Mon, 16 Apr 2012 14:03:09 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Juli Mallett In-Reply-To: References: <201204160938.q3G9cLmw026093@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 16 Apr 2012 14:03:09 -0600 Message-ID: <1334606589.1082.201.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234337 - in head: lib/libc/arm/gen sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2012 20:04:18 -0000 On Mon, 2012-04-16 at 12:41 -0700, Juli Mallett wrote: > On Mon, Apr 16, 2012 at 02:38, Andrew Turner wrote: > > Log: > > Replace the C implementation of __aeabi_read_tp with an assembly version. > > This ensures we follow the ABI by preserving registers r1-r3. > > > +ENTRY(__aeabi_read_tp) > > + ldr r0, .Larm_tp_address > > + ldr r0, [r0] > > + RET > > + > > +.Larm_tp_address: > > + .word ARM_TP_ADDRESS > > + > > Why is this indirection required? Can't you just use ARM_TP_ADDRESS > instead of loading it from data? Also, is our convention for ARM to > use END() with ENTRY() or not? It used to be possible to directly load ARM_TP_ADDRESS into a register when it had a cleverly-crafted value that made use of ARM's ability to encode a constant value into an instruction if it can be expressed as an 8-bit value shifted by anything up to 31 bits. (iirc, it used to be 0xe0000000). At some point that address became a problem for someone and it got changed to a value which can no longer be encoded within the instruction. The alternative is to load it with a single instruction by using a pc-relative address, or use a series of load-and-shift instructions to form the new more complex constant. Ick. -- Ian