From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?David_M=c3=bcller_=28ELSOFT_AG=29?= Date: Wed, 10 Feb 2016 08:57:38 +0100 Subject: [U-Boot] [PATCH 1/4] arm: make sure board_init_r() is being called using the right mode (ARM / THUMB) In-Reply-To: <20160209170354.GO11375@bill-the-cat> References: <1455032911-29001-1-git-send-email-d.mueller@elsoft.ch> <1455032911-29001-2-git-send-email-d.mueller@elsoft.ch> <20160209170354.GO11375@bill-the-cat> Message-ID: <56BAED72.9090901@elsoft.ch> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Tom Rini wrote: > On Tue, Feb 09, 2016 at 04:48:28PM +0100, David M?ller wrote: >> /* call board_init_r */ >> +#if defined(CONFIG_SYS_THUMB_BUILD) >> + ldr lr, =board_init_r /* this is auto-relocated! */ >> + bx lr >> +#else >> ldr pc, =board_init_r /* this is auto-relocated! */ >> - >> +#endif >> /* we should not return here. */ >> #endif > > In general, my preference is always to use the thumb compatible way, can > you rework like that and explain in the commit message? Thanks! AFAIK, the "bx" instruction is undefined on non-THUMB capable architectures. I therefore don't see a way to avoid some kind of #if/#else/#endif construct. Dave