linux-mips
[Top] [All Lists]

FP handling in signal.c and traps.c (was Re: FP Emulator Patch)

To: "MIPS/Linux List \(SGI\)" <linux-mips@oss.sgi.com>
Subject: FP handling in signal.c and traps.c (was Re: FP Emulator Patch)
From: "Kevin D. Kissell" <kevink@mips.com>
Date: Fri, 17 Aug 2001 22:56:02 +0200
Sender: owner-linux-mips@oss.sgi.com
I attach a diff relative to the current OSS repository for a proposed
patch to fix the signal holes discussed over the past few days.
This *exact* patch has not been tested, since the sources are too
new to be compatible with any kernel that will read my accursed
hard drive, so you are taking your life in your hands with it, but
it is substantially similar to the version I posted yesterday that
worked perfectly - but had the conceptual hole if a signal
handler that acquired the FPU got switched out.   I've got
a plane to catch in the morning and can't spend any more
time on it, but it should at least give people something to
talk about - and something similar to it really should be
(IMHO) the correct approach.  It will slow down the signal
dispatch, without a doubt, but we should stop losing FP
state altogether.  I also fixed what looked to be a bug
in the handling of Hi and Lo in the sigcontext restore.
The code as written would certainly have worked in
big-endian code, but I believe that in little endian it could
have trashed both registers.

A note to Jun Sun about clearing the used_math flag
before launching a signal handler: consider what happens
to ptrace if the signal handler hits a breakpoint without
executing any FP instructions.  My code saves and
restores it with the sigcontext.  If the signal handler
acquires the FPU, but the application has not otherwise
used FP, it will be cleared as part of that restore.

I pass the torch, and hope for the best...

            Regards,

            Kevin K.

Attachment: cvsdiff
Description: Binary data

<Prev in Thread] Current Thread [Next in Thread>