From owner-freebsd-arm@FreeBSD.ORG Sun Jun 2 09:24:54 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82E7AE97 for ; Sun, 2 Jun 2013 09:24:54 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 6A1ED1CA0 for ; Sun, 2 Jun 2013 09:24:54 +0000 (UTC) Received: from bender.Home (unknown [176.252.108.73]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 109555E5AD; Sun, 2 Jun 2013 09:24:51 +0000 (UTC) Date: Sun, 2 Jun 2013 10:24:44 +0100 From: Andrew Turner To: Warner Losh Subject: Re: Updating setjmp/longjmp Message-ID: <20130602102444.68f00e43@bender.Home> In-Reply-To: <104894B0-F9B5-490C-A0D8-6D2732BAFCE0@bsdimp.com> References: <20130601201253.47daf4a1@bender.Home> <104894B0-F9B5-490C-A0D8-6D2732BAFCE0@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2013 09:24:54 -0000 On Sat, 1 Jun 2013 23:50:00 -0600 Warner Losh wrote: > > On Jun 1, 2013, at 1:12 PM, Andrew Turner wrote: > > > Hello, > > > > I'm updating the setjmp/longjmp functions on ARM to reduce the diff > > to NetBSD and to store the VFP registers when they are available. > > > > As part of this I will be removeing support for storing the FPA > > (floating point accelerator) registers. Does anyone have any > > objections to this? > > > > The first patch is at [1]. It updates > > out code to remove the FPA support but doesn't yet add the VFP as > > that will require other libc changes. > > > > (If you don't know what the FPA is this patch probably doesn't > > affect you, it was an old floating-point device in only a few > > chips. Modern CPUs use a different piece of hardware for floating > > point operations.) > > Did we ever support this? Or were they used only for the floating > point emulator that NetBSD had in their tree for a while, but that I > don't think ever made it into ours since softfloat is faster.... Juniper may have, see [1]. The patch in that post went into head in r186461. Marcel can you comment on if this is the case? > This looks OK to the limit of my arm assembler knowledge, but why the > switch from r3 to ip in longjmp? Mostly to be consistent with NetBSD. They use r3 in part of the patch I left out as it needs other changes. The idea is to have a different setjmp magic number when VFP is used. The start of longjmp in NetBSD is: ldr r2, [r0] ldr ip, .Lsetjmp_magic bic r3, r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP) teq r3, ip bne .Lbotch As there is a single bit difference between _JB_MAGIC_SETJMP and _JB_MAGIC_SETJMP_VFP the bit line clears it before the check. I feel it is better to reduce the difference between us and NetBSD as I will be pulling in other NetBSD changes soon. > Also, what's the difference between setjmp and_setgjmp? It's just > saving the signal mask... Is there any benefit to merging? The meat > of the functions are tiny, but there's all that boilerplate... Yes, they are almost identical. The only functional difference between the two should be that _setjmp doesn't store the signal state. It is something I can look into when I have finished merging in the changes. Andrew [1] http://lists.freebsd.org/pipermail/freebsd-arm/2008-December/001429.html