Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/arch/amd64 Use the default %cs, and mask th...



details:   https://anonhg.NetBSD.org/src/rev/c8b0e2db4ee1
branches:  trunk
changeset: 358477:c8b0e2db4ee1
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Jan 01 08:03:43 2018 +0000

description:
Use the default %cs, and mask the other segregs.

diffstat:

 sys/compat/linux/arch/amd64/linux_machdep.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r aee9beca09d9 -r c8b0e2db4ee1 sys/compat/linux/arch/amd64/linux_machdep.c
--- a/sys/compat/linux/arch/amd64/linux_machdep.c       Mon Jan 01 06:34:13 2018 +0000
+++ b/sys/compat/linux/arch/amd64/linux_machdep.c       Mon Jan 01 08:03:43 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_machdep.c,v 1.55 2017/10/21 07:24:26 maxv Exp $ */
+/*     $NetBSD: linux_machdep.c,v 1.56 2018/01/01 08:03:43 maxv Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.55 2017/10/21 07:24:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.56 2018/01/01 08:03:43 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -205,9 +205,9 @@
        sigframe.uc.luc_mcontext.rsp = tf->tf_rsp;
        sigframe.uc.luc_mcontext.rip = tf->tf_rip;
        sigframe.uc.luc_mcontext.eflags = tf->tf_rflags;
-       sigframe.uc.luc_mcontext.cs = tf->tf_cs;
-       sigframe.uc.luc_mcontext.gs = tf->tf_gs;
-       sigframe.uc.luc_mcontext.fs = tf->tf_fs;
+       sigframe.uc.luc_mcontext.cs = GSEL(GUCODE_SEL, SEL_UPL);
+       sigframe.uc.luc_mcontext.gs = tf->tf_gs & 0xFFFF;
+       sigframe.uc.luc_mcontext.fs = tf->tf_fs & 0xFFFF;
        sigframe.uc.luc_mcontext.err = tf->tf_err;
        sigframe.uc.luc_mcontext.trapno = tf->tf_trapno;
        native_to_linux_sigset(&lmask, mask);



Home | Main Index | Thread Index | Old Index