FreeBSD Bugzilla – Attachment 180669 Details for
Bug 217611
ARM VFP/NEON regs not preserved in signal delivery
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch I'm testing (breaks ABI)
vfp.patch (text/plain), 1.92 KB, created by
Andrew "RhodiumToad" Gierth
on 2017-03-09 10:37:38 UTC
(
hide
)
Description:
patch I'm testing (breaks ABI)
Filename:
MIME Type:
Creator:
Andrew "RhodiumToad" Gierth
Created:
2017-03-09 10:37:38 UTC
Size:
1.92 KB
patch
obsolete
>Index: arm/arm/machdep.c >=================================================================== >--- arm/arm/machdep.c (revision 314495) >+++ arm/arm/machdep.c (working copy) >@@ -201,6 +201,9 @@ > > extern int *end; > >+static void get_fpcontext(struct thread *td, mcontext_t *mcp); >+static void set_fpcontext(struct thread *td, mcontext_t *mcp); >+ > #ifdef FDT > static char *loader_envp; > >@@ -880,6 +883,8 @@ > gr[_REG_LR] = tf->tf_usr_lr; > gr[_REG_PC] = tf->tf_pc; > >+ get_fpcontext(td, mcp); >+ > return (0); > } > >@@ -913,9 +918,53 @@ > tf->tf_pc = gr[_REG_PC]; > tf->tf_spsr = gr[_REG_CPSR]; > >+ set_fpcontext(td, mcp); >+ > return (0); > } > >+static void >+get_fpcontext(struct thread *td, mcontext_t *mcp) >+{ >+#ifdef VFP >+ struct pcb *curpcb; >+ >+ critical_enter(); >+ >+ curpcb = td->td_pcb; >+ vfp_store(&curpcb->pcb_vfpstate, 0); >+ >+ memcpy(mcp->__fpu.__vfpregs.__vfp_regs, >+ curpcb->pcb_vfpstate.reg, >+ sizeof(curpcb->pcb_vfpstate.reg)); >+ mcp->__fpu.__vfpregs.__vfp_fpscr = curpcb->pcb_vfpstate.fpscr; >+ >+ critical_exit(); >+#endif >+} >+ >+static void >+set_fpcontext(struct thread *td, mcontext_t *mcp) >+{ >+#ifdef VFP >+ struct pcb *curpcb; >+ >+ critical_enter(); >+ >+ curpcb = td->td_pcb; >+ >+ vfp_discard(td); >+ >+ memcpy(curpcb->pcb_vfpstate.reg, >+ mcp->__fpu.__vfpregs.__vfp_regs, >+ sizeof(curpcb->pcb_vfpstate.reg)); >+ curpcb->pcb_vfpstate.fpscr = mcp->__fpu.__vfpregs.__vfp_fpscr; >+ >+ critical_exit(); >+#endif >+} >+ >+ > /* > * MPSAFE > */ >Index: arm/include/ucontext.h >=================================================================== >--- arm/include/ucontext.h (revision 314495) >+++ arm/include/ucontext.h (working copy) >@@ -77,9 +77,9 @@ > } __fpregset_t; > > typedef struct { >- unsigned int __vfp_fpscr; >- unsigned int __vfp_fstmx[33]; >- unsigned int __vfp_fpsid; >+ unsigned int __vfp_regs[64]; >+ unsigned int __vfp_fpscr; >+ unsigned int __vfp_fpsid; /* not used? */ > } __vfpregset_t; > > typedef struct {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 217611
:
180600
| 180669