mtfsfi.c 425 B

123456789101112131415161718192021222324
  1. #include <linux/types.h>
  2. #include <linux/errno.h>
  3. #include <asm/uaccess.h>
  4. #include <asm/sfp-machine.h>
  5. #include <math-emu/soft-fp.h>
  6. int
  7. mtfsfi(unsigned int crfD, unsigned int IMM)
  8. {
  9. u32 mask = 0xf;
  10. if (!crfD)
  11. mask = 9;
  12. __FPU_FPSCR &= ~(mask << ((7 - crfD) << 2));
  13. __FPU_FPSCR |= (IMM & 0xf) << ((7 - crfD) << 2);
  14. #ifdef DEBUG
  15. printk("%s: %d %x: %08lx\n", __func__, crfD, IMM, __FPU_FPSCR);
  16. #endif
  17. return 0;
  18. }