[coreboot] patch: init gx cache earlier.

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Mon Feb 4 10:35:10 CET 2008


On 04.02.2008 10:24, Stefan Reinauer wrote:
> Carl-Daniel Hailfinger wrote:
>
>> Sorry, I can't find such an option in v2 and the svn log also didn't
>> turn up any hits. Could you point me to a specific file and/or revision?
>> I have a (wrong due to varargs for vtxprintf) prototype patch for v3:
>>
>> Index: lib/console.c

>> ===================================================================
>> --- lib/console.c    (Revision 571)
>> +++ lib/console.c    (Arbeitskopie)
>> @@ -7,6 +7,8 @@
>>  int vtxprintf(void (*)(unsigned char, void *arg),          void
>> *arg, const char *, va_list);
>>  
>> +#define rdtscl(low) __asm__ __volatile__ ("rdtsc" : "=a" (low) : :
>> "edx")
>> +
>>  static int console_loglevel(void)
>>  {
>>      return CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
>> @@ -34,11 +36,15 @@
>>  {
>>      va_list args;
>>      int i;
>> +    u32 tstamp;
>>  
>>      if (msg_level > console_loglevel()) {
>>          return 0;
>>      }
>>  
>> +    rdtscl(tstamp);
>> +    vtxprintf(console_tx_byte, (void *)0, "[tsc %d] ", tstamp);
>> +
>>      va_start(args, fmt);
>>      i = vtxprintf(console_tx_byte, (void *)0, fmt, args);
>>      va_end(args);
>>   
>
> NACK! x86 Assembler code (that only works on x86 cpus with a TSC) in
> generic C code is an absolute no-go! If this is supposed to go in at
> any later time please change it.

Fully agreed. This was just a debugging hack. I'd love to do this in a
generic way. Do you know where/when/whether we had printk timestamps in v2?


Regards,
Carl-Daniel




More information about the coreboot mailing list