From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6348 invoked by alias); 12 Oct 2013 15:19:51 -0000 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 Received: (qmail 6336 invoked by uid 89); 12 Oct 2013 15:19:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 12 Oct 2013 15:19:49 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VV0ym-0005kc-VZ for ecos-discuss@ecos.sourceware.org; Sat, 12 Oct 2013 17:19:44 +0200 Received: from c-24-118-110-103.hsd1.mn.comcast.net ([24.118.110.103]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Oct 2013 17:19:44 +0200 Received: from grant.b.edwards by c-24-118-110-103.hsd1.mn.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Oct 2013 17:19:44 +0200 To: ecos-discuss@ecos.sourceware.org From: Grant Edwards Date: Sat, 12 Oct 2013 15:19:00 -0000 Message-ID: References: <1381533382.4474.15.camel@saturn> User-Agent: slrn/1.0.1 (Linux) X-IsSubscribed: yes Subject: [ECOS] Re: Question about CYG_HAL_TABLE usage X-SW-Source: 2013-10/txt/msg00009.txt.bz2 On 2013-10-11, Daniel Helgason wrote: > On Fri, 2013-10-11 at 21:48 +0000, Grant Edwards wrote: >> I'm working with an app that uses the CYG_HAL_TABLE macros for seveal >> different purposes. I've always thought that the "END" label was at >> the end of the "array" of objects, such that you can iterate a table >> like this: >> >> >> for (p = __foo_TAB__; p < __foo_TAB_END__; ++p) >> { >> // process object pointed to by p >> } >> >> But this seems not to be the case. At least for Cortex M3 targets >> The END label is aligned on an 8-byte boundary so that there may be >> up to 7 bytes of padding between the end of the table and the END >> label... > > Yes, 8-byte alignment is the default alignment for entries in the > tables. > > Check out hal/common/current/include/hal_tables.h and in particular > CYG_HAL_TABLE_TYPE macro. That should fix the problem. Thanks! I don't know how I missed that. Actually I do know: it has to do with the practice of nesting preprocessor macros 6 deep before you get to actual code. But, I guess if it weren't for the multiple layers of misdirection, you would end up having to use gnu binutils and gcc for building eCos instead of being able to use any toolchain you wanted. ;) -- Grant -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss