View | Details | Raw Unified | Return to bug 217611
Collapse All | Expand All

(-)arm/arm/machdep.c (+49 lines)
Lines 201-206 Link Here
201
201
202
extern int *end;
202
extern int *end;
203
203
204
static void get_fpcontext(struct thread *td, mcontext_t *mcp);
205
static void set_fpcontext(struct thread *td, mcontext_t *mcp);
206
204
#ifdef FDT
207
#ifdef FDT
205
static char *loader_envp;
208
static char *loader_envp;
206
209
Lines 880-885 Link Here
880
	gr[_REG_LR]   = tf->tf_usr_lr;
883
	gr[_REG_LR]   = tf->tf_usr_lr;
881
	gr[_REG_PC]   = tf->tf_pc;
884
	gr[_REG_PC]   = tf->tf_pc;
882
885
886
	get_fpcontext(td, mcp);
887
	
883
	return (0);
888
	return (0);
884
}
889
}
885
890
Lines 913-921 Link Here
913
	tf->tf_pc = gr[_REG_PC];
918
	tf->tf_pc = gr[_REG_PC];
914
	tf->tf_spsr = gr[_REG_CPSR];
919
	tf->tf_spsr = gr[_REG_CPSR];
915
920
921
	set_fpcontext(td, mcp);
922
	
916
	return (0);
923
	return (0);
917
}
924
}
918
925
926
static void
927
get_fpcontext(struct thread *td, mcontext_t *mcp)
928
{
929
#ifdef VFP
930
    struct pcb *curpcb;
931
932
    critical_enter();
933
934
    curpcb = td->td_pcb;
935
    vfp_store(&curpcb->pcb_vfpstate, 0);
936
937
    memcpy(mcp->__fpu.__vfpregs.__vfp_regs,
938
	   curpcb->pcb_vfpstate.reg,
939
	   sizeof(curpcb->pcb_vfpstate.reg));
940
    mcp->__fpu.__vfpregs.__vfp_fpscr = curpcb->pcb_vfpstate.fpscr;
941
942
    critical_exit();
943
#endif
944
}
945
946
static void
947
set_fpcontext(struct thread *td, mcontext_t *mcp)
948
{
949
#ifdef VFP
950
    struct pcb *curpcb;
951
952
    critical_enter();
953
954
    curpcb = td->td_pcb;
955
956
    vfp_discard(td);
957
    
958
    memcpy(curpcb->pcb_vfpstate.reg,
959
	   mcp->__fpu.__vfpregs.__vfp_regs,
960
	   sizeof(curpcb->pcb_vfpstate.reg));
961
    curpcb->pcb_vfpstate.fpscr = mcp->__fpu.__vfpregs.__vfp_fpscr;
962
963
    critical_exit();
964
#endif
965
}
966
967
919
/*
968
/*
920
 * MPSAFE
969
 * MPSAFE
921
 */
970
 */
(-)arm/include/ucontext.h (-3 / +3 lines)
Lines 77-85 Link Here
77
} __fpregset_t;
77
} __fpregset_t;
78
78
79
typedef struct {
79
typedef struct {
80
	unsigned int	__vfp_fpscr;
80
	unsigned int	__vfp_regs[64];
81
	unsigned int	__vfp_fstmx[33];
81
    	unsigned int	__vfp_fpscr;
82
	unsigned int	__vfp_fpsid;
82
	unsigned int	__vfp_fpsid;  /* not used? */
83
} __vfpregset_t;
83
} __vfpregset_t;
84
84
85
typedef struct {
85
typedef struct {

Return to bug 217611