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: