public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@snapgear.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@vger.kernel.org, gerg@uclinux.org
Subject: Re: [PATCH] m68k/m68knommu: merge MMU and non-MMU string.h
Date: Fri, 10 Sep 2010 14:36:52 +1000	[thread overview]
Message-ID: <4C89B5E4.5030104@snapgear.com> (raw)
In-Reply-To: <AANLkTikhxWgp6xLDqPSLMax6LS2zT71d+WLZnmo-WCyH@mail.gmail.com>


Hi Geert,

Geert Uytterhoeven wrote:
> On Wed, Sep 8, 2010 at 13:43, Greg Ungerer <gerg@snapgear.com> 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?

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@linux-m68k.org
> 
> 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@snapgear.com
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

  reply	other threads:[~2010-09-10  4:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07  4:52 [PATCH] m68k/m68knommu: merge MMU and non-MMU string.h Greg Ungerer
2010-09-07 20:35 ` Geert Uytterhoeven
2010-09-07 20:45   ` Geert Uytterhoeven
2010-09-08 11:43   ` Greg Ungerer
2010-09-08 12:01     ` Andreas Schwab
2010-09-08 12:22       ` Greg Ungerer
2010-09-08 12:41         ` Andreas Schwab
2010-09-08 12:52           ` Geert Uytterhoeven
2010-09-09 19:14     ` Geert Uytterhoeven
2010-09-10  4:36       ` Greg Ungerer [this message]
2010-09-10  8:59         ` Geert Uytterhoeven
2010-09-10  9:00         ` Geert Uytterhoeven
2010-09-13  3:22           ` Greg Ungerer
2010-09-13 18:22 ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C89B5E4.5030104@snapgear.com \
    --to=gerg@snapgear.com \
    --cc=geert@linux-m68k.org \
    --cc=gerg@uclinux.org \
    --cc=linux-m68k@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox