[Glibc-bsd-commits] r2623 - in trunk/glibc-ports/kfreebsd/x86_64: . sys

Aurelien Jarno aurel32 at alioth.debian.org
Sat Jul 11 17:44:15 UTC 2009


Author: aurel32
Date: 2009-07-11 17:44:14 +0000 (Sat, 11 Jul 2009)
New Revision: 2623

Added:
   trunk/glibc-ports/kfreebsd/x86_64/ioperm.c
Modified:
   trunk/glibc-ports/kfreebsd/x86_64/Makefile
   trunk/glibc-ports/kfreebsd/x86_64/Versions
   trunk/glibc-ports/kfreebsd/x86_64/sys/io.h
   trunk/glibc-ports/kfreebsd/x86_64/sys/perm.h
Log:
Add support for ioperm() on kfreebsd-amd64 (FreeBSD 8.0 needed)


Modified: trunk/glibc-ports/kfreebsd/x86_64/Makefile
===================================================================
--- trunk/glibc-ports/kfreebsd/x86_64/Makefile	2009-07-11 17:41:24 UTC (rev 2622)
+++ trunk/glibc-ports/kfreebsd/x86_64/Makefile	2009-07-11 17:44:14 UTC (rev 2623)
@@ -13,5 +13,5 @@
 
 ifeq ($(subdir),misc)
 # For <sys/io.h> and <sys/perm.h>.
-sysdep_routines += iopl
+sysdep_routines += iopl ioperm
 endif

Modified: trunk/glibc-ports/kfreebsd/x86_64/Versions
===================================================================
--- trunk/glibc-ports/kfreebsd/x86_64/Versions	2009-07-11 17:41:24 UTC (rev 2622)
+++ trunk/glibc-ports/kfreebsd/x86_64/Versions	2009-07-11 17:44:14 UTC (rev 2623)
@@ -2,4 +2,7 @@
   GLIBC_2.3.4 {
     iopl;
   }
+  GLIBC_2.10 {
+    ioperm;
+  }
 }

Added: trunk/glibc-ports/kfreebsd/x86_64/ioperm.c
===================================================================
--- trunk/glibc-ports/kfreebsd/x86_64/ioperm.c	                        (rev 0)
+++ trunk/glibc-ports/kfreebsd/x86_64/ioperm.c	2009-07-11 17:44:14 UTC (rev 2623)
@@ -0,0 +1,32 @@
+/* Copyright (C) 2002 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 <sys/perm.h>
+#include <sysarch.h>
+
+int
+ioperm (unsigned long int from, unsigned long int num, int turn_on)
+{
+  struct i386_ioperm_args args;
+
+  args.start = from;
+  args.length = num;
+  args.enable = turn_on;
+
+  return __sysarch (I386_SET_IOPERM, &args);
+}

Modified: trunk/glibc-ports/kfreebsd/x86_64/sys/io.h
===================================================================
--- trunk/glibc-ports/kfreebsd/x86_64/sys/io.h	2009-07-11 17:41:24 UTC (rev 2622)
+++ trunk/glibc-ports/kfreebsd/x86_64/sys/io.h	2009-07-11 17:44:14 UTC (rev 2623)
@@ -23,6 +23,15 @@
 
 __BEGIN_DECLS
 
+/* If TURN_ON is TRUE, request for permission to do direct i/o on the
+   port numbers in the range [FROM,FROM+NUM-1].  Otherwise, turn I/O
+   permission off for that range.  This call requires root privileges.
+
+   Portability note: not all kFreeBSD platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however. */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+                   int __turn_on) __THROW;
+
 /* Set the I/O privilege level to LEVEL.  If LEVEL>3, permission to
    access any I/O port is granted.  This call requires root
    privileges. */

Modified: trunk/glibc-ports/kfreebsd/x86_64/sys/perm.h
===================================================================
--- trunk/glibc-ports/kfreebsd/x86_64/sys/perm.h	2009-07-11 17:41:24 UTC (rev 2622)
+++ trunk/glibc-ports/kfreebsd/x86_64/sys/perm.h	2009-07-11 17:44:14 UTC (rev 2623)
@@ -23,6 +23,11 @@
 
 __BEGIN_DECLS
 
+/* Set port input/output permissions.  */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+		   int __turn_on) __THROW;
+
+
 /* Change I/O privilege level.  */
 extern int iopl (int __level) __THROW;
 




More information about the Glibc-bsd-commits mailing list