Date: Sun, 2 Jun 2013 10:24:44 +0100 From: Andrew Turner <andrew@fubar.geek.nz> To: Warner Losh <imp@bsdimp.com> Cc: freebsd-arm@freebsd.org 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>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 1 Jun 2013 23:50:00 -0600 Warner Losh <imp@bsdimp.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130602102444.68f00e43>