[coreboot] locking...

Stefan Reinauer stepan at coresystems.de
Sat Jun 20 00:47:22 CEST 2009


Carl-Daniel Hailfinger wrote:
>> v2 has / used to have working locking code since it was first ported to
>> opteron. It may be that it broke while adding 5 more printks but it is
>> there somewhere.
>>   
>>     
>
> Any hints on where to look are appreciated. I'd like to use locking
> inside printk ASAP.
>   

Where does the locking algorithm fail? My guess is, it's in romcc or CAR
code. Where we are out of luck with all approaches of synchronization so
far.

do_printk is defined in src/console/printk.c as:

int do_printk(int msg_level, const char *fmt, ...)
{
        va_list args;
        int i;

        if (msg_level >= console_loglevel) {
                return 0;
        }

        spin_lock(&console_lock);

        va_start(args, fmt);
        i = vtxprintf(console_tx_byte, fmt, args);
        va_end(args);

        console_tx_flush();

        spin_unlock(&console_lock);

        return i;
}

(we should just rename this to printk and use it the v3 way instead of
the printk_<loglevel> layers on top, but that's orthogonal, too)



Stefan


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





More information about the coreboot mailing list