[Prism54-devel] New FreeMAC snapshot

Sebastien sebastien.bourdeauducq at gmail.com
Mon Sep 26 18:20:12 UTC 2005


Hello,

> I made a patch which allows for freemac compilation without
> any support from C library. I simply added all required
> C functions to libc.c.

Thanks for the patch ! That's a good idea, since it will allow us to 
remove unneeded code in the libc as the space is very limited.

> Division/modulo asm routines are in disi.s.
> Name is from "di" - 64bit ones and "si" -32bit ones).
> If you don't like it, feel free to rename (libc_asm.s?).

Ok for the name.

> I wasn't able to find comprehensible source of these
> routines in newlib (too convoluted with macros) and thus
> I obtained them just by disassembling a test program
> with one division and one modulo.

That's *very* dirty, from the technical point of view ("static" code 
which won't match the compiler flags, hard to understand and to modify 
code) as well from the philosophical point of view (can we really call 
that kludge "free and open source software" ?).

Can't we get those functions somewhere else, if newlib is really 
unreadable ?

> I disabled long long handling in vsnprintf and 64bit
> routines in disi.s. It adds quite a bit of code
> (which is going to be a dead code anyway, we won't
> ever use 64bit ints in freemac I guess).

Perhaps we will, for clocks ?

By the way, it's no use to add "#ifdef UNUSED" around functions that are 
never called : the compiler automatically strips them off the resulting 
binary, AFAIK.

> I think vsnprintf can be moved into libc.c.

Hmm... shouldn't we split the minimal libc into several files ?

Sebastien


More information about the Prism54-devel mailing list