public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jifl@jifvik.org>
To: Ramgopal Kota <rkota@broadcom.com>
Cc: eCos Discussion <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] JFFS2  Issue.
Date: Fri, 25 Sep 2009 00:16:00 -0000	[thread overview]
Message-ID: <4ABC0BBC.2010904@jifvik.org> (raw)
In-Reply-To: <6C370B347C3FE8438C9692873287D2E11079E1188B@SJEXCHCCR01.corp.ad.broadcom.com>

Ramgopal Kota wrote:
>  Hi,
> 
> I am integrating JFFS2 into our MIPS Malta board. I am seeing a strange issue.
> In JFFS2 erase.c file and function jffs2_mark_erased_block , code section as below 
> 
> struct jffs2_unknown_node marker = {
>       .magic =  cpu_to_je16(JFFS2_MAGIC_BITMASK),
>       .nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER), 
>       .totlen = cpu_to_je32(c->cleanmarker_size)
>     };
> 
> struct jffs2_unknown_node
> {
>   /* All start like this */
>   jint16_t magic;
>   jint16_t nodetype;
>   jint32_t totlen; /* So we can skip over nodes we don't grok */
>   jint32_t hdr_crc;
> } __attribute__((packed));
> 
> I am seeing that both .magic and .nodetype are filled with 0x2003 which is the value of JFFS2_NODETYPE_CLEANMARKER.
> 
> If I change the code to the following it is working fine...
> 
> struct jffs2_unknown_node marker = {
>       .magic =  cpu_to_je16(JFFS2_MAGIC_BITMASK),
>       .nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER), 
>       .totlen = cpu_to_je32(c->cleanmarker_size)
>     };
> 
> marker.magic =  cpu_to_je16(JFFS2_MAGIC_BITMASK);
> 
> I don't know if it is CFLAGS issue or Compiler issue.I am thinking it is a compiler optimisation re-ordering issue.I am using -Os flag.
> Compiler I am using is gcc version 3.2.1 (eCosCentric)

I recommend you eCos 3.0 and the updated GNU tools instead (you can't 
really use the updated tools with eCos much before 3.0).

You should have got an error compiling JFFS2 due to this in src/fs-ecos.c:

#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


Jifl
-- 
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine

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

  parent reply	other threads:[~2009-09-25  0:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21 14:39 [ECOS] Re: Switching to using git on eCosForge Alex Schuilenburg
2009-09-21 20:06 ` Sergei Organov
2009-09-21 22:41   ` Alex Schuilenburg
2009-09-22  6:28     ` [ECOS] JFFS2 Or Compiler Issue Ramgopal Kota
2009-09-22  9:55     ` [ECOS] Re: Switching to using git on eCosForge Peter Korsgaard
2009-09-22 11:08       ` Alex Schuilenburg
2009-09-22 11:21         ` Sergei Gavrikov
2009-09-22 11:41           ` Edgar Grimberg
2009-09-22 17:29             ` Ilija Kocho
2009-09-22 11:52           ` Alex Schuilenburg
2009-09-22 11:38         ` Peter Korsgaard
2009-09-22 12:21     ` Sergei Organov
2009-09-22 17:03     ` [ECOS] JFFS2 Issue Ramgopal Kota
2009-09-23 12:37       ` Ramgopal Kota
2009-09-25  0:16       ` Jonathan Larmour [this message]
2009-09-21 22:08 ` [ECOS] Re: Switching to using git on eCosForge Sergei Gavrikov

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=4ABC0BBC.2010904@jifvik.org \
    --to=jifl@jifvik.org \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=rkota@broadcom.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).