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 Style.



details:   https://anonhg.NetBSD.org/src/rev/17d8eeae0671
branches:  trunk
changeset: 460674:17d8eeae0671
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Oct 30 16:32:04 2019 +0000

description:
Style.

diffstat:

 sys/arch/x86/x86/fpu.c |  51 +++++++++++++++++++++++--------------------------
 1 files changed, 24 insertions(+), 27 deletions(-)

diffs (95 lines):

diff -r cc47b3220643 -r 17d8eeae0671 sys/arch/x86/x86/fpu.c
--- a/sys/arch/x86/x86/fpu.c    Wed Oct 30 16:00:13 2019 +0000
+++ b/sys/arch/x86/x86/fpu.c    Wed Oct 30 16:32:04 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.58 2019/10/12 06:31:04 maxv Exp $    */
+/*     $NetBSD: fpu.c,v 1.59 2019/10/30 16:32:04 maxv Exp $    */
 
 /*
  * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.58 2019/10/12 06:31:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.59 2019/10/30 16:32:04 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -784,16 +784,15 @@
        xstate->xs_xstate_bv = fpu_save->sv_xsave_hdr.xsh_xstate_bv;
        KASSERT(!(xstate->xs_xstate_bv & ~xstate->xs_rfbm));
 
-#define COPY_COMPONENT(xcr0_val, xsave_val, field)                             \
-       if (xstate->xs_xstate_bv & xcr0_val) {                                  \
-               KASSERT(x86_xsave_offsets[xsave_val]                            \
-                   >= sizeof(struct xsave_header));                            \
-               KASSERT(x86_xsave_sizes[xsave_val]                              \
-                   >= sizeof(xstate -> field));                                \
-                                                                               \
-               memcpy(&xstate -> field,                                        \
-                   (char*)fpu_save + x86_xsave_offsets[xsave_val],             \
-                   sizeof(xstate -> field));                                   \
+#define COPY_COMPONENT(xcr0_val, xsave_val, field)                     \
+       if (xstate->xs_xstate_bv & xcr0_val) {                          \
+               KASSERT(x86_xsave_offsets[xsave_val]                    \
+                   >= sizeof(struct xsave_header));                    \
+               KASSERT(x86_xsave_sizes[xsave_val]                      \
+                   >= sizeof(xstate->field));                          \
+               memcpy(&xstate->field,                                  \
+                   (char*)fpu_save + x86_xsave_offsets[xsave_val],     \
+                   sizeof(xstate->field));                             \
        }
 
        COPY_COMPONENT(XCR0_YMM_Hi128, XSAVE_YMM_Hi128, xs_ymm_hi128);
@@ -846,8 +845,8 @@
        /* If XSAVE is supported, make sure that xstate_bv is set correctly. */
        if (x86_fpu_save >= FPU_SAVE_XSAVE) {
                /*
-                * Bit-wise xstate->xs_rfbm ? xstate->xs_xstate_bv
-                *                          : fpu_save->sv_xsave_hdr.xsh_xstate_bv
+                * Bit-wise "xstate->xs_rfbm ? xstate->xs_xstate_bv :
+                *           fpu_save->sv_xsave_hdr.xsh_xstate_bv"
                 */
                fpu_save->sv_xsave_hdr.xsh_xstate_bv =
                    (fpu_save->sv_xsave_hdr.xsh_xstate_bv & ~xstate->xs_rfbm) |
@@ -865,8 +864,8 @@
        }
 
        /*
-        * Copy MXCSR if either SSE or AVX state is requested, to match the XSAVE
-        * behavior for those flags.
+        * Copy MXCSR if either SSE or AVX state is requested, to match the
+        * XSAVE behavior for those flags.
         */
        if (xstate->xs_xstate_bv & (XCR0_SSE|XCR0_YMM_Hi128)) {
                /*
@@ -880,19 +879,17 @@
 
        if (xstate->xs_xstate_bv & XCR0_SSE) {
                memcpy(&fpu_save->sv_xsave_hdr.xsh_fxsave[160],
-                   xstate->xs_fxsave.fx_xmm,
-                   sizeof(xstate->xs_fxsave.fx_xmm));
+                   xstate->xs_fxsave.fx_xmm, sizeof(xstate->xs_fxsave.fx_xmm));
        }
 
-#define COPY_COMPONENT(xcr0_val, xsave_val, field)                             \
-       if (xstate->xs_xstate_bv & xcr0_val) {                                  \
-               KASSERT(x86_xsave_offsets[xsave_val]                            \
-                   >= sizeof(struct xsave_header));                            \
-               KASSERT(x86_xsave_sizes[xsave_val]                              \
-                   >= sizeof(xstate -> field));                                \
-                                                                               \
-               memcpy((char*)fpu_save + x86_xsave_offsets[xsave_val],          \
-                   &xstate -> field, sizeof(xstate -> field));         \
+#define COPY_COMPONENT(xcr0_val, xsave_val, field)                     \
+       if (xstate->xs_xstate_bv & xcr0_val) {                          \
+               KASSERT(x86_xsave_offsets[xsave_val]                    \
+                   >= sizeof(struct xsave_header));                    \
+               KASSERT(x86_xsave_sizes[xsave_val]                      \
+                   >= sizeof(xstate->field));                          \
+               memcpy((char *)fpu_save + x86_xsave_offsets[xsave_val], \
+                   &xstate->field, sizeof(xstate->field));             \
        }
 
        COPY_COMPONENT(XCR0_YMM_Hi128, XSAVE_YMM_Hi128, xs_ymm_hi128);



Home | Main Index | Thread Index | Old Index