[LinuxBIOS] patch: extending LAR, and removing elf from linuxbios (it is not needed)

ron minnich rminnich at gmail.com
Wed Aug 29 20:32:15 CEST 2007


On 8/29/07, Uwe Hermann <uwe at hermann-uwe.de> wrote:
> On Wed, Aug 29, 2007 at 09:20:05AM -0700, ron minnich wrote:
> > Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>===================================================================
>
> What's up with that "============" line?

my mistake.

>
>
> > --- lib/lar.c (revision 480)
> > +++ lib/lar.c (working copy)
> > @@ -31,6 +31,13 @@
> >  #define ntohl(x) (x)
> >  #endif
> >
> > +int run_address(void *f)
> > +{
> > +     int (*v) (void);
> > +     v = f;
> > +     return v();
> > +}
>
> Add a doxygen comment please.

done. Please note that I did not write this stuff, there were never
comments in there :-)

>
>
> >  int find_file(struct mem_file *archive, char *filename, struct mem_file *result)
>
> Same here.

done.
>
> filename can be 'const char *filename' I guess.

done. The next patch will include a patch to lar.h for this change.

> > +                     result->entry = (void *)ntohl(header->entry);
> > +                     result->loadaddress = (void *)ntohl(header->loadaddress);
>
> Just curious, is the cast to (void *) really needed?

yes. ntohl is a long. To get to void * you need the cast.

> > +void *load_file(struct mem_file *archive, char *filename)
>
> Add doxygen comment, please.


done

> > +             return (void *)-1;
>
> Uh? What is '(void *)-1' supposed to be? Will that work? Is the cast needed?

(void *)-1 is a commonly used synonym for "bad address". It's the most
portable way to indicate a bad address.

> > -
> > +     printk(BIOS_SPEW, "where is %p\n", where);
> >       v = where;
> > -     return v();
> > +     ret =  v();
>              ^^
> Two spaces where only one should be.

fixed.

new patch attached.

ron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixlar.diff
Type: text/x-patch
Size: 4799 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20070829/180ea42b/attachment.diff>


More information about the coreboot mailing list