From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fuchs Date: Sat, 19 Apr 2008 19:22:53 +0200 Subject: [U-Boot-Users] =?iso-8859-1?q?=5BPATCH=5D_cfi-flash=3A=09Add=3FCF?= =?iso-8859-1?q?G=5FFLASH=5FAUTOPROTECT=5FLIST?= In-Reply-To: <20080419153342.GA12162@game.jcrosoft.org> References: <200804181629.40697.matthias.fuchs@esd-electronics.com> <200804191650.32303.matthias.fuchs@esd-electronics.com> <20080419153342.GA12162@game.jcrosoft.org> Message-ID: <200804191922.53883.matthias.fuchs@esd-electronics.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, I tried this in cfi_flash.c: struct apl_s { ulong start; ulong size; } struct apl_s apl[] __attribute__((weak)) = {}; I added a redeclaration of apl into my board code. Now I ran into the problem that the ARRAY_SIZE macro on apl in cfi_flash.c does not take care of the redeclation. So it evaluated to 0 instead of the real size of the array from my board code. Now I could a) add a delimiter to the apl array (e.g. size=0 for the last entry) b) implement Stefan approach c) ??? Any idea? Matthias On Saturday 19 April 2008 17:33:43 Jean-Christophe PLAGNIOL-VILLARD wrote: > On 16:50 Sat 19 Apr , Matthias Fuchs wrote: > > Hi Stefan, > > > > I could also life with your approach, but it will add code > > even to platforms that do not use the new option. > > > > In this case I would prefer it against the weak implementation. > > I've already answer about it to Timur in this e-mail > http://article.gmane.org/gmane.comp.boot-loaders.u-boot/37814/match=weak > > I'm preparing a path about adding this define > > import compiler-gcc header from linux and add > > #ifndef __weak_alias > #ifndef __weak_alias(fct) __attribute__((weak,alias(#fct))) > #endif > > so just add __weak to your default stucture and overwrite in the board > > Best Regards, > J. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/java >one _______________________________________________ > U-Boot-Users mailing list > U-Boot-Users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/u-boot-users -- ------------------------------------------------------------------------- Dipl.-Ing. Matthias Fuchs Head of System Design esd electronic system design gmbh Vahrenwalder Str. 207 - 30165 Hannover - GERMANY Phone: +49-511-37298-0 - Fax: +49-511-37298-68 Please visit our homepage http://www.esd.eu Quality Products - Made in Germany ------------------------------------------------------------------------- Gesch?ftsf?hrer: Klaus Detering, Dr. Werner Schulze Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832 -------------------------------------------------------------------------