From: Peter Tyser Date: Fri, 06 Feb 2009 15:53:03 -0600 Subject: [U-Boot] [PATCH v2][RFC] Add native win32 mkimage support In-Reply-To: <200902061640.49327.vapier@gentoo.org> References: <1233955321-23069-1-git-send-email-ptyser@xes-inc.com> <200902061640.49327.vapier@gentoo.org> Message-ID: <1233957183.6434.5534.camel@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 2009-02-06 at 16:40 -0500, Mike Frysinger wrote: > On Friday 06 February 2009 16:22:01 Peter Tyser wrote: > > Add a mkimage_win32.exe build target which can produce a native > > win32 mkimage executable using the MinGW toolchain. The > > mkimage_win32.exe binary is generated when the MINGW_COMPILE > > environment variable is defined. The mkimage_win32.exe binary > > can be used by those who use Windows as an OS build environment > > but don't use cygwin. > > having to set magic env vars for one specific target kind of sucks. isnt > there another way to do this ? If others have a more clever way to do it I'd be happy to implement. I couldn't think of a way to cross compile for 2 non-native targets (u-boot target and windows) without setting 2 variables. I agree its a bit hokey though:) FWIW I generally only have CROSS_COMPILE set in my environment and then run "make MINGW_COMPILE=i586-mingw32msvc-" when I want to generate a new mkimage_win32.exe. > > +uint16_t bswap_16(uint16_t __x) > > +{ > > + return (__x >> 8) | (__x << 8); > > +} > > + > > +uint32_t bswap_32(uint32_t __x) > > +{ > > + return (bswap_16(__x & 0xffff) << 16) | (bswap_16(__x >> 16)); > > +} > > + > > +uint64_t bswap_64(uint64_t __x) > > +{ > > + return (((uint64_t) bswap_32(__x & 0xffffffff)) << 32) | > > + (bswap_32(__x >> 32)); > > +} > > we already have random duplicate copies of these floating around, and not > related to Windows. these funcs are really only reliable on Linux. like the > attached i'm using in my own tree. I don't follow. Are you suggesting I include a generic version in a header similar to the uswap.h you mentioned? Or are you suggesting the current implementation is prone to break? Or both? Best, Peter