Skip to contentSkip to conversation

m68k with mmu doesn't compile after 66d857b08b8c3ed

DISCUSSION Rob Landley 3 participants 7 messages Aug 20, 2011 – Aug 23, 2011 m68k architecture

lore
Share & tools
lore
#0 lore raw

The m68k build in 3.0 dies with this:

CC arch/m68k/kernel/dma.o
In file included from arch/m68k/kernel/dma.c:4:
arch/m68k/kernel/dma_no.c: In function 'dma_sync_single_for_cpu':
arch/m68k/kernel/dma_no.c:44: error: implicit declaration of function 'flush_dcache_range'
make[1]: *** [arch/m68k/kernel/dma.o] Error 1
make: *** [arch/m68k/kernel] Error 2

That file includes <asm/cacheflush.h>, which for m68k is:

#ifdef __uClinux__
#include "cacheflush_no.h"
#else
#include "cacheflush_mm.h"
#endif

The nommu header (cacheflush_no.h) does #define flush_dcache_range(), but the clacheflush_mm.h version does not. I.E. you can only currently build m68k for Coldfire, you can no longer build it for an actual m68k.

(A git log of Linus' tree shows cacheflush_mm.h hasn't been touched since 2010, and I pulled earlier today.)

Rob

#1 lore raw

Hi Rob,

You're really confusing me.

Quoted 6 lines · Rob Landley

The m68k build in 3.0 dies with this:

 CC      arch/m68k/kernel/dma.o
In file included from arch/m68k/kernel/dma.c:4:
arch/m68k/kernel/dma_no.c: In function 'dma_sync_single_for_cpu':
arch/m68k/kernel/dma_no.c:44: error: implicit declaration of function 'flush_dcache_range'

Your subject says "m68k with mmu doesn't compile", but here you're obviously compiling for nommu, as dma.c includes dma_no.c if CONFIG_MMU is not set.

Quoted 5 lines

make[1]: *** [arch/m68k/kernel/dma.o] Error 1
make: *** [arch/m68k/kernel] Error 2

That file includes <asm/cacheflush.h>, which for m68k is:

Quoted 8 lines

#ifdef __uClinux__
#include "cacheflush_no.h"
#else
#include "cacheflush_mm.h"
#endif

The nommu header (cacheflush_no.h) does #define flush_dcache_range(), but the clacheflush_mm.h version does not.  I.E. you can only currently

Are you using a uClinux toolchain that defines __uClinux__, or not?

Quoted 1 line

build m68k for Coldfire, you can no longer build it for an actual m68k.

JFYI, it builds fine for all "actual m68ks" (with MMU) I'm interested in. And I guess Greg will say the same for Coldfire and "actual m68ks" without MMU...

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

#2 lore raw
Quoted 3 lines · Geert Uytterhoeven

Hi Rob,

You're really confusing me.

Sorry, I was the one confused. My .config got screwed up moving to 3.0 so I was accidentally building most of an "allnoconfig". I tried again with atari_defconfig and it built, I'll reassemble my config from there.

My bad, sorry for the noise,

Rob

#3 lore raw
In reply to Geert Uytterhoeven
Quoted 30 lines · Geert Uytterhoeven

Hi Rob,

You're really confusing me.

Quoted 6 lines · Rob Landley

The m68k build in 3.0 dies with this:

áCC á á áarch/m68k/kernel/dma.o
In file included from arch/m68k/kernel/dma.c:4:
arch/m68k/kernel/dma_no.c: In function 'dma_sync_single_for_cpu':
arch/m68k/kernel/dma_no.c:44: error: implicit declaration of function 'flush_dcache_range'

Your subject says "m68k with mmu doesn't compile", but here you're obviously compiling for nommu, as dma.c includes dma_no.c if CONFIG_MMU is not set.

Quoted 5 lines

make[1]: *** [arch/m68k/kernel/dma.o] Error 1
make: *** [arch/m68k/kernel] Error 2

That file includes<asm/cacheflush.h>, which for m68k is:

Quoted 8 lines

#ifdef __uClinux__
#include "cacheflush_no.h"
#else
#include "cacheflush_mm.h"
#endif

The nommu header (cacheflush_no.h) does #define flush_dcache_range(), but the clacheflush_mm.h version does not. áI.E. you can only currently

Quoted 7 lines

Are you using a uClinux toolchain that defines __uClinux__, or not?

Quoted 1 line

build m68k for Coldfire, you can no longer build it for an actual m68k.

JFYI, it builds fine for all "actual m68ks" (with MMU) I'm interested in. And I guess Greg will say the same for Coldfire and "actual m68ks" without MMU...

Yes :-)
And from time to time I build all the defconfigs (so both MMU and non-MMU) in arch/m68k/configs/. I thought they all worked on 3.0 if using an appropriate tool chain.

Regards
Greg

Signature · 5 lines
------------------------------------------------------------------------
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
#4 lore raw
Quoted 9 lines · Greg Ungerer
Quoted 4 lines

JFYI, it builds fine for all "actual m68ks" (with MMU) I'm interested in. And I guess Greg will say the same for Coldfire and "actual m68ks" without
MMU...

