[PATCH] fpu enabling/disabling in ptrace.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I think the original intention is to enable FPU, read the
FPU id register and restore original FPU state.  Unfortnately
restore_flags() does not achieve it.

Following patch fixes that.  Applies to both 2.4 and 2.5 branch.

Jun

P.S., I am still waiting for comments or check-in of the following
patches:

020417.kgdb-compile-warning.patch
020722.malta-kgdb
020826.swarm-rtc-m41t81.patch
diff -Nru link/arch/mips/kernel/ptrace.c.orig link/arch/mips/kernel/ptrace.c
--- link/arch/mips/kernel/ptrace.c.orig	Fri Aug  9 09:38:10 2002
+++ link/arch/mips/kernel/ptrace.c	Mon Sep 16 14:22:27 2002
@@ -168,10 +168,10 @@
 				break;
 			}
 
-			__save_flags(flags);
+			flags = read_32bit_cp0_register(CP0_STATUS);
 			__enable_fpu();
 			__asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
-			__restore_flags(flags);
+			write_32bit_cp0_register(CP0_STATUS, flags);
 			break;
 		}
 		default:
diff -Nru link/arch/mips64/kernel/ptrace.c.orig link/arch/mips64/kernel/ptrace.c
--- link/arch/mips64/kernel/ptrace.c.orig	Fri Aug  9 09:38:19 2002
+++ link/arch/mips64/kernel/ptrace.c	Mon Sep 16 14:24:02 2002
@@ -165,10 +165,10 @@
 			break;
 		case FPC_EIR: { /* implementation / version register */
 			unsigned int flags;
-			__save_flags(flags);
+			flags = read_32bit_cp0_register(CP0_STATUS);
 			__enable_fpu();
 			__asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
-			__restore_flags(flags);
+			write_32bit_cp0_register(CP0_STATUS, flags);
 			break;
 		}
 		default:

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux