Skip to contentSkip to conversation

ARM: fix the standalone programs

PATCH New Jeroen Hofstee 2 participants 2 messages Nov 21, 2013 – Dec 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: fix the standalone programs

The standalone programs do not use the api calls, but rely directly on u-boot variable gd->jt for the jump table. Commit fe1378a - "ARM: use r9 for gd" changed the register holding the address of gd, but the assembly code in the standalone examples was not updated accordingly. This broke the programs on ARM relying on the jumptable in the v2013.10 release. This patch unbricks them by using the correct register.

Cc Michal Simek <[email protected]>
Cc Albert ARIBAUD <[email protected]>
---
 examples/standalone/stubs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
examples/standalone/stubs.c +2 -2
index 8fb1765..5d2ab56 100644
@@ -40,14 +40,14 @@ gd_t *global_data;
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r11");
 #elif defined(CONFIG_ARM)
 /*
- * r8 holds the pointer to the global_data, ip is a call-clobbered
+ * r9 holds the pointer to the global_data, ip is a call-clobbered
  * register
  */
 #define EXPORT_FUNC(x) \
 	asm volatile (			\
 "	.globl " #x "\n"		\
 #x ":\n"				\
-"	ldr	ip, [r8, %0]\n"		\
+"	ldr	ip, [r9, %0]\n"		\
 "	ldr	pc, [ip, %1]\n"		\
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "ip");
 #elif defined(CONFIG_MIPS)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 ARM: fix the standalone programs

Hi Jeroen,

Quoted 26 lines · Jeroen Hofstee

The standalone programs do not use the api calls, but rely directly on u-boot variable gd->jt for the jump table. Commit fe1378a - "ARM: use r9 for gd" changed the register holding the address of gd, but the assembly code in the standalone examples was not updated accordingly. This broke the programs on ARM relying on the jumptable in the v2013.10 release. This patch unbricks them by using the correct register.

Cc Michal Simek <[email protected]>
Cc Albert ARIBAUD <[email protected]>
---
 examples/standalone/stubs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
examples/standalone/stubs.c +1 -1
index 8fb1765..5d2ab56 100644
@@ -40,14 +40,14 @@ gd_t *global_data;
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r11");
 #elif defined(CONFIG_ARM)
 /*
- * r8 holds the pointer to the global_data, ip is a call-clobbered
+ * r9 holds the pointer to the global_data, ip is a call-clobbered
  * register

examples/standalone/stubs.c gd_t *global_data; · line 53

Quoted 10 lines
examples/standalone/stubs.c +1 -1
  */
 #define EXPORT_FUNC(x) \
 	asm volatile (			\
 "	.globl " #x "\n"		\
 #x ":\n"				\
-"	ldr	ip, [r8, %0]\n"		\
+"	ldr	ip, [r9, %0]\n"		\
 "	ldr	pc, [ip, %1]\n"		\
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "ip");
 #elif defined(CONFIG_MIPS)

Applied to u-boot-arm/master, thanks!

Amicalement,

Signature · 1 line
Albert.