[LinuxBIOS] support PIC and prototypes

ron minnich rminnich at gmail.com
Wed Aug 29 23:36:31 CEST 2007

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;

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.

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?


More information about the coreboot mailing list