Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 Simplify.
details: https://anonhg.NetBSD.org/src/rev/479952b210eb
branches: trunk
changeset: 347218:479952b210eb
user: maxv <maxv%NetBSD.org@localhost>
date: Thu Aug 18 12:36:35 2016 +0000
description:
Simplify.
diffstat:
sys/arch/x86/x86/fpu.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diffs (67 lines):
diff -r 2a87d560e6eb -r 479952b210eb sys/arch/x86/x86/fpu.c
--- a/sys/arch/x86/x86/fpu.c Thu Aug 18 11:44:22 2016 +0000
+++ b/sys/arch/x86/x86/fpu.c Thu Aug 18 12:36:35 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu.c,v 1.10 2014/11/27 14:22:09 uebayasi Exp $ */
+/* $NetBSD: fpu.c,v 1.11 2016/08/18 12:36:35 maxv Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc. All
@@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.10 2014/11/27 14:22:09 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.11 2016/08/18 12:36:35 maxv Exp $");
#include "opt_multiprocessor.h"
@@ -550,7 +550,6 @@
union savefpu *fpu_save;
fpusave_lwp(lwp, false);
-
fpu_save = process_fpframe(lwp);
if (i386_use_fxsave) {
@@ -645,29 +644,32 @@
void
process_read_fpregs_xmm(struct lwp *lwp, struct fxsave *fpregs)
{
+ union savefpu *fpu_save;
+
fpusave_lwp(lwp, true);
+ fpu_save = process_fpframe(lwp);
if (i386_use_fxsave) {
- memcpy(fpregs, &process_fpframe(lwp)->sv_xmm,
- sizeof process_fpframe(lwp)->sv_xmm);
+ memcpy(fpregs, &fpu_save->sv_xmm, sizeof(fpu_save->sv_xmm));
} else {
/* This usually gets copied to userspace */
- memset(fpregs, 0, sizeof *fpregs);
- process_s87_to_xmm(&process_fpframe(lwp)->sv_87, fpregs);
-
+ memset(fpregs, 0, sizeof(*fpregs));
+ process_s87_to_xmm(&fpu_save->sv_87, fpregs);
}
}
void
process_read_fpregs_s87(struct lwp *lwp, struct save87 *fpregs)
{
+ union savefpu *fpu_save;
+
fpusave_lwp(lwp, true);
+ fpu_save = process_fpframe(lwp);
if (i386_use_fxsave) {
memset(fpregs, 0, 12);
- process_xmm_to_s87(&process_fpframe(lwp)->sv_xmm, fpregs);
+ process_xmm_to_s87(&fpu_save->sv_xmm, fpregs);
} else {
- memcpy(fpregs, &process_fpframe(lwp)->sv_87,
- sizeof process_fpframe(lwp)->sv_87);
+ memcpy(fpregs, &fpu_save->sv_87, sizeof(fpu_save->sv_87));
}
}
Home |
Main Index |
Thread Index |
Old Index