On Thu, Oct 28, 2021 at 11:18 AM Richard Henderson < richard.hender...@linaro.org> wrote:
> On 10/19/21 9:44 AM, Warner Losh wrote: > > +typedef struct { > > + uint32_t __fp_fpsr; > > + struct { > > + uint32_t __fp_exponent; > > + uint32_t __fp_mantissa_hi; > > + uint32_t __fp_mantissa_lo; > > + } __fp_fr[8]; > > +} target__fpregset_t; > > + > > +typedef struct { > > + uint32_t __vfp_fpscr; > > + uint32_t __vfp_fstmx[33]; > > + uint32_t __vfp_fpsid; > > +} target__vfpregset_t; > > + > > +typedef struct target_mcontext { > > + uint32_t __gregs[TARGET__NGREG]; > > + union { > > + target__fpregset_t __fpregs; > > + target__vfpregset_t __vfpregs; > > + } __fpu; > > +} target_mcontext_t; > > This doesn't match what I see in sys/arm/include/ucontext.h at all. > I don't even see the string "fstmx" anywhere in the source tree. > Yea. This appears to be a copy mostly from mips and is totally wrong for ARM. However, despite that, it works by accident because the general registers all wind up in the right places and we don't actually write to the full context.... I'll respin with the correct headers and any code tweaks that are needed. As to 'how this happened' I'm at a loss: git blame shows that it came in when the sbruno repo was created which is the earliest history I have for the project. Warner