Patchwork Cleanup ARM ioperm implementation

login
register
mail settings
Submitter Aurelien Jarno
Date Dec. 11, 2015, 10:32 p.m.
Message ID <1449873171-7158-1-git-send-email-aurelien@aurel32.net>
Download mbox | patch
Permalink /patch/9992/
State New
Headers show

Comments

Aurelien Jarno - Dec. 11, 2015, 10:32 p.m.
Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
the ARM ioperm by removing pre-2.4.23 kernel support.
---
 ChangeLog                            |  9 +++++++++
 sysdeps/unix/sysv/linux/arm/ioperm.c | 11 ++---------
 2 files changed, 11 insertions(+), 9 deletions(-)
Phil Blundell - Dec. 11, 2015, 10:37 p.m.
On Fri, 2015-12-11 at 23:32 +0100, Aurelien Jarno wrote:
> Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
> the ARM ioperm by removing pre-2.4.23 kernel support.

Looks good.  Please check that in.

p.
arnd@arndb.de - Dec. 11, 2015, 11:06 p.m.
On Friday 11 December 2015 23:32:51 Aurelien Jarno wrote:
> Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
> the ARM ioperm by removing pre-2.4.23 kernel support.
> ---
>  ChangeLog                            |  9 +++++++++
>  sysdeps/unix/sysv/linux/arm/ioperm.c | 11 ++---------
>  2 files changed, 11 insertions(+), 9 deletions(-)

The patch looks fine, but I found something else about the code here:

I notice that the contents of that file only deal with a single ARMv4
platform, and very few of those machines are still in use with
new software.

Would it make sense to build this code only when targeting an ARMv4
system, as opposed to ARMv5 or ARMv7?

	Arnd
Aurelien Jarno - Dec. 12, 2015, 11:01 a.m.
On 2015-12-12 00:06, Arnd Bergmann wrote:
> On Friday 11 December 2015 23:32:51 Aurelien Jarno wrote:
> > Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
> > the ARM ioperm by removing pre-2.4.23 kernel support.
> > ---
> >  ChangeLog                            |  9 +++++++++
> >  sysdeps/unix/sysv/linux/arm/ioperm.c | 11 ++---------
> >  2 files changed, 11 insertions(+), 9 deletions(-)
> 
> The patch looks fine, but I found something else about the code here:
> 
> I notice that the contents of that file only deal with a single ARMv4
> platform, and very few of those machines are still in use with
> new software.
> 
> Would it make sense to build this code only when targeting an ARMv4
> system, as opposed to ARMv5 or ARMv7?

The functions provided by this file (ioperm, iopl, in{b,w,l} and
out{b,w,l}) are part of the ABI and can't be removed. If we don't compile
this file, we should at least provide stubs functions which always fail.

Note also that the libc configure script currently does not try to detect
anything below ARMv6 and considers everything below it as "default".
Aurelien Jarno - Dec. 12, 2015, 11:02 a.m.
On 2015-12-11 22:37, Phil Blundell wrote:
> On Fri, 2015-12-11 at 23:32 +0100, Aurelien Jarno wrote:
> > Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
> > the ARM ioperm by removing pre-2.4.23 kernel support.
> 
> Looks good.  Please check that in.

Thanks for the review, I have just pushed the change.

Patch

diff --git a/ChangeLog b/ChangeLog
index 4bda934..13be8a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@ 
+2015-12-11  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/unix/sysv/linux/arm/ioperm.c: Do not include
+	<linux/version.h>.
+	[LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,23)]: Remove
+	conditional code.
+	(init_iosys): Use CTL_BUS_ISA instead of BUS_ISA in iobase_name
+	and ioshift_name initialization.
+
 2015-12-11  Steve Ellcey  <sellcey@imgtec.com>
 
 	* sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f):
diff --git a/sysdeps/unix/sysv/linux/arm/ioperm.c b/sysdeps/unix/sysv/linux/arm/ioperm.c
index 2291def..053d53b 100644
--- a/sysdeps/unix/sysv/linux/arm/ioperm.c
+++ b/sysdeps/unix/sysv/linux/arm/ioperm.c
@@ -43,7 +43,6 @@ 
 #include <sys/types.h>
 #include <sys/mman.h>
 
-#include <linux/version.h>
 #include <sys/sysctl.h>
 
 #define PATH_ARM_SYSTYPE	"/etc/arm_systype"
@@ -94,19 +93,13 @@  static struct platform {
  *    values.
  */
 
-/* The Linux kernel headers renamed this constant between 2.5.26 and
-   2.5.27.  It was backported to 2.4 between 2.4.22 and 2.4.23.  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,23)
-# define BUS_ISA CTL_BUS_ISA
-#endif
-
 static int
 init_iosys (void)
 {
   char systype[256];
   int i, n;
-  static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
-  static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
+  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);
 
   if (! __sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)