patch-2.2.8 linux/include/asm-alpha/fpu.h

Next file: linux/include/asm-alpha/pgtable.h
Previous file: linux/fs/vfat/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.7/linux/include/asm-alpha/fpu.h linux/include/asm-alpha/fpu.h
@@ -81,6 +81,18 @@
 	return fp;
 }
 
+static inline unsigned long
+ieee_fpcr_to_swcr(unsigned long fp)
+{
+	unsigned long sw;
+	sw = (fp >> 35) & IEEE_STATUS_MASK;
+	sw |= (~fp >> 48) & (IEEE_TRAP_ENABLE_INV
+			     | IEEE_TRAP_ENABLE_DZE
+			     | IEEE_TRAP_ENABLE_OVF);
+	sw |= (~fp >> 57) & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE);
+	return sw;
+}
+
 #ifdef __KERNEL__
 
 /* The following two functions don't need trapb/excb instructions

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)