Re: [PATCH v2 1/2] m68k: Make thread_info.h usable from assembly.

From: Geert Uytterhoeven
Date: Fri Nov 20 2009 - 02:56:35 EST


On Sun, Sep 27, 2009 at 12:58, Sam Ravnborg <sam@xxxxxxxxxxxx> wrote:
> On Sun, Sep 27, 2009 at 11:55:55AM +0200, Geert Uytterhoeven wrote:
>> On Wed, Sep 16, 2009 at 18:44, Tim Abbott <tabbott@xxxxxxxxxxx> wrote:
>> > Signed-off-by: Tim Abbott <tabbott@xxxxxxxxxxx>
>> > Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
>> > Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx>
>> > Cc: linux-m68k@xxxxxxxxxxxxxxxxxxxx
>> > Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
>> > ---
>> > Âarch/m68k/include/asm/thread_info_mm.h | Â Â2 ++
>> > Â1 files changed, 2 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/arch/m68k/include/asm/thread_info_mm.h b/arch/m68k/include/asm/thread_info_mm.h
>> > index b6da388..5f36cf1 100644
>> > --- a/arch/m68k/include/asm/thread_info_mm.h
>> > +++ b/arch/m68k/include/asm/thread_info_mm.h
>> > @@ -8,6 +8,7 @@
>> > Â#include <asm/types.h>
>> > Â#include <asm/page.h>
>> >
>> > +#ifndef __ASSEMBLY__
>> > Âstruct thread_info {
>> >    Âstruct task_struct   Â*task;     Â/* main task structure */
>> >    Âunsigned long      flags;
>> > @@ -16,6 +17,7 @@ struct thread_info {
>> > Â Â Â Â__u32 cpu; /* should always be 0 on m68k */
>> >    Âstruct restart_block  Ârestart_block;
>> > Â};
>> > +#endif /* __ASSEMBLY__ */
>> >
>> > Â#define PREEMPT_ACTIVE Â Â Â Â 0x4000000
>>
>> This is not sufficient. <asm/thread_info_mm.h> pulls in <asm/current.h>,
>> which contains C only. So you also need:
>>
>> --- a/arch/m68k/include/asm/thread_info_mm.h
>> +++ b/arch/m68k/include/asm/thread_info_mm.h
>> @@ -4,11 +4,12 @@
>> Â#ifndef ASM_OFFSETS_C
>> Â#include <asm/asm-offsets.h>
>> Â#endif
>> -#include <asm/current.h>
>> Â#include <asm/types.h>
>> Â#include <asm/page.h>
>>
>> Â#ifndef __ASSEMBLY__
>> +#include <asm/current.h>
>> +
>> Âstruct thread_info {
>>    struct task_struct   Â*task;     Â/* main task structure */
>>    unsigned long      flags;
>
>
> upstream m68k does not build for me so I could not test.
> But I think the correct fix is to drop the include or current from thread_info.
> No-one except m68k needs to include current.h in thread_info.h.

Dropping it causes lots of undeclared errors, so I'm gonna apply Tim's
patch with my additional fix.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/