Re: [PATCH] m68k/m68knommu: merge MMU and non-MMU string.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Geert,

Geert Uytterhoeven wrote:
On Fri, Sep 10, 2010 at 06:36, Greg Ungerer <gerg@xxxxxxxxxxxx> wrote:
Geert Uytterhoeven wrote:
On Wed, Sep 8, 2010 at 13:43, Greg Ungerer <gerg@xxxxxxxxxxxx> wrote:
On 08/09/10 06:35, Geert Uytterhoeven wrote:
Now I see:

| arch/m68k/kernel/entry.S: Assembler messages:
| arch/m68k/kernel/entry.S:56: Error: can't resolve `0' {*ABS* section}
- `THREAD_SIZE' {*UND* section}
| arch/m68k/kernel/entry.S:64: Error: can't resolve `0' {*UND* section}
- `THREAD_SIZE' {*UND* section}
| arch/m68k/kernel/entry.S:119: Error: can't resolve `0' {*UND* section}
- `THREAD_SIZE' {*UND* section}
| arch/m68k/kernel/entry.S:203: Error: can't resolve `0' {*UND* section}
- `THREAD_SIZE' {*UND* section}
| arch/m68k/kernel/entry.S:236: Error: can't resolve `0' {*UND* section}
- `THREAD_SIZE' {*UND* section}
| arch/m68k/kernel/entry.S:257: Error: can't resolve `0' {*UND* section}
- `THREAD_SIZE' {*UND* section}

this is expanded from `GET_CURRENT'.
Just a thought, is it enough to include thread_info.h inside entry_mm.h?
No, because <asm/thread_info.h> is no longer ASSEMBLY-clean, as it
includes
<asm/current.h>, which is C-only.
The #include <asm/current.h> in there used to be protected by #ifndef
ASSEMBLY.
If I move that include up just above the definition of struct thread_info,
<asm/thread_info.h> is ASSEMBLY-clean again.

However, just including <asm/thread_info.h> from <asm/entry_mm.h> causes
other
problems for the C part, as <asm/thread_info.h> needs the definition of
struct
restart_block in <linux/thread_info.h>. And <linux/thread_info.h> is
definitely
not ASSEMBLY-clean.

So I came up with the patch (white-space damaged due to the GMail web
interface)
below. Note that this changes the behavior for m68knommu, which didn't
include
<asm/current.h> from <asm/thread_info.h> before. I hope it doesn't hurt...
Unfortunately that breaks the m68knommu build:

/home/gerg/new-wave.2635/linux-2.6.x.git/arch/m68k/include/asm/current.h: In
function ‘get_current’:
/home/gerg/new-wave.2635/linux-2.6.x.git/arch/m68k/include/asm/current.h:21:
error: implicit declaration of function ‘current_thread_info’
...

If we just wrap the include of asm/current.h with its own "#ifndef
__ASSEMBLY__", instead of moving it from above struct thread_info,
is that better for you?

Builds fine, too.

Ok, thanks. I'll generate a new patch based on this.

Regards
Greg



diff --git a/arch/m68k/include/asm/entry_mm.h
b/arch/m68k/include/asm/entry_mm.h
index 6f70823..73b8c8f 100644
--- a/arch/m68k/include/asm/entry_mm.h
+++ b/arch/m68k/include/asm/entry_mm.h
@@ -3,6 +3,9 @@

 #include <asm/setup.h>
 #include <asm/page.h>
+#ifdef __ASSEMBLY__
+#include <asm/thread_info.h>
+#endif

 /*
 * Stack layout in 'ret_from_exception':
diff --git a/arch/m68k/include/asm/thread_info.h
b/arch/m68k/include/asm/thread_info.h
index f28775e..aec5eff 100644
--- a/arch/m68k/include/asm/thread_info.h
+++ b/arch/m68k/include/asm/thread_info.h
@@ -22,6 +22,8 @@

 #ifndef __ASSEMBLY__

+#include <asm/current.h>
+
 struct thread_info {
       struct task_struct      *task;          /* main task structure */
       unsigned long           flags;
@@ -49,8 +51,6 @@ struct thread_info {

 #ifdef CONFIG_MMU

-#include <asm/current.h>
-
 #ifdef ASM_OFFSETS_C
 #define task_thread_info(tsk)  ((struct thread_info *) NULL)
 #else

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



--
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@xxxxxxxxxxxx
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
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux