[LinuxBIOS] support PIC and prototypes
peter at stuge.se
Thu Aug 30 00:15:48 CEST 2007
On Wed, Aug 29, 2007 at 02:36:31PM -0700, ron minnich wrote:
> Here is a proposal for supporting pic etc. without too much hardship.
> we create a file, include/lib.h, and move all prototypes to that file.
> That file is included by non-pic code, and has declarations like this:
> int printk(int level, char *format, ...);
> We create another file, call libpic.h, and it looks like this:
> int (*printk)(int level, char *format, ...) = stage0printk;
Please don't use stage0 to tag the PIC code, use pic instead.
stage0printk would become picprintk, or maybe pic_printk.
> PIC programs include libpic.h. non-PIC programs include lib.h.
> At build time, for PIC programs, we use that little trick I showed
> earlier to create a stag0_pic.o with symbols renamed, e.g. printk
> becomes stage0printk.
I would like that file to be called just pic.o and be unrelated to
anything stage0 - except of course that stage0 calls the code in
> non-PIC programs (e.g. stage2) link against stage0.o as they do
> now. PIC programs link against stage0_pic.o.
> This will work; is it acceptable?
I think the method is great but I want to choose all filenames
carefully so it is really clear what is going on.
Btw - why couldn't everyone call the PIC functions?
More information about the coreboot