|
From: Jake H. <jh...@an...> - 2004-10-09 04:12:19
|
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. 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. -- Jake Hamby |