From: Kristian V. D. V. <va...@li...> - 2004-10-11 18:50:47
|
On Saturday 09 October 2004 5:12 am, Jake Hamby wrote: > One more patch for today. I tried building the kernel with "-O2" > instead of "-O3" and got an illegal instruction crash at the beginning > of the init process (before it prints anything). I looked at the > difference in assembly output in kernel/init.c and noticed that the > Fork() function is inlined under -O3. Since Fork() doesn't seem to be > used anywhere outside of init.c, I changed it to a static inline > function and commented out the prototype in include/atheos/kernel.h. > This fixed the problem, and makes things cleaner since the function > consists of only a single line of inline asm. Applied. > BTW, I would suggest using CFLAGS of "-O2 -mpreferred-stack-boundary=2", > as Linux and FreeBSD do, instead of "-O3" when building the kernel > because smaller code size is generally more important than the > additional inlining. Using the "size" command on kernel.so, I get a > text size (data and bss sizes are the same) of: > > 378602 bytes for -O3 > 363546 bytes for -O2 -mpreferred-stack-boundary=2 > > for a savings of 15K or about 4%. Anyway, here's the patch. Not a bad idea, so that's been done too. Thanks Jack :) -- Vanders http://syllable.sourceforge.net/ http://www.liqwyd.com |