Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include <linux/types.h>
0003 #include <linux/errno.h>
0004 #include <linux/uaccess.h>
0005 
0006 #include <asm/sfp-machine.h>
0007 #include <math-emu/soft-fp.h>
0008 
0009 int
0010 mtfsfi(unsigned int crfD, unsigned int IMM)
0011 {
0012     u32 mask = 0xf;
0013 
0014     if (!crfD)
0015         mask = 9;
0016 
0017     __FPU_FPSCR &= ~(mask << ((7 - crfD) << 2));
0018     __FPU_FPSCR |= (IMM & 0xf) << ((7 - crfD) << 2);
0019 
0020 #ifdef DEBUG
0021     printk("%s: %d %x: %08lx\n", __func__, crfD, IMM, __FPU_FPSCR);
0022 #endif
0023 
0024     return 0;
0025 }