Subject: Re: ARM ELF toolchain patches
To: Ben Harris <bjh21@netbsd.org>
From: Richard Earnshaw <rearnsha@buzzard.freeserve.co.uk>
List: port-arm32
Date: 02/22/2001 23:15:05
This is a multipart MIME message.

--==_Exmh_11969920200
Content-Type: text/plain; charset=us-ascii

> On Thu, 22 Feb 2001, David Forbes wrote:
> 
> > > > Either one of those would get you FPA support (assuming a suitable kernel,
> > > > which I believe we don't yet have).  The former would produce much faster
> > > > code, but might take rather longer.
> >
> > Question:  what needs to be done to the kernel to get either of these to
> > work?  When I first got NetBSD going on my A7000+ I enquired about FPA
> > support and I got the impression that either -mhard-float or the modified
> > libc would be sufficient.
> 
> As far as I can tell, the arm32 kernel doesn't currently have any code for
> saving and restoring FPA state on context switches.  It may be that the
> necessary code is there, and I haven't been able to find it, though.  
> Come to think of it, it may be in the ARM FPE, which is binary-only.
> 

I believe it's all handled from within the FPE support code, which copies 
data in and out of the appropriate proc tables on context switches.


You will, however, need the following patch to re-enable the FPE code:



--==_Exmh_11969920200
Content-Type: application/x-patch ; name="genassym.patch"
Content-Description: genassym.patch
Content-Disposition: attachment; filename="genassym.patch"

Index: genassym.cf
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm32/arm32/genassym.cf,v
retrieving revision 1.6
diff -p -p -r1.6 genassym.cf
*** genassym.cf	2001/01/18 10:18:24	1.6
--- genassym.cf	2001/02/22 23:14:24
*************** define	TRAPFRAMESIZE		sizeof(struct trap
*** 144,146 ****
--- 144,148 ----
  define	CF_CACHE_PURGE_ID	offsetof(struct cpu_functions, cf_cache_purgeID)
  define	CF_CONTEXT_SWITCH	offsetof(struct cpu_functions, cf_context_switch)
  define	CF_SLEEP		offsetof(struct cpu_functions, cf_sleep)
+ 
+ define	CI_CURPRIORITY		offsetof(struct cpu_info, ci_schedstate.spc_curpriority)

--==_Exmh_11969920200
Content-Type: application/x-patch ; name="fpe.patch"
Content-Description: fpe.patch
Content-Disposition: attachment; filename="fpe.patch"

Index: armfpe_glue.S
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm32/fpe-arm/armfpe_glue.S,v
retrieving revision 1.13
diff -p -p -r1.13 armfpe_glue.S
*** armfpe_glue.S	1999/10/26 06:53:43	1.13
--- armfpe_glue.S	2001/02/22 23:10:23
*************** Lcurproc:
*** 212,218 ****
  	.word	_curproc
  
  Lcurpriority:
! 	.word	_curpriority
  
  #endif
  
--- 212,218 ----
  	.word	_curproc
  
  Lcurpriority:
! 	.word	_cpu_info_store
  
  #endif
  
*************** Lno_signals_pending:
*** 265,271 ****
  	ldrb	r1, [r0, #(P_USRPRI)]
  	strb	r1, [r0, #(P_PRIORITY)]
  	ldr	r0, Lcurpriority
! 	strb	r1, [r0]
  
  	/* Fast return */
  	ldmfd	sp!, {r0-r3, pc}
--- 265,271 ----
  	ldrb	r1, [r0, #(P_USRPRI)]
  	strb	r1, [r0, #(P_PRIORITY)]
  	ldr	r0, Lcurpriority
! 	strb	r1, [r0, #(CI_CURPRIORITY)]
  
  	/* Fast return */
  	ldmfd	sp!, {r0-r3, pc}

--==_Exmh_11969920200--