From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21172 invoked by alias); 22 Aug 2011 14:24:43 -0000 Received: (qmail 21144 invoked by uid 22791); 22 Aug 2011 14:24:38 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Aug 2011 14:24:10 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 6D22B2F7800A for ; Mon, 22 Aug 2011 15:24:09 +0100 (BST) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fmp1Bh5dCy-2; Mon, 22 Aug 2011 15:24:07 +0100 (BST) From: bugzilla-daemon@bugs.ecos.sourceware.org To: ecos-patches@ecos.sourceware.org Subject: [Bug 1001275] Cortex-M (armV7) architecture endian instructions / Applied on lwIP X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Patches and contributions X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: sergei.gavrikov@gmail.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Mon, 22 Aug 2011 14:24:00 -0000 Message-Id: <20110822142407.A0F222F78001@mail.ecoscentric.com> Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2011-08/txt/msg00014.txt.bz2 Please do not reply to this email. Use the web interface provided at: http://bugs.ecos.sourceware.org/show_bug.cgi?id=3D1001275 --- Comment #13 from Sergei Gavrikov 2011-08-22= 15:24:02 BST --- (In reply to comment #11) > (In reply to comment #9) [snip] > > If I understood you correctly you again returned back to CYGARC > > prefix for macros. If it is not a typo then I would add below those > > definitions (CYGARC_SWAPxx macros) in ``cortexm_endian.h'' the same > > check and far definitions (overrides) >=20 > It is a my mistake:( sorry, CYG_SWAPxx() it should be. >=20 > [snip (as it is consequence to my error)] I see, however your "mistake" would provide us two versions of CYG_SWAPxx() macros (one from hal_endian.h and another from cortex_endian.h if it's needed). Ok, let's forget it. > Here is cortexm_endian.h snippet: >=20 > #include >=20 > static __inline__ cyg_uint32 cyg_hal_swap32(cyg_uint32 original) > { > cyg_uint32 swapped; > CYGARC_REV(swapped, original); > return swapped; > } >=20 > static __inline__ cyg_uint16 cyg_hal_swap16(cyg_uint16 original) > { > cyg_uint16 swapped; > CYGARC_REV16(swapped, original); > return swapped; > } >=20 > #define CYG_SWAP32(__val) cyg_hal_swap32(__val) > #define CYG_SWAP16(__val) cyg_hal_swap16(__val) Looks okay for me. > > So, with your proposal we can leave hal_arch.h without any changes. > > Did you mean it? I read so and I guess that we have to manage the > > definition of LWIP_PLATFORM_BYTESWAP from configtool. In ideal world > > this value must be defined from lwip config file, e.g. >=20 > I can see 2 options: >=20 > Option 1. We include cortexm_endian.h in hal_arch.h (that's what i > have tested). here are all changes to hal_arch.h: >=20 > diff -u -r1.3 hal_arch.h > --- hal_arch.h 13 Feb 2009 17:04:18 -0000 1.3 > +++ hal_arch.h 22 Aug 2011 12:45:24 -0000 > @@ -55,6 +55,9 @@ >=20=20 > #include >=20=20 > +#include > +#include > +=20 >=20=20 > Option 2. Probably we can include hal_endian.h in lwipots.h (not tested). >=20 > My vote is for Option 1. since it would propagate cortexm_endian.h > everywhere (for better, or for worse) Cortex-M is used. In opposite I would avoid from "Option 1". Usually _regs.h, and hal_endian.h include inself from hal_io.h, and hal_misc.c. I liked you find, because I thought, Great! We do not need hack hal_arch.h :-) I would vote for "Option 2" and that is what I did mean in my comment 9. > > to add into lwip_net.cdl: > >=20 > > cdl_option CYGBLD_LWIP_HTONS_HTONL_INLINED { > > default_value 0 > > } > >=20 >=20 > In either case we don't need CDL. Following is what I have tested (a > patch to your input) : >=20 > > to add into lwipopts.h: > >=20 > > #if CYGPKG_LWIP_HTONS_HTONL_INLINED > -#if CYGPKG_LWIP_HTONS_HTONL_INLINED >=20 > > # include > +#ifdef CYG_SWAP32 > > # define LWIP_PLATFORM_BYTESWAP 1 > > # define LWIP_PLATFORM_HTONS(__val) CYG_SWAP16(__val) > > # define LWIP_PLATFORM_HTONL(__val) CYG_SWAP32(__val) > > #endif > >=20 > > What do you think? I see. However, in such case you make lwip stack use only the inlined versions for htonX(s). I have a doubt about such a forcing. What is a bad with CDL option? > If you agree with adding cortexm_endian.h and #include it in > hal_arch.h I could submit patches for review. >=20 > Ilija It seems to me that you can send cortexm_{regs,endian.h} for now (arch's side) and the lwip's side needs further discussion. Sergei --=20 Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.