mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@quark.didntduck.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] make x86 ptrace use init_fpu()
Date: Tue, 29 Oct 2002 18:56:34 -0500	[thread overview]
Message-ID: <3DBF2032.1040000@quark.didntduck.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

This fixes PTRACE_GETFPREGS to initilize the fpu struct correctly on 
cpus with fxsr, as well as removing redundant code.

--
				Brian Gerst

[-- Attachment #2: ptrace-fpu-1 --]
[-- Type: text/plain, Size: 921 bytes --]

diff -urN linux-2.5.44-bk3/arch/i386/kernel/ptrace.c linux/arch/i386/kernel/ptrace.c
--- linux-2.5.44-bk3/arch/i386/kernel/ptrace.c	Sun Sep 15 22:18:24 2002
+++ linux/arch/i386/kernel/ptrace.c	Tue Oct 29 17:04:59 2002
@@ -375,12 +375,8 @@
 			break;
 		}
 		ret = 0;
-		if ( !child->used_math ) {
-			/* Simulate an empty FPU. */
-			set_fpu_cwd(child, 0x037f);
-			set_fpu_swd(child, 0x0000);
-			set_fpu_twd(child, 0xffff);
-		}
+		if (!child->used_math)
+			init_fpu(child);
 		get_fpregs((struct user_i387_struct *)data, child);
 		break;
 	}
@@ -403,13 +399,8 @@
 			ret = -EIO;
 			break;
 		}
-		if ( !child->used_math ) {
-			/* Simulate an empty FPU. */
-			set_fpu_cwd(child, 0x037f);
-			set_fpu_swd(child, 0x0000);
-			set_fpu_twd(child, 0xffff);
-			set_fpu_mxcsr(child, 0x1f80);
-		}
+		if (!child->used_math)
+			init_fpu(child);
 		ret = get_fpxregs((struct user_fxsr_struct *)data, child);
 		break;
 	}

                 reply	other threads:[~2002-10-29 23:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DBF2032.1040000@quark.didntduck.org \
    --to=bgerst@quark.didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®