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

Bug#637424: Implement i386_get_gsbase i386_get_fsbase i386_set_gsbase i386_set_fsbase amd64_get_gsbase amd64_get_fsbase amd64_set_gsbase amd64_set_fsbase



2011/8/11 Robert Millan <rmh@debian.org>:
> 2011/8/11 Aurelien Jarno <aurelien@aurel32.net>:
>> In any case, they will have to wait for 2.14. Anyway, what are the uses
>> cases for these?
>
> wine needs amd64_set_gsbase and i386_set_fsbase.

Here's a new patch which only implements the syscall stubs needed by
wine (amd64_set_gsbase and i386_set_fsbase).

This patch also corrects a critical mistake: in setters, the pointers
are passed by reference just like with getters (this confusion led me
to report non-bug #637528, more details there).

-- 
Robert Millan
Index: i386/Makefile
===================================================================
--- i386/Makefile	(revision 3681)
+++ i386/Makefile	(working copy)
@@ -15,5 +15,5 @@
 # For <sys/vm86.h>.
 sysdep_routines += i386_vm86
 # For <machine/sysarch.h>.
-sysdep_routines += i386_get_ldt i386_set_ldt
+sysdep_routines += i386_get_ldt i386_set_ldt i386_set_fsbase
 endif
Index: i386/Versions
===================================================================
--- i386/Versions	(revision 3681)
+++ i386/Versions	(working copy)
@@ -4,4 +4,7 @@
     ioperm; iopl;
     i386_get_ldt; i386_set_ldt;
   }
+  GLIBC_2.13 {
+    i386_set_fsbase;
+  }
 }
Index: i386/i386_set_fsbase.c
===================================================================
--- i386/i386_set_fsbase.c	(revision 0)
+++ i386/i386_set_fsbase.c	(revision 0)
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <machine/sysarch.h>
+
+int
+i386_set_fsbase (void *addr)
+{
+  return __sysarch (I386_SET_FSBASE, &addr);
+}
Index: x86_64/Makefile
===================================================================
--- x86_64/Makefile	(revision 3681)
+++ x86_64/Makefile	(working copy)
@@ -14,4 +14,6 @@
 ifeq ($(subdir),misc)
 # For <sys/io.h> and <sys/perm.h>.
 sysdep_routines += iopl ioperm
+# For <machine/sysarch.h>.
+sysdep_routines += amd64_set_gsbase
 endif
Index: x86_64/amd64_set_gsbase.c
===================================================================
--- x86_64/amd64_set_gsbase.c	(revision 0)
+++ x86_64/amd64_set_gsbase.c	(revision 0)
@@ -0,0 +1,25 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <machine/sysarch.h>
+
+int
+amd64_set_gsbase (void *addr)
+{
+  return __sysarch (AMD64_SET_GSBASE, &addr);
+}
Index: x86_64/Versions
===================================================================
--- x86_64/Versions	(revision 3681)
+++ x86_64/Versions	(working copy)
@@ -5,4 +5,7 @@
   GLIBC_2.10 {
     ioperm;
   }
+  GLIBC_2.13 {
+    amd64_set_gsbase;
+  }
 }

Reply to: