Skip to contentSkip to conversation

m68knommu: merge and clean up of arch/m68k/lib files

PATCH Superseded [email protected] 5 participants 21 messages Apr 20, 2011

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover m68knommu: merge and clean up of arch/m68k/lib files

The following set of patches is version 2 of clean ups and merges of individual files in the arch/m68k/lib directory. It is mostly the same as the first version, but drops the removal of string.c, and does a simple cleanup of checksum.c.

I have build and run tested on ARAnyM/Atari and ColdFire (non-mmu) targets.

#1 lore raw

v2 cover m68knommu: merge and clean up of arch/m68k/lib files

I have build and run tested on ARAnyM/Atari and ColdFire (non-mmu) targets.

#2 lore raw

PATCH v2 1/6 m68k: merge mmu and non-mmu versions of muldi3

From: Greg Ungerer <[email protected]>

The implementation of gcc's muldi3 support function differs only in the use of the machine's 64 bit sized mul or not. (It isn't based on using an MMU or not). Merge the current mmu and non-mmu versions of arc/m68k/lib/muldi3 and use the appropriate pre-processor conditionals to get the right version for all m68k processor types.

---
 arch/m68k/lib/muldi3.c    |   99 +++++++++++++++++++++++++++++++++++++++++++-
 arch/m68k/lib/muldi3_mm.c |   63 ----------------------------
 arch/m68k/lib/muldi3_no.c |   86 ---------------------------------------
 3 files changed, 96 insertions(+), 152 deletions(-)
 delete mode 100644 arch/m68k/lib/muldi3_mm.c
 delete mode 100644 arch/m68k/lib/muldi3_no.c
arch/m68k/lib/muldi3.c +96 -3
index 16e0eb3..43ac41b 100644
@@ -1,5 +1,98 @@
-#ifdef CONFIG_MMU
-#include "muldi3_mm.c"
+/* muldi3.c extracted from gcc-2.7.2.3/libgcc2.c and 
+			   gcc-2.7.2.3/longlong.h which is: */
+/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+    defined(__mc68040__) || defined(__mc68060__)
+
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("mulu%.l %3,%1:%0"						\
+           : "=d" ((USItype)(w0)),					\
+             "=d" ((USItype)(w1))					\
+           : "%0" ((USItype)(u)),					\
+             "dmi" ((USItype)(v)))
+
 #else
-#include "muldi3_no.c"
+
+#define SI_TYPE_SIZE 32
+#define __BITS4 (SI_TYPE_SIZE / 4)
+#define __ll_B (1L << (SI_TYPE_SIZE / 2))
+#define __ll_lowpart(t) ((USItype) (t) % __ll_B)
+#define __ll_highpart(t) ((USItype) (t) / __ll_B)
+
+#define umul_ppmm(w1, w0, u, v)						\
+  do {									\
+    USItype __x0, __x1, __x2, __x3;					\
+    USItype __ul, __vl, __uh, __vh;					\
+									\
+    __ul = __ll_lowpart (u);						\
+    __uh = __ll_highpart (u);						\
+    __vl = __ll_lowpart (v);						\
+    __vh = __ll_highpart (v);						\
+									\
+    __x0 = (USItype) __ul * __vl;					\
+    __x1 = (USItype) __ul * __vh;					\
+    __x2 = (USItype) __uh * __vl;					\
+    __x3 = (USItype) __uh * __vh;					\
+									\
+    __x1 += __ll_highpart (__x0);/* this can't give carry */		\
+    __x1 += __x2;		/* but this indeed can */		\
+    if (__x1 < __x2)		/* did we get it? */			\
+      __x3 += __ll_B;		/* yes, add it in the proper pos. */	\
+									\
+    (w1) = __x3 + __ll_highpart (__x1);					\
+    (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0);		\
+  } while (0)
+
 #endif
+
+#define __umulsidi3(u, v) \
+  ({DIunion __w;							\
+    umul_ppmm (__w.s.high, __w.s.low, u, v);				\
+    __w.ll; })
+
+typedef 	 int SItype	__attribute__ ((mode (SI)));
+typedef unsigned int USItype	__attribute__ ((mode (SI)));
+typedef		 int DItype	__attribute__ ((mode (DI)));
+typedef int word_type __attribute__ ((mode (__word__)));
+
+struct DIstruct {SItype high, low;};
+
+typedef union
+{
+  struct DIstruct s;
+  DItype ll;
+} DIunion;
+
+DItype
+__muldi3 (DItype u, DItype v)
+{
+  DIunion w;
+  DIunion uu, vv;
+
+  uu.ll = u,
+  vv.ll = v;
+
+  w.ll = __umulsidi3 (uu.s.low, vv.s.low);
+  w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high
+	       + (USItype) uu.s.high * (USItype) vv.s.low);
+
+  return w.ll;
+}
arch/m68k/lib/muldi3_mm.c deleted +0 -63

63 lines not on this page · raw message

arch/m68k/lib/muldi3_no.c deleted +0 -86

86 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#3 lore raw

PATCH v2 2/6 m68k: merge mmu and non-mmu versions of lib/Makefile

From: Greg Ungerer <[email protected]>

We can easily support the slight differences in libs needed by the mmu and non-mmu builds in a single Makefile, so merge them back into a single file again.

---
 arch/m68k/lib/Makefile    |   13 +++++++++++--
 arch/m68k/lib/Makefile_mm |    6 ------
 arch/m68k/lib/Makefile_no |    7 -------
 3 files changed, 11 insertions(+), 15 deletions(-)
 delete mode 100644 arch/m68k/lib/Makefile_mm
 delete mode 100644 arch/m68k/lib/Makefile_no
arch/m68k/lib/Makefile +11 -2
index 1f95881..3d85fb6 100644
@@ -1,5 +1,14 @@
+
+#
+# Makefile for m68k-specific library files..
+#
+
+lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o checksum.o
+
 ifdef CONFIG_MMU
-include arch/m68k/lib/Makefile_mm
+lib-y	+= string.o uaccess.o
 else
-include arch/m68k/lib/Makefile_no
+lib-y	+= mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
+	   memcpy.o memmove.o memset.o delay.o
 endif
+
arch/m68k/lib/Makefile_mm deleted +0 -6
deleted file mode 100644
index af9abf8..0000000
@@ -1,6 +0,0 @@
-#
-# Makefile for m68k-specific library files..
-#
-
-lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
-	   checksum.o string.o uaccess.o
arch/m68k/lib/Makefile_no deleted +0 -7
deleted file mode 100644
index 32d852e..0000000
@@ -1,7 +0,0 @@
-#
-# Makefile for m68knommu specific library files..
-#
-
-lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o \
-	   muldi3.o mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
-	   checksum.o memcpy.o memmove.o memset.o delay.o
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH v2 3/6 m68k: remove duplicate memmove() implementation

From: Greg Ungerer <[email protected]>

Merging the mmu and non-mmu directories we ended up with duplicate (and identical) implementations of memmove(). Remove one of them.

---
 arch/m68k/lib/Makefile  |    4 +-
 arch/m68k/lib/memmove.c |    2 -
 arch/m68k/lib/string.c  |   95 -----------------------------------------------
 3 files changed, 2 insertions(+), 99 deletions(-)
arch/m68k/lib/Makefile +2 -2
index 3d85fb6..ec479a9 100644
@@ -3,12 +3,12 @@
 # Makefile for m68k-specific library files..
 #
 
-lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o checksum.o
+lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o memmove.o checksum.o
 
 ifdef CONFIG_MMU
 lib-y	+= string.o uaccess.o
 else
 lib-y	+= mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
-	   memcpy.o memmove.o memset.o delay.o
+	   memcpy.o memset.o delay.o
 endif
 
arch/m68k/lib/memmove.c +0 -2
index b3dcfe9..6519f7f 100644
@@ -4,8 +4,6 @@
  * for more details.
  */
 
-#define __IN_STRING_C
-
 #include <linux/module.h>
 #include <linux/string.h>
 
arch/m68k/lib/string.c +0 -95

98 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#5 lore raw

PATCH v2 4/6 m68k: remove duplicate memset() implementation

From: Greg Ungerer <[email protected]>

Merging the mmu and non-mmu directories we ended up with duplicate implementations of memset(). One is a little more optimized for the

Quoted 1 line

68020 case, but that can easily be inserted into a single

implementation of memset(). Clean up the exporting of this symbol too, otherwise we end up exporting it twice on a no-mmu build.

---
 arch/m68k/kernel/m68k_ksyms_no.c |    1 -
 arch/m68k/lib/Makefile           |    5 +-
 arch/m68k/lib/memset.c           |  114 +++++++++++++++++++++++--------------
 arch/m68k/lib/string.c           |   61 --------------------
 4 files changed, 74 insertions(+), 107 deletions(-)
arch/m68k/kernel/m68k_ksyms_no.c +0 -1
index 39fe0a7..346bce6 100644
@@ -36,7 +36,6 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck);
    their interface isn't gonna change any time soon now, so
    it's OK to leave it out of version control.  */
 EXPORT_SYMBOL(memcpy);
-EXPORT_SYMBOL(memset);
 
 /*
  * libgcc functions - functions that are used internally by the
arch/m68k/lib/Makefile +3 -2
index ec479a9..ac275d5 100644
@@ -3,12 +3,13 @@
 # Makefile for m68k-specific library files..
 #
 
-lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o memmove.o checksum.o
+lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
+	   memset.o memmove.o checksum.o
 
 ifdef CONFIG_MMU
 lib-y	+= string.o uaccess.o
 else
 lib-y	+= mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
-	   memcpy.o memset.o delay.o
+	   memcpy.o delay.o
 endif
 
arch/m68k/lib/memset.c +71 -43

118 lines not on this page · raw message

arch/m68k/lib/string.c +0 -61

67 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#6 lore raw

PATCH v2 5/6 m68k: remove duplicate memcpy() implementation

From: Greg Ungerer <[email protected]>

Merging the mmu and non-mmu directories we ended up with duplicate implementations of memcpy(). One is a little more optimized for the

Quoted 1 line

68020 case, but that can easily be inserted into a single

implementation of memcpy(). Clean up the exporting of this symbol too, otherwise we end up exporting it twice on a no-mmu build.

---
 arch/m68k/kernel/m68k_ksyms_no.c |    6 --
 arch/m68k/lib/Makefile           |    5 +-
 arch/m68k/lib/memcpy.c           |  128 +++++++++++++++++++++----------------
 arch/m68k/lib/string.c           |   67 --------------------
 4 files changed, 75 insertions(+), 131 deletions(-)
arch/m68k/kernel/m68k_ksyms_no.c +0 -6
index 346bce6..10af0af 100644
@@ -31,12 +31,6 @@ EXPORT_SYMBOL(kernel_thread);
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_nocheck);
 
-/* The following are special because they're not called
-   explicitly (the C compiler generates them).  Fortunately,
-   their interface isn't gonna change any time soon now, so
-   it's OK to leave it out of version control.  */
-EXPORT_SYMBOL(memcpy);
-
 /*
  * libgcc functions - functions that are used internally by the
  * compiler...  (prototypes are not correct though, but that
arch/m68k/lib/Makefile +2 -3
index ac275d5..2438d02 100644
@@ -4,12 +4,11 @@
 #
 
 lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
-	   memset.o memmove.o checksum.o
+	   memcpy.o memset.o memmove.o checksum.o
 
 ifdef CONFIG_MMU
 lib-y	+= string.o uaccess.o
 else
-lib-y	+= mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
-	   memcpy.o delay.o
+lib-y	+= mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o delay.o
 endif
 
arch/m68k/lib/memcpy.c +73 -55

135 lines not on this page · raw message

arch/m68k/lib/string.c +0 -67

70 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#7 lore raw

PATCH v2 6/6 m68k: let Makefile sort out compiling mmu and non-mmu lib/checksum.c

From: Greg Ungerer <[email protected]>

We don't need an arch/m68k/lib/checksum.c wrapper to include the correct mmu or non-mmu version of the checksum code. Let the Makefile just build the appropriate one.

---
 arch/m68k/lib/Makefile   |    6 +++---
 arch/m68k/lib/checksum.c |    5 -----
 2 files changed, 3 insertions(+), 8 deletions(-)
 delete mode 100644 arch/m68k/lib/checksum.c
arch/m68k/lib/Makefile +3 -3
index 2438d02..df421e5 100644
@@ -4,11 +4,11 @@
 #
 
 lib-y	:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
-	   memcpy.o memset.o memmove.o checksum.o
+	   memcpy.o memset.o memmove.o
 
 ifdef CONFIG_MMU
-lib-y	+= string.o uaccess.o
+lib-y	+= string.o uaccess.o checksum_mm.o
 else
-lib-y	+= mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o delay.o
+lib-y	+= mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o delay.o checksum_no.o
 endif
 
arch/m68k/lib/checksum.c deleted +0 -5
deleted file mode 100644
index 1297536..0000000
@@ -1,5 +0,0 @@
-#ifdef CONFIG_MMU
-#include "checksum_mm.c"
-#else
-#include "checksum_no.c"
-#endif
Signature · 1 line
1.7.0.4
#8 lore raw

Re: [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

In reply to [email protected]

Hi Greg.

arch/m68k/lib/muldi3.c line 23

Quoted 3 lines
arch/m68k/lib/muldi3.c +3 -0
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+    defined(__mc68040__) || defined(__mc68060__)

Why use these to decide if this is MMU or not?
This code is not exposed to user-space so we can rely on CONFIG_* symbols. IMO the CONIFG_* symbols is easier to read/maintain.

Sam
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

#9 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

Quoted 9 lines · Sam Ravnborg

Hi Greg.

arch/m68k/lib/muldi3.c line 23

Quoted 3 lines
arch/m68k/lib/muldi3.c +3 -0
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+    defined(__mc68040__) || defined(__mc68060__)

Why use these to decide if this is MMU or not?
This code is not exposed to user-space so we can rely on CONFIG_* symbols. IMO the CONIFG_* symbols is easier to read/maintain.

Because technically it doesn't depend on having a MMU or not, but on having the full 32-bit multiplication instruction or not.

Does Coldfire-with-MMU (for which we haven't integrated the support yet) have that
instruction?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

#10 lore raw

Re: [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

Quoted 11 lines · Geert Uytterhoeven
Quoted 9 lines · Sam Ravnborg

Hi Greg.

arch/m68k/lib/muldi3.c line 23

Quoted 3 lines
arch/m68k/lib/muldi3.c +3 -0
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+    defined(__mc68040__) || defined(__mc68060__)

Why use these to decide if this is MMU or not?
This code is not exposed to user-space so we can rely on CONFIG_* symbols. IMO the CONIFG_* symbols is easier to read/maintain.

Quoted 6 lines

Because technically it doesn't depend on having a MMU or not, but on having the full 32-bit multiplication instruction or not.

Does Coldfire-with-MMU (for which we haven't integrated the support yet) have that
instruction?

Actually, MCF547x & MCF548x (CFv4e family) are integrated but without their limited MMU functionality.

freescale had even written an mmu port for 2.6.25 but has not pushed it upstream. This port can be found on their site or in the openwrt repository.

MCF547x & MCF548x do not have that instruction.

Philippe
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

#11 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

Quoted 19 lines · Philippe De Muyter
Quoted 11 lines · Geert Uytterhoeven
Quoted 9 lines · Sam Ravnborg

Hi Greg.

arch/m68k/lib/muldi3.c

Quoted 3 lines
arch/m68k/lib/muldi3.c +3 -0
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+ á ádefined(__mc68040__) || defined(__mc68060__)

Why use these to decide if this is MMU or not?
This code is not exposed to user-space so we can rely on CONFIG_* symbols. IMO the CONIFG_* symbols is easier to read/maintain.

Quoted 6 lines

Because technically it doesn't depend on having a MMU or not, but on having the full 32-bit multiplication instruction or not.

Does Coldfire-with-MMU (for which we haven't integrated the support yet) have that
instruction?

Quoted 5 lines

Actually, MCF547x& MCF548x (CFv4e family) are integrated but without their limited MMU functionality.

freescale had even written an mmu port for 2.6.25 but has not pushed it upstream. This port can be found on their site or in the openwrt repository.

Part of my plan with the merge of m68k and m68knommu is to make it easy to support the v4e parts with MMU enabled. And certainly as I work through cleaning the individual files up I am doing it with this in mind. Of course most of the code to support the v4e is the same no matter if you have the MMU enabled or not.

I have Freescales 2.6.25 kernel, but it is really only a reference point for this work.

Quoted 1 line

MCF547x& MCF548x do not have that instruction.

Thats right. I believe the processors listed in the patch are the only ones that currently support the 64bit mul.

Regards
Greg

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

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
#12 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

Quoted 8 lines · Greg Ungerer
Quoted 7 lines · Philippe De Muyter
Quoted 6 lines · Geert Uytterhoeven
Quoted 5 lines · Sam Ravnborg

Hi Greg.

arch/m68k/lib/muldi3.c

Quoted 3 lines
arch/m68k/lib/muldi3.c +3 -0
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+ á ádefined(__mc68040__) || defined(__mc68060__)

(*)

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

Why use these to decide if this is MMU or not?
This code is not exposed to user-space so we can rely on CONFIG_* symbols.
IMO the CONIFG_* symbols is easier to read/maintain.

Because technically it doesn't depend on having a MMU or not, but on having
the full 32-bit multiplication instruction or not.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Does Coldfire-with-MMU (for which we haven't integrated the support yet) have that
instruction?

Actually, MCF547x& MCF548x (CFv4e family) are integrated but without

(*)

Quoted 7 lines
Quoted 6 lines

their
limited MMU functionality.

freescale had even written an mmu port for 2.6.25 but has not pushed it upstream. This port can be found on their site or in the openwrt repository.

Quoted 10 lines

Part of my plan with the merge of m68k and m68knommu is to make it easy to support the v4e parts with MMU enabled. And certainly as I work through cleaning the individual files up I am doing it with this in mind. Of course most of the code to support the v4e is the same no matter if you have the MMU enabled or not.

I have Freescales 2.6.25 kernel, but it is really only a reference point for this work.

Quoted 1 line

MCF547x& MCF548x do not have that instruction.

(*)

Quoted 3 lines

Thats right. I believe the processors listed in the patch are the only ones that currently support the 64bit mul.

The 68340 has it also. (And I have an old linux port for this processor)

I surmise the 68360 has it also.

Philippe

(*) Greg, there must be something with your mail installation : it garbles the messages. (or is it mine, but I noticed that only with replies from you ?)

#13 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

Hi Philippe,

Quoted 42 lines · Philippe De Muyter
Quoted 8 lines · Greg Ungerer
Quoted 7 lines · Philippe De Muyter
Quoted 6 lines · Geert Uytterhoeven
Quoted 5 lines · Sam Ravnborg

Hi Greg.

arch/m68k/lib/muldi3.c

Quoted 3 lines
arch/m68k/lib/muldi3.c +3 -0
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+ á ádefined(__mc68040__) || defined(__mc68060__)

(*)

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

Why use these to decide if this is MMU or not?
This code is not exposed to user-space so we can rely on CONFIG_* symbols.
IMO the CONIFG_* symbols is easier to read/maintain.

Because technically it doesn't depend on having a MMU or not, but on having
the full 32-bit multiplication instruction or not.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Does Coldfire-with-MMU (for which we haven't integrated the support yet) have that
instruction?

Actually, MCF547x& MCF548x (CFv4e family) are integrated but without

(*)

Quoted 16 lines
Quoted 6 lines

their
limited MMU functionality.

freescale had even written an mmu port for 2.6.25 but has not pushed it upstream. This port can be found on their site or in the openwrt repository.

Part of my plan with the merge of m68k and m68knommu is to make it easy to support the v4e parts with MMU enabled. And certainly as I work through cleaning the individual files up I am doing it with this in mind. Of course most of the code to support the v4e is the same no matter if you have the MMU enabled or not.

I have Freescales 2.6.25 kernel, but it is really only a reference point for this work.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

MCF547x& MCF548x do not have that instruction.

(*)

Quoted 3 lines

Thats right. I believe the processors listed in the patch are the only ones that currently support the 64bit mul.

The 68340 has it also. (And I have an old linux port for this processor)

That is just a SoC that contains a 68020 though, so __mc68020__ would be defined for that.

Quoted 1 line

I surmise the 68360 has it also.

I believe that is a SoC with a 68040 cpu core, so I would expect that __mc68040__ would be correct for that.

Quoted 4 lines

Philippe

(*) Greg, there must be something with your mail installation : it garbles the messages. (or is it mine, but I noticed that only with replies from you ?)

Unfortunately mail getting to me goes through an MS exchange server that tends to garble some parts of emails. Not too much I can do about that (at least using the existing [email protected] email address).

Regards
Greg

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

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
#14 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

Quoted 7 lines · Greg Ungerer

Hi Philippe,

Quoted 1 line · Philippe De Muyter

The 68340 has it also. (And I have an old linux port for this processor)

That is just a SoC that contains a 68020 though, so __mc68020__ would be defined for that.

Actually it has a cpu32 core, but it is close enough to be covered by __mc68020__.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#15 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

In reply to Greg Ungerer

Hi Greg,

Quoted 5 lines · Greg Ungerer
Quoted 2 lines

The 68340 has it also. (And I have an old linux port for this processor)

That is just a SoC that contains a 68020 though, so __mc68020__ would be defined for that.

No, this is a cpu32 core, which is a subset of a 68020, so gcc does not define __mc68020__, or at least should not (there are old bug reports about that).

Quoted 6 lines
Quoted 3 lines

I surmise the 68360 has it also.

I believe that is a SoC with a 68040 cpu core, so I would expect that __mc68040__ would be correct for that.

This is a cpu32+ core.

Same here.

Not that it is that important now :)

Philippe

#16 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

Hi Philippe,

Quoted 4 lines · Philippe De Muyter

Hi Greg,

Quoted 1 line · Greg Ungerer
Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

The 68340 has it also. (And I have an old linux port for this processor)

That is just a SoC that contains a 68020 though, so __mc68020__ would be defined for that.

No, this is a cpu32 core, which is a subset of a 68020, so gcc does not define __mc68020__, or at least should not (there are old bug reports about that).

Modern gcc still does, from a gcc-4.5.1:

# m68k-linux-gcc -mcpu32 -dM -E - < /dev/null | grep mc68020
#define __mc68020__ 1
#define __mc68020 1
#define mc68020 1
Quoted 10 lines
Quoted 4 lines
Quoted 1 line

I surmise the 68360 has it also.

I believe that is a SoC with a 68040 cpu core, so I would expect that __mc68040__ would be correct for that.

This is a cpu32+ core.

Same here.

Not that it is that important now :)

Does cpu32 always support the 64bit mul?
If so we can just add __mcpu32__ to the conditional check list.

Regards
Greg

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

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
#17 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

Hi Greg,

Quoted 29 lines · Greg Ungerer

Hi Philippe,

Quoted 4 lines · Philippe De Muyter

Hi Greg,

Quoted 1 line · Greg Ungerer
Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

The 68340 has it also. (And I have an old linux port for this processor)

That is just a SoC that contains a 68020 though, so __mc68020__ would be defined for that.

No, this is a cpu32 core, which is a subset of a 68020, so gcc does not define __mc68020__, or at least should not (there are old bug reports about that).

Modern gcc still does, from a gcc-4.5.1:

# m68k-linux-gcc -mcpu32 -dM -E - < /dev/null | grep mc68020
#define __mc68020__ 1
#define __mc68020 1
#define mc68020 1
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

I surmise the 68360 has it also.

I believe that is a SoC with a 68040 cpu core, so I would expect that __mc68040__ would be correct for that.

Quoted 7 lines
Quoted 5 lines

This is a cpu32+ core.

Same here.

Not that it is that important now :)

Does cpu32 always support the 64bit mul?

Yes AFAIK.

Quoted 1 line

If so we can just add __mcpu32__ to the conditional check list.

That would be safer.

Thanks

Philippe

#18 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

In reply to Sam Ravnborg
Quoted 9 lines · Sam Ravnborg

Hi Greg.

arch/m68k/lib/muldi3.c line 23

Quoted 3 lines
arch/m68k/lib/muldi3.c +3 -0
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+    defined(__mc68040__) || defined(__mc68060__)

Why use these to decide if this is MMU or not?
This code is not exposed to user-space so we can rely on CONFIG_* symbols. IMO the CONIFG_* symbols is easier to read/maintain.

This does not decide about MMU or not MMU, but about the availability of some assembler instructions in the processor.

Philippe

#19 lore raw

Re: [uClinux-dev] [PATCH v2 1/6] m68k: merge mmu and non-mmu versions of muldi3

In reply to Sam Ravnborg

Hi Sam,

Quoted 7 lines · Sam Ravnborg

Hi Greg.

arch/m68k/lib/muldi3.c line 23

Quoted 3 lines
arch/m68k/lib/muldi3.c +3 -0
+
+#if defined(__mc68020__) || defined(__mc68030__) || \
+    defined(__mc68040__) || defined(__mc68060__)

Why use these to decide if this is MMU or not?

The asm code that is enclosed by this is not about having an MMU or not. It is about the processor supporting the 64bit mul instruction.

Quoted 2 lines

This code is not exposed to user-space so we can rely on CONFIG_* symbols. IMO the CONIFG_* symbols is easier to read/maintain.

In general yes I agree. But in this specific case it really is about a code generation option (what type of processor instructions we can emit).

Regards
Greg

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

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
#20 lore raw
In reply to [email protected]
Quoted 2 lines · On 20/04/11 15:54, [email protected] wrote:

I have build and run tested on ARAnyM/Atari and ColdFire (non-mmu) targets.

Sorry, top of that message got lost somewhere, should be:

The following set of patches is version 2 of clean ups and merges of individual files in the arch/m68k/lib directory. It is mostly the same as the first version, but drops the removal of string.c, and does a simple cleanup of checksum.c.

I have build and run tested on ARAnyM/Atari and ColdFire (non-mmu) targets.

Regards
Greg

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

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com