Hello All,
I ran into an issue with the Redboot "exec" command on an ARM-based platform. 
After copying the downloaded kernel to the entry address, the PC was getting 
set to an incorrect entry address thereby causing the kernel decompression step 
to fail.
 
On further debugging, I found that Register r2 was being used to store the 
"entry" input operand in the inline assembly code at the end of the do_exec() 
function. 

r2 is also used to store the Linux kernel parameters, I have attached a patch 
to fix this issue.
 
Best Regards,
-Mahesh                                           
_________________________________________________________________
The latest songs, trailers and more
http://video.in.msn.com/  
From 6d371b4f6dabc768d5c181f8f5ec753df773887d Mon Sep 17 00:00:00 2001
From: Mahesh Mahadevan <[email protected]>
Date: Mon, 8 Mar 2010 13:00:26 -0600
Subject: [PATCH] Add r2 to clobber list to avoid using r2 to store the input 
operands

Signed-off-by: Mahesh Mahadevan <[email protected]>
---
 .../hal/arm/arch/current/src/redboot_linux_exec.c  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/packages/hal/arm/arch/current/src/redboot_linux_exec.c 
b/packages/hal/arm/arch/current/src/redboot_linux_exec.c
index 62665d0..386dfce 100755
--- a/packages/hal/arm/arch/current/src/redboot_linux_exec.c
+++ b/packages/hal/arm/arch/current/src/redboot_linux_exec.c
@@ -528,7 +528,7 @@ do_exec(int argc, char *argv[])
         "r"(CYGARC_PHYSICAL_ADDRESS(CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS)),
         "r"(CYGARC_PHYSICAL_ADDRESS(CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS)),
         "r"(system_rev)
-        : "r0", "r1"
+        : "r0", "r1", "r2"
         );
 }
       
-- 
1.6.0.4

Reply via email to