Exemple #1
0
static inline int restore_thread_fp_context(struct sigcontext *sc)
{
	u64 *pfreg = &current->thread.fpu.soft.regs[0];
	int err = 0;

	/* 
	 * Copy all 32 64-bit values, for two reasons.  First, the R3000 and
	 * R4000/MIPS32 kernels use the thread FP register storage differently,
	 * such that a full copy is essentially necessary to support both.
	 */

#define restore_fpr(i) 						\
	do { err |= __get_user(pfreg[i], &sc->sc_fpregs[i]); } while(0);

	restore_fpr( 0); restore_fpr( 1); restore_fpr( 2); restore_fpr( 3);
	restore_fpr( 4); restore_fpr( 5); restore_fpr( 6); restore_fpr( 7);
	restore_fpr( 8); restore_fpr( 9); restore_fpr(10); restore_fpr(11);
	restore_fpr(12); restore_fpr(13); restore_fpr(14); restore_fpr(15);
	restore_fpr(16); restore_fpr(17); restore_fpr(18); restore_fpr(19);
	restore_fpr(20); restore_fpr(21); restore_fpr(22); restore_fpr(23);
	restore_fpr(24); restore_fpr(25); restore_fpr(26); restore_fpr(27);
	restore_fpr(28); restore_fpr(29); restore_fpr(30); restore_fpr(31);

	err |= __get_user(current->thread.fpu.soft.sr, &sc->sc_fpc_csr);

	return err;
}
Exemple #2
0
static inline int restore_thread_fp_context(struct sigcontext *sc)
{
     u64 *pfreg = &current->thread.fpu.soft.regs[0];
     int err = 0;

     /*
      * Copy all 32 64-bit values.
      */

#define restore_fpr(i)                          \
     do { err |= __get_user(pfreg[i], &sc->sc_fpregs[i]); } while(0)

     restore_fpr( 0); restore_fpr( 1); restore_fpr( 2); restore_fpr( 3);
     restore_fpr( 4); restore_fpr( 5); restore_fpr( 6); restore_fpr( 7);
     restore_fpr( 8); restore_fpr( 9); restore_fpr(10); restore_fpr(11);
     restore_fpr(12); restore_fpr(13); restore_fpr(14); restore_fpr(15);
     restore_fpr(16); restore_fpr(17); restore_fpr(18); restore_fpr(19);
     restore_fpr(20); restore_fpr(21); restore_fpr(22); restore_fpr(23);
     restore_fpr(24); restore_fpr(25); restore_fpr(26); restore_fpr(27);
     restore_fpr(28); restore_fpr(29); restore_fpr(30); restore_fpr(31);

     err |= __get_user(current->thread.fpu.soft.sr, &sc->sc_fpc_csr);

     return err;
}