[U-Boot-Users] [PATCH] Fix ARM compilation error

Anders Larsen alarsen at rea.de
Fri Oct 7 16:33:24 CEST 2005


Hi,

the patch below eliminates two calls of the libgcc helper functions
_divsi3 and _modsi3 when using a (standard) Hardware-FP toolchain
(the unsigned counterparts _udivsi3 and _umodsi3 are already included
in libarm.a).

"For historical reasons", the ARM community uses toolchains built
for hardware-FP, even though so far no ARM CPU comes with FPU.
Go figure.

Cheers
 Anders

Signed-off-by: Anders Larsen <alarsen at rea.de>

CHANGELOG:
  Fixed compilation for ARM when using a (standard) Hard-FP toolchain
  Patch by Anders Larsen, 07 Oct 2005 

---

 drivers/cfi_flash.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c
--- a/drivers/cfi_flash.c
+++ b/drivers/cfi_flash.c
@@ -221,7 +221,7 @@ static void flash_printqry (flash_info_t
 	cfiptr_t cptr;
 	int x, y;
 
-	for (x = 0; x < 0x40; x += 16 / info->portwidth) {
+	for (x = 0; x < 0x40; x += 16U / info->portwidth) {
 		cptr.cp =
 			flash_make_addr (info, sect,
 					 x + FLASH_OFFSET_CFI_RESP);
@@ -807,7 +807,7 @@ static void flash_make_cmd (flash_info_t
 #else
 	for (i = 1; i <= info->portwidth; i++)
 #endif
-		*cp++ = (i % info->chipwidth) ? '\0' : cmd;
+		*cp++ = (i & (info->chipwidth - 1)) ? '\0' : cmd;
 }
 
 /*





More information about the U-Boot mailing list