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 |
*/ |