[Glibc-bsd-commits] r5281 - in trunk/freebsd-glue: debian src/freebsd-glue
rmh at alioth.debian.org
rmh at alioth.debian.org
Thu Jan 2 15:02:26 UTC 2014
Author: rmh
Date: 2014-01-02 15:02:26 +0000 (Thu, 02 Jan 2014)
New Revision: 5281
Added:
trunk/freebsd-glue/src/freebsd-glue/sysarch.c
Modified:
trunk/freebsd-glue/debian/changelog
trunk/freebsd-glue/debian/copyright
trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols
trunk/freebsd-glue/src/freebsd-glue/Makefile
Log:
Add a few sysarch-based functions: amd64_get_fsbase, amd64_get_gsbase, amd64_set_fsbase, amd64_set_gsbase, i386_get_fsbase, i386_get_gsbase, i386_set_fsbase and i386_set_gsbase.
Modified: trunk/freebsd-glue/debian/changelog
===================================================================
--- trunk/freebsd-glue/debian/changelog 2014-01-02 12:56:00 UTC (rev 5280)
+++ trunk/freebsd-glue/debian/changelog 2014-01-02 15:02:26 UTC (rev 5281)
@@ -5,6 +5,10 @@
fmtree).
* Add wrapper for bmake (force it to use /usr/share/mk-freebsd instead
of its own /usr/share/mk).
+ * Add a few sysarch-based functions: amd64_get_fsbase,
+ amd64_get_gsbase, amd64_set_fsbase, amd64_set_gsbase,
+ i386_get_fsbase, i386_get_gsbase, i386_set_fsbase and
+ i386_set_gsbase.
-- Robert Millan <rmh at debian.org> Sun, 29 Dec 2013 20:44:42 +0100
Modified: trunk/freebsd-glue/debian/copyright
===================================================================
--- trunk/freebsd-glue/debian/copyright 2014-01-02 12:56:00 UTC (rev 5280)
+++ trunk/freebsd-glue/debian/copyright 2014-01-02 15:02:26 UTC (rev 5281)
@@ -31,6 +31,10 @@
Copyright: 2013, Robert Millan <rmh at debian.org>
License: BSD (2 clause)
+Files: src/freebsd-glue/sysarch.c
+Copyright: 2014, Robert Millan <rmh at debian.org>
+License: BSD (2 clause)
+
Files: include/sys/endian.h
Copyright: 2002, Thomas Moestl <tmm at FreeBSD.org>
License: BSD (2 clause)
Modified: trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols
===================================================================
--- trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols 2014-01-02 12:56:00 UTC (rev 5280)
+++ trunk/freebsd-glue/debian/libfreebsd-glue-0.symbols 2014-01-02 15:02:26 UTC (rev 5281)
@@ -1,4 +1,12 @@
libfreebsd-glue.so.0 libfreebsd-glue-0 #MINVER#
+ (arch=kfreebsd-amd64)amd64_get_fsbase at Base 0.2.8
+ (arch=kfreebsd-amd64)amd64_get_gsbase at Base 0.2.8
+ (arch=kfreebsd-amd64)amd64_set_fsbase at Base 0.2.8
+ (arch=kfreebsd-amd64)amd64_set_gsbase at Base 0.2.8
+ (arch=kfreebsd-i386)i386_get_fsbase at Base 0.2.8
+ (arch=kfreebsd-i386)i386_get_gsbase at Base 0.2.8
+ (arch=kfreebsd-i386)i386_set_fsbase at Base 0.2.8
+ (arch=kfreebsd-i386)i386_set_gsbase at Base 0.2.8
(arch=kfreebsd-any)bsd_sendfile at Base 0.2.6
cgetcap at Base 0.1.15
cgetclose at Base 0.1.15
Modified: trunk/freebsd-glue/src/freebsd-glue/Makefile
===================================================================
--- trunk/freebsd-glue/src/freebsd-glue/Makefile 2014-01-02 12:56:00 UTC (rev 5280)
+++ trunk/freebsd-glue/src/freebsd-glue/Makefile 2014-01-02 15:02:26 UTC (rev 5281)
@@ -25,6 +25,7 @@
mac_set.c \
socket.c \
sendfile.c \
+ sysarch.c \
${NULL}
.endif
Added: trunk/freebsd-glue/src/freebsd-glue/sysarch.c
===================================================================
--- trunk/freebsd-glue/src/freebsd-glue/sysarch.c (rev 0)
+++ trunk/freebsd-glue/src/freebsd-glue/sysarch.c 2014-01-02 15:02:26 UTC (rev 5281)
@@ -0,0 +1,79 @@
+/*-
+ * Copyright (c) 2014 Robert Millan <rmh at debian.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <machine/sysarch.h>
+
+#if defined(__amd64__)
+int
+amd64_get_fsbase (void **addr)
+{
+ return sysarch (AMD64_GET_FSBASE, addr);
+}
+
+int
+amd64_get_gsbase (void **addr)
+{
+ return sysarch (AMD64_GET_GSBASE, addr);
+}
+
+int
+amd64_set_fsbase (void *addr)
+{
+ return sysarch (AMD64_SET_FSBASE, &addr);
+}
+
+int
+amd64_set_gsbase (void *addr)
+{
+ return sysarch (AMD64_SET_GSBASE, &addr);
+}
+
+#elif defined(__i386__)
+
+int
+i386_get_fsbase (void **addr)
+{
+ return sysarch (I386_GET_FSBASE, addr);
+}
+
+int
+i386_get_gsbase (void **addr)
+{
+ return sysarch (I386_GET_GSBASE, addr);
+}
+
+int
+i386_set_fsbase (void *addr)
+{
+ return sysarch (I386_SET_FSBASE, &addr);
+}
+
+int
+i386_set_gsbase (void *addr)
+{
+ return sysarch (I386_SET_GSBASE, &addr);
+}
+#endif
More information about the Glibc-bsd-commits
mailing list