From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31666 invoked by alias); 14 May 2006 02:51:21 -0000 Received: (qmail 31644 invoked by uid 22791); 14 May 2006 02:51:19 -0000 X-Spam-Check-By: sourceware.org Received: from smtpauth08.mail.atl.earthlink.net (HELO smtpauth08.mail.atl.earthlink.net) (209.86.89.68) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 14 May 2006 02:50:58 +0000 Received: from user-112umh6.biz.mindspring.com ([66.47.90.38] helo=[127.0.0.1]) by smtpauth08.mail.atl.earthlink.net with asmtp (Exim 4.34) id 1Ff6h3-0005tF-VX; Sat, 13 May 2006 22:50:54 -0400 Message-ID: <44669B2A.7090008@mindspring.com> Date: Sun, 14 May 2006 02:51:00 -0000 From: Frank Pagliughi User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: David Fernandez CC: Andrew Lunn , eCos Disuss , eCos Patches References: <20060223181036.GV19406@lunn.ch> <1140770157.2884.2.camel@software.cct.co.uk> <1140799114.2884.16.camel@software.cct.co.uk> <20060224171412.GA18806@lunn.ch> <1141031570.2878.11.camel@software.cct.co.uk> <20060227092243.GB18806@lunn.ch> <1141032779.2878.13.camel@software.cct.co.uk> <20060227100907.GC18806@lunn.ch> <1141039571.6090.18.camel@software.cct.co.uk> In-Reply-To: <1141039571.6090.18.camel@software.cct.co.uk> Content-Type: multipart/mixed; boundary="------------090707000602020000020403" X-ELNK-Trace: 4d82f965df0f6dd9e3f977c6d1ea408f0a9da525759e2654e2fe550889855d73fbdc7809687f737f08a8bb3e8e732a70350badd9bab72f9c350badd9bab72f9c X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Problems building ecos sources X-SW-Source: 2006-05/txt/msg00102.txt.bz2 --------------090707000602020000020403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2284 David Fernandez wrote: >On Mon, 2006-02-27 at 11:09 +0100, Andrew Lunn wrote: > > >>On Mon, Feb 27, 2006 at 09:32:59AM +0000, David Fernandez wrote: >> >> >>>On Mon, 2006-02-27 at 10:22 +0100, Andrew Lunn wrote: >>> >>> >>>>> The problem seems to be in the last line: >>>>> >>>>> (_sparg_) = (CYG_ADDRESS) _regs_; \ >>>>> >>>>> My gcc version is 4.0.2: >>>>> >>>>> >>>>That makes sense. Thew macro is being called with: >>>> >>>>HAL_THREAD_INIT_CONTEXT((CYG_ADDRWORD)workspace_end, >>>> breakpoint, trampoline,0); >>>> >>>>and (_sparg_) is the first parameter. Edit main.c change the cast to >>>>(CYG_ADDRESS). It might work, or it might still compain about casting >>>>the lvalue.... >>>> >>>> Andrew >>>> >>>> >>> Still complaining, same error. >>> >>> >>So it looks like you will have to add a new local variable of type >>CYG_ADDRESS, assign workspace_end to it and then pass the variable to >>the macro. >> >> Andrew >> >> > > Andrew, > > I think that what you propose is to do: > >CYG_ADDRESS workspace_end_int = (CYG_ADDRESS) workspace_end; >HAL_THREAD_INIT_CONTEXT(workspace_end_int, > breakpoint, trampoline, 0); >workspace_end = (CYG_WORD*)workspace_end_int; > > I propose, to keep the macro useful in saving typing code, and to not >replicate the functionality of the last line of the macro; to change the >macro line: > >register CYG_WORD* _sp_ = ((CYG_WORD*)((_sparg_) &~15)); > >into > >register CYG_WORD* _sp_ = ((CYG_WORD*)((CYG_ADDRWORD)(_sparg_) &~15)); > >and get rid of the casting to (CYG_ADDRWORD) in main. > > I think this makes more sense, you cannot cast something to an int, and >expect to behave as l-value, the macro should receive a variable without >casting. On the other hand, you can always cast a r-value to int if >unsure of getting a real int or a pointer. > > Either way, it fixes the problem, and either make and gmake go well >now. > > Thank you very much Andrew. > >David. > > > > Hey all, I just hit this problem, too, with the latest sources (trying to compile RedBoot for the PC with i386-elf-gcc v 4.0.2). I had fixed it in the way David described. If no one's done so already, here's the patch. Frank --------------090707000602020000020403 Content-Type: text/plain; name="redboot_sparg.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="redboot_sparg.patch" Content-length: 1955 diff -urN ecos-2006-05-13/packages/hal/i386/arch/current/include/hal_arch.h ecos/packages/hal/i386/arch/current/include/hal_arch.h --- ecos-2006-05-13/packages/hal/i386/arch/current/include/hal_arch.h 2006-05-13 15:55:16.000000000 -0400 +++ ecos/packages/hal/i386/arch/current/include/hal_arch.h 2006-05-13 16:29:57.000000000 -0400 @@ -182,7 +182,7 @@ #define HAL_THREAD_INIT_CONTEXT( _sparg_, _thread_, _entry_, _id_ ) \ CYG_MACRO_START \ - register CYG_WORD* _sp_ = ((CYG_WORD*)((_sparg_) &~15)); \ + register CYG_WORD* _sp_ = ((CYG_WORD*)(((CYG_ADDRWORD)(_sparg_)) &~15)); \ register CYG_WORD *_fpspace_ = NULL; \ register HAL_SavedRegisters *_regs_; \ \ diff -urN ecos-2006-05-13/packages/redboot/current/src/main.c ecos/packages/redboot/current/src/main.c --- ecos-2006-05-13/packages/redboot/current/src/main.c 2006-05-13 15:55:52.000000000 -0400 +++ ecos/packages/redboot/current/src/main.c 2006-05-13 16:23:38.000000000 -0400 @@ -397,7 +397,7 @@ CYGACC_CALL_IF_SET_CONSOLE_COMM(cur); // set up a temporary context that will take us to the trampoline - HAL_THREAD_INIT_CONTEXT((CYG_ADDRWORD)workspace_end, + HAL_THREAD_INIT_CONTEXT(workspace_end, breakpoint, trampoline,0); // switch context to trampoline (get GDB stubs started) @@ -597,7 +597,7 @@ HAL_ICACHE_INVALIDATE_ALL(); HAL_DCACHE_INVALIDATE_ALL(); // set up a temporary context that will take us to the trampoline - HAL_THREAD_INIT_CONTEXT((CYG_ADDRWORD)workspace_end, + HAL_THREAD_INIT_CONTEXT(workspace_end, entry, trampoline, 0); // switch context to trampoline --------------090707000602020000020403 Content-Type: text/plain; charset=us-ascii Content-length: 148 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss --------------090707000602020000020403--