public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Macro cpu_to_je16 in jffs2.h compile error
@ 2008-05-30  3:51 Frank Lin
  2008-05-30  6:38 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Lin @ 2008-05-30  3:51 UTC (permalink / raw)
  To: ecos-discuss


Macro #define cpu_to_je16(x) ((jint16_t){x}) compile to:



        struct jffs2_unknown_node marker = {
0xc11a13c <jffs2_mark_erased_block+608>:        sub     r3, r11, #76    ; 0x4c
0xc11a140 <jffs2_mark_erased_block+612>:        mov     r2, #12 ; 0xc
0xc11a144 <jffs2_mark_erased_block+616>:        mov     r0, r3
0xc11a148 <jffs2_mark_erased_block+620>:        mov     r1, #0  ; 0x0
0xc11a14c <jffs2_mark_erased_block+624>:        bl      0xc10bf60 <_memset>
            .magic =    cpu_to_je16(JFFS2_MAGIC_BITMASK),
0xc11a150 <jffs2_mark_erased_block+628>:        ldr r3, [pc, #1024] ; 0xc11a558 <jffs2_mark_erased_block+1660>
0xc11a154 <jffs2_mark_erased_block+632>:        sub     r2, r11, #80    ; 0x50
0xc11a158 <jffs2_mark_erased_block+636>:        mov     r12, #2 ; 0x2
0xc11a15c <jffs2_mark_erased_block+640>:        mov     r0, r2
0xc11a160 <jffs2_mark_erased_block+644>:        mov     r1, r3
0xc11a164 <jffs2_mark_erased_block+648>:        mov     r2, r12
0xc11a168 <jffs2_mark_erased_block+652>:        bl      0xc10bd04 <_memcpy>
0xc11a16c <jffs2_mark_erased_block+656>:        ldrh    r3, [r11, -#80]
0xc11a170 <jffs2_mark_erased_block+660>:        strh    r3, [r11, -#76]
            .nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER),
0xc11a174 <jffs2_mark_erased_block+664>:        ldr r3, [pc, #992]  ; 0xc11a55c <jffs2_mark_erased_block+1664>
0xc11a178 <jffs2_mark_erased_block+668>:        sub     r2, r11, #76    ; 0x4c
0xc11a17c <jffs2_mark_erased_block+672>:        mov     r12, #2 ; 0x2
0xc11a180 <jffs2_mark_erased_block+676>:        mov     r0, r2
0xc11a184 <jffs2_mark_erased_block+680>:        mov     r1, r3
0xc11a188 <jffs2_mark_erased_block+684>:        mov     r2, r12
0xc11a18c <jffs2_mark_erased_block+688>:        bl      0xc10bd04 <_memcpy>
0xc11a190 <jffs2_mark_erased_block+692>:        ldrh    r3, [r11, -#76]     <-------these two instruction obviously error
0xc11a194 <jffs2_mark_erased_block+696>:        strh    r3, [r11, -#74]     <-------ram will be same value
            .totlen =   cpu_to_je32(c->cleanmarker_size)



I don't know why, maybe gcc bug, now I change macro to:
#define cpu_to_je16(x) ({jint16_t temp;temp.v16=x;temp;})
now result OK.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Macro cpu_to_je16 in jffs2.h compile error
  2008-05-30  3:51 [ECOS] Macro cpu_to_je16 in jffs2.h compile error Frank Lin
@ 2008-05-30  6:38 ` Andrew Lunn
  2008-05-30  8:29   ` Frank Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2008-05-30  6:38 UTC (permalink / raw)
  To: Frank Lin; +Cc: ecos-discuss

On Fri, May 30, 2008 at 11:51:14AM +0800, Frank Lin wrote:
> 
> Macro #define cpu_to_je16(x) ((jint16_t){x}) compile to:

What version of gcc are you using?

fs-ecos.c contains:

#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2) && \
    (defined (__arm__) || defined (_mips))
#error This compiler is known to be broken. Please see:
#error "http://ecos.sourceware.org/ml/ecos-patches/2003-08/msg00006.html"
#endif


        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Macro cpu_to_je16 in jffs2.h compile error
  2008-05-30  6:38 ` Andrew Lunn
@ 2008-05-30  8:29   ` Frank Lin
  2008-05-30  8:34     ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Lin @ 2008-05-30  8:29 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss


----- Original Message ----- 
From: "Andrew Lunn" <andrew@lunn.ch>
To: "Frank Lin" <franklin373@gmail.com>
Cc: <ecos-discuss@ecos.sourceware.org>
Sent: Friday, May 30, 2008 2:38 PM
Subject: Re: [ECOS] Macro cpu_to_je16 in jffs2.h compile error


> On Fri, May 30, 2008 at 11:51:14AM +0800, Frank Lin wrote:
>> 
>> Macro #define cpu_to_je16(x) ((jint16_t){x}) compile to:
> 
> What version of gcc are you using?

$ arm-elf-gcc --version
arm-elf-gcc (GCC) 3.2.1 (eCosCentric)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Macro cpu_to_je16 in jffs2.h compile error
  2008-05-30  8:29   ` Frank Lin
@ 2008-05-30  8:34     ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2008-05-30  8:34 UTC (permalink / raw)
  To: Frank Lin; +Cc: Andrew Lunn, ecos-discuss

On Fri, May 30, 2008 at 04:29:30PM +0800, Frank Lin wrote:
> 
> ----- Original Message ----- 
> From: "Andrew Lunn" <andrew@lunn.ch>
> To: "Frank Lin" <franklin373@gmail.com>
> Cc: <ecos-discuss@ecos.sourceware.org>
> Sent: Friday, May 30, 2008 2:38 PM
> Subject: Re: [ECOS] Macro cpu_to_je16 in jffs2.h compile error
> 
> 
> > On Fri, May 30, 2008 at 11:51:14AM +0800, Frank Lin wrote:
> >> 
> >> Macro #define cpu_to_je16(x) ((jint16_t){x}) compile to:
> > 
> > What version of gcc are you using?
> 
> $ arm-elf-gcc --version
> arm-elf-gcc (GCC) 3.2.1 (eCosCentric)
> Copyright (C) 2002 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

There are known problems with this version of the compiler and
jffs2. See the email thread in the comment.....

       Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-30  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-30  3:51 [ECOS] Macro cpu_to_je16 in jffs2.h compile error Frank Lin
2008-05-30  6:38 ` Andrew Lunn
2008-05-30  8:29   ` Frank Lin
2008-05-30  8:34     ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).