This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-636-gcc42170


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  cc42170ef6ca931c7527a86f14fc66059b6dfff4 (commit)
      from  a82cd945b54958f2ee8d1503eee20fd521f1c236 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cc42170ef6ca931c7527a86f14fc66059b6dfff4

commit cc42170ef6ca931c7527a86f14fc66059b6dfff4
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Dec 29 15:27:56 2015 +0100

    Cleanup ARM ioperm implementation (step 2)
    
    Since GLIBC requires a minimum 2.6.32 kernel, the sysctl (CTL_BUS,
    CTL_BUS_ISA, ISA_*) is always available.  We can therefore remove the
    fallback code reading /etc/arm_systype or parsing /proc/cpuinfo.
    
    Remove fscanf from localplt.data as it is no longer called from within
    GLIBC.
    
    	* sysdeps/unix/sysv/linux/arm/ioperm.c: Do not include <string.h>.
    	(PATH_ARM_SYSTYPE): Remove.
    	(PATH_CPUINFO): Likewise.
    	(IO_BASE_FOOTBRIDGE): Likewise.
    	(IO_SHIFT_FOOTBRIDGE): Likewise.
    	(struct platform): Likewise.
    	(init_iosys): Remove compatibility code for 2.4 kernels.
    	* sysdeps/unix/sysv/linux/arm/localplt.data: Remove fscanf.

diff --git a/ChangeLog b/ChangeLog
index 749cc78..85d39d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-12-30  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/unix/sysv/linux/arm/ioperm.c: Do not include <string.h>.
+	(PATH_ARM_SYSTYPE): Remove.
+	(PATH_CPUINFO): Likewise.
+	(IO_BASE_FOOTBRIDGE): Likewise.
+	(IO_SHIFT_FOOTBRIDGE): Likewise.
+	(struct platform): Likewise.
+	(init_iosys): Remove compatibility code for 2.4 kernels.
+	* sysdeps/unix/sysv/linux/arm/localplt.data: Remove fscanf.
+
 2015-12-29  Florian Weimer  <fweimer@redhat.com>
 
 	* malloc/tst-malloc-thread-fail.c: New file.
diff --git a/sysdeps/unix/sysv/linux/arm/ioperm.c b/sysdeps/unix/sysv/linux/arm/ioperm.c
index 053d53b..1565008 100644
--- a/sysdeps/unix/sysv/linux/arm/ioperm.c
+++ b/sysdeps/unix/sysv/linux/arm/ioperm.c
@@ -37,7 +37,6 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
 
 #include <sys/types.h>
@@ -45,9 +44,6 @@
 
 #include <sys/sysctl.h>
 
-#define PATH_ARM_SYSTYPE	"/etc/arm_systype"
-#define PATH_CPUINFO		"/proc/cpuinfo"
-
 #define MAX_PORT	0x10000
 
 static struct {
@@ -57,47 +53,16 @@ static struct {
   unsigned int		initdone;	/* since all the above could be 0 */
 } io;
 
-#define IO_BASE_FOOTBRIDGE	0x7c000000
-#define IO_SHIFT_FOOTBRIDGE	0
-
-static struct platform {
-  const char		*name;
-  unsigned long int	io_base;
-  unsigned int		shift;
-} platform[] = {
-  /* All currently supported platforms are in fact the same. :-)  */
-  {"Chalice-CATS",	IO_BASE_FOOTBRIDGE,	IO_SHIFT_FOOTBRIDGE},
-  {"DEC-EBSA285",	IO_BASE_FOOTBRIDGE,	IO_SHIFT_FOOTBRIDGE},
-  {"Corel-NetWinder",	IO_BASE_FOOTBRIDGE,	IO_SHIFT_FOOTBRIDGE},
-  {"Rebel-NetWinder",	IO_BASE_FOOTBRIDGE,	IO_SHIFT_FOOTBRIDGE},
-};
-
 #define IO_ADDR(port)	(io.base + ((port) << io.shift))
 
 /*
- * Initialize I/O system.  There are several ways to get the information
- * we need.  Each is tried in turn until one succeeds.
- *
- * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*).  This is the preferred method
- *    but not all kernels support it.
- *
- * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
- *    - If it matches one of the entries in the table above, use the
- *      corresponding values.
- *    - If it begins with a number, assume this is a previously
- *      unsupported system and the values encode, in order,
- *      "<io_base>,<port_shift>".
- *
- * 3. Lookup the "system type" field in /proc/cpuinfo.  Again, if it
- *    matches an entry in the platform[] table, use the corresponding
- *    values.
+ * Initialize I/O system.  The io_bae and port_shift values are fetched
+ * using sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*).
  */
 
 static int
 init_iosys (void)
 {
-  char systype[256];
-  int i, n;
   static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };
   static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT };
   size_t len = sizeof(io.base);
@@ -109,61 +74,7 @@ init_iosys (void)
       return 0;
     }
 
-  n = __readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1);
-  if (n > 0)
-    {
-      systype[n] = '\0';
-      if (isdigit (systype[0]))
-	{
-	  if (sscanf (systype, "%li,%i", &io.io_base, &io.shift) == 2)
-	    {
-	      io.initdone = 1;
-	      return 0;
-	    }
-	  /* else we're likely going to fail with the system match below */
-	}
-    }
-  else
-    {
-      FILE * fp;
-
-      fp = fopen (PATH_CPUINFO, "rce");
-      if (! fp)
-	return -1;
-      while ((n = fscanf (fp, "Hardware\t: %256[^\n]\n", systype))
-	     != EOF)
-	{
-	  if (n == 1)
-	    break;
-	  else
-	    fgets_unlocked (systype, 256, fp);
-	}
-      fclose (fp);
-
-      if (n == EOF)
-	{
-	  /* this can happen if the format of /proc/cpuinfo changes...  */
-	  fprintf (stderr,
-		   "ioperm: Unable to determine system type.\n"
-		   "\t(May need " PATH_ARM_SYSTYPE " symlink?)\n");
-	  __set_errno (ENODEV);
-	  return -1;
-	}
-    }
-
-  /* translate systype name into i/o system: */
-  for (i = 0; i < sizeof (platform) / sizeof (platform[0]); ++i)
-    {
-      if (strcmp (platform[i].name, systype) == 0)
-	{
-	  io.shift = platform[i].shift;
-	  io.io_base = platform[i].io_base;
-	  io.initdone = 1;
-	  return 0;
-	}
-    }
-
-  /* systype is not a known platform name... */
+  /* sysctl has failed... */
   __set_errno (ENODEV);
   return -1;
 }
diff --git a/sysdeps/unix/sysv/linux/arm/localplt.data b/sysdeps/unix/sysv/linux/arm/localplt.data
index 26e97ff..4301703 100644
--- a/sysdeps/unix/sysv/linux/arm/localplt.data
+++ b/sysdeps/unix/sysv/linux/arm/localplt.data
@@ -1,6 +1,5 @@
 libc.so: calloc
 libc.so: free
-libc.so: fscanf
 libc.so: malloc
 libc.so: memalign
 libc.so: raise

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                 |   11 +++
 sysdeps/unix/sysv/linux/arm/ioperm.c      |   95 +----------------------------
 sysdeps/unix/sysv/linux/arm/localplt.data |    1 -
 3 files changed, 14 insertions(+), 93 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]