Yes :-)
And from time to time I build all the defconfigs (so both MMU and non-MMU) in arch/m68k/configs/. I thought they all worked on 3.0 if using an appropriate tool chain.

Sorry, building fine now. As I replied earlier, my .config got truncated in the move from 2.6.39 to 3.0. My bad.

Rob

#5 lore raw
In reply to Rob Landley
Quoted 18 lines · Rob Landley

The m68k build in 3.0 dies with this:

CC arch/m68k/kernel/dma.o
In file included from arch/m68k/kernel/dma.c:4:
arch/m68k/kernel/dma_no.c: In function 'dma_sync_single_for_cpu':
arch/m68k/kernel/dma_no.c:44: error: implicit declaration of function 'flush_dcache_range'
make[1]: *** [arch/m68k/kernel/dma.o] Error 1
make: *** [arch/m68k/kernel] Error 2

That file includes <asm/cacheflush.h>, which for m68k is:

#ifdef __uClinux__
#include "cacheflush_no.h"
#else
#include "cacheflush_mm.h"
#endif

Quoted 8 lines

The nommu header (cacheflush_no.h) does #define flush_dcache_range(), but the clacheflush_mm.h version does not. I.E. you can only currently build m68k for Coldfire, you can no longer build it for an actual m68k.

(A git log of Linus' tree shows cacheflush_mm.h hasn't been touched since 2010, and I pulled earlier today.)

Rob

I worked around the above problem with this rather disgusting hack:

arch/m68k/include/asm/cacheflush_mm.h +1 -0
@@ -129,6 +129,7 @@ static inline void __flush_page_to_ram(void *vaddr)
 }
 
 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
+#define flush_dcache_range(page, len)  __flush_cache_all()
 #define flush_dcache_page(page)

__flush_page_to_ram(page_address(page))
#define flush_dcache_mmap_lock(mapping) do { } while (0)
#define flush_dcache_mmap_unlock(mapping) do { } while (0)

And then it died with:

AS arch/m68k/kernel/entry.o
arch/m68k/kernel/entry_no.S: Assembler messages:
arch/m68k/kernel/entry_no.S:46: Error: Unknown operator -- statement `save_all' ignored
arch/m68k/kernel/entry_no.S:55: Error: Unknown operator -- statement `save_all' ignored

This is because arch/m68k/include/asm/entry_no.h has this:

#else /* !CONFIG_COLDFIRE */

/*
* Standard 68k interrupt entry and exit macros.
*/
.macro SAVE_ALL

        clrl    %sp@-                   /* stkadj */
        movel   %d0,%sp@-               /* orig d0 */
        movel   %d0,%sp@-               /* d0 */
        moveml  %d1-%d5/%a0-%a2,%sp@-

.endm

And arch/m68k/include/asm/entry_mm.h does not.

Rob

#6 lore raw
In reply to Rob Landley
Quoted 18 lines · Rob Landley

The m68k build in 3.0 dies with this:

CC arch/m68k/kernel/dma.o
In file included from arch/m68k/kernel/dma.c:4:
arch/m68k/kernel/dma_no.c: In function 'dma_sync_single_for_cpu':
arch/m68k/kernel/dma_no.c:44: error: implicit declaration of function 'flush_dcache_range'
make[1]: *** [arch/m68k/kernel/dma.o] Error 1
make: *** [arch/m68k/kernel] Error 2

That file includes <asm/cacheflush.h>, which for m68k is:

#ifdef __uClinux__
#include "cacheflush_no.h"
#else
#include "cacheflush_mm.h"
#endif

Quoted 8 lines

The nommu header (cacheflush_no.h) does #define flush_dcache_range(), but the clacheflush_mm.h version does not. I.E. you can only currently build m68k for Coldfire, you can no longer build it for an actual m68k.

(A git log of Linus' tree shows cacheflush_mm.h hasn't been touched since 2010, and I pulled earlier today.)

Rob

I worked around the above problem with this rather disgusting hack:

arch/m68k/include/asm/cacheflush_mm.h +1 -0
@@ -129,6 +129,7 @@ static inline void __flush_page_to_ram(void *vaddr)
 }
 
 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
+#define flush_dcache_range(page, len)  __flush_cache_all()
 #define flush_dcache_page(page)

__flush_page_to_ram(page_address(page))
#define flush_dcache_mmap_lock(mapping) do { } while (0)
#define flush_dcache_mmap_unlock(mapping) do { } while (0)

And then it died with:

AS arch/m68k/kernel/entry.o
arch/m68k/kernel/entry_no.S: Assembler messages:
arch/m68k/kernel/entry_no.S:46: Error: Unknown operator -- statement `save_all' ignored
arch/m68k/kernel/entry_no.S:55: Error: Unknown operator -- statement `save_all' ignored

This is because arch/m68k/include/asm/entry_no.h has this:

#else /* !CONFIG_COLDFIRE */

/*
* Standard 68k interrupt entry and exit macros.
*/
.macro SAVE_ALL

        clrl    %sp@-                   /* stkadj */
        movel   %d0,%sp@-               /* orig d0 */
        movel   %d0,%sp@-               /* d0 */
        moveml  %d1-%d5/%a0-%a2,%sp@-

.endm

And arch/m68k/include/asm/entry_mm.h does not.

Rob