From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12691 invoked by alias); 25 Sep 2009 00:16:06 -0000 Received: (qmail 12683 invoked by uid 22791); 25 Sep 2009 00:16:05 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 X-Spam-Check-By: sourceware.org Received: from virtual.bogons.net (HELO virtual.bogons.net) (193.178.223.136) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Sep 2009 00:16:01 +0000 Received: from jifvik.dyndns.org (jifvik.dyndns.org [85.158.45.40]) by virtual.bogons.net (8.10.2+Sun/8.11.2) with ESMTP id n8P0Fv408650; Fri, 25 Sep 2009 01:15:57 +0100 (BST) Received: from [172.31.1.126] (neelix.jifvik.org [172.31.1.126]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by jifvik.dyndns.org (Postfix) with ESMTP id 3AE433FEB; Fri, 25 Sep 2009 01:15:57 +0100 (BST) Message-ID: <4ABC0BBC.2010904@jifvik.org> Date: Fri, 25 Sep 2009 00:16:00 -0000 From: Jonathan Larmour User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) MIME-Version: 1.0 To: Ramgopal Kota Cc: eCos Discussion References: <4AB7900D.30204@ecoscentric.com> <4AB80124.3080708@ecoscentric.com> <6C370B347C3FE8438C9692873287D2E11079E1188B@SJEXCHCCR01.corp.ad.broadcom.com> In-Reply-To: <6C370B347C3FE8438C9692873287D2E11079E1188B@SJEXCHCCR01.corp.ad.broadcom.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] JFFS2 Issue. X-SW-Source: 2009-09/txt/msg00234.txt.bz2 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