From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7037 invoked by alias); 28 Aug 2007 11:02:34 -0000 Received: (qmail 6995 invoked by uid 22791); 28 Aug 2007 11:02:33 -0000 X-Spam-Check-By: sourceware.org Received: from 204-133-123-27.dia.static.slbbi.com (HELO mail.chez-thomas.org) (204.133.123.27) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 28 Aug 2007 11:02:28 +0000 Received: by mail.chez-thomas.org (Postfix, from userid 999) id C1945195019D; Tue, 28 Aug 2007 05:02:26 -0600 (MDT) Received: from [192.168.1.101] (hermes_local [192.168.1.101]) by mail.chez-thomas.org (Postfix) with ESMTP id 0603E19500A5; Tue, 28 Aug 2007 05:02:24 -0600 (MDT) Message-ID: <46D400BF.9070207@mlbassoc.com> Date: Tue, 28 Aug 2007 11:02:00 -0000 From: Gary Thomas User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org References: <46D3642A.6030801@changind.com> <46D3FF28.4070509@mlbassoc.com> In-Reply-To: <46D3FF28.4070509@mlbassoc.com> Content-Type: text/plain; charset=ISO-8859-1 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] workspace_end_init, workspace_end and flash.c X-SW-Source: 2007-08/txt/msg00151.txt.bz2 Gary Thomas wrote: > Ben Wu wrote: >> I've been working to integrate the RedBoot 2.04 Intel IXP42x NPE >> ethernet driver to work with the most recent Ecos code and ran into a >> problem where NPE "workspace" buffers were being overwritten causing the >> boot process to hang. >> >> I've tracked down the problem to the flash code where it allocates it's >> own workspace buffers. Specifically : >> >>> workspace_end = (unsigned char )(workspace_end_init - fisdir_size); >> In the 2.04 intel fork, the line reads >> >>> workspace_end = (unsigned char )(workspace_end - fisdir_size); >> why the change? It seems that by doing so the flash init assumes it >> always be called first and assumes any code that needs workspace will >> use the workspace_end pointer rather than the workspace_end_init pointer. >> >> It turns out that the NPE init code is being inserted before the flash >> init code with the same RedBoot_INIT_FIRST priority level. Is there >> anyway to fine tune insertion of initialization routines with a the same >> priority order? > > You'd have to ask Intel why the change; they don't share their code > with us, nor track our CVS (closely). Actually, this is a case where it would have been nice for Intel *to* share! They found something and we only learn about it the hard way... > > If the NPE code is indeed being executed before the FLASH code, then > this change would be required. The order of routines with the same > priority is based on how the linker fills in the init table - not something > that should ever be counted on :-( > > Looking at the code however, I think that the version which uses workspace_end > is more correct and will work no matter what order init functions are called. > > > -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss