Carl-Daniel Hailfinger wrote:
> v3 can't use global variables in stage1 or initram. Same applies to
> static local variables. See the bug below.
>
> Ideas for fixes? The generic variable infrastructure would be one option.
>   

Just call smbus_init() prior to calling smbus_read_byte() the first
time. The variable infrastructure might be a nice idea for some things,
but I think in cases as simple as this, we should not rely on it.

Is there a method to change variables in your "variable infrastructure"
across cpus? If so, it could be useful for semaphores / locking. But I
don't think that's possible since the stuff is in cache, right?
> int smbus_read_byte(u16 device, u8 address)
> {
>       //BUG here!
>       static int first_time = 1;
>
>       if (first_time) {
>               smbus_init();
>               first_time = 0;
>       }
>
>       return do_smbus_read_byte(SMBUS_IO_BASE, device, address);
> }
>
> Regards,
> Carl-Daniel
>
>   


-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [EMAIL PROTECTED]  • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866



--
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to