mapped helpful functions requiring libgcc.a

Jason Gunthorpe jgg at deltatee.com
Fri Sep 17 18:03:00 EDT 1999


On Fri, 17 Sep 1999, David Woodhouse wrote:

> I've just noticed that the 'mapped' helper function write_flash(), when 
> compiled with 2.3.17, requires __divdi3 and __moddi3 from libgcc.a 

I'm confused why GCC would not just emit code that performed these
operations instead of using these helper functions - there is nothing
special about them. It sounds like a compiler bug really.
 
Jason
> This is because of these two lines (just after line 500, at the beginning of 
> flash_write):
> 
>       // Compute the page offset and reposition
>       base = map->page(map,start/map->pagesize);
>       off = start %  map->pagesize;
> 
> Given that our map window is always going to be a power of two, I suggest that 
> we ought to use shifts instead of div/mod here, and change mapsize to be a 
> logarithm instead of the actual size.



To unsubscribe, send "unsubscribe mtd" to majordomo at imladris.demon.co.uk



More information about the linux-mtd mailing list