[coreboot] [PATCH] misc coreboot utility patches

Stefan Reinauer stepan at coresystems.de
Mon Aug 31 21:48:04 CEST 2009


On 8/31/09 9:27 PM, Peter Stuge wrote:

>> +int darwin_probe(const struct sysdef *system)
>> +{
>> +	return iopl(3) == 0;
>> +}
>>     
> Ideally this would check that system is really Darwin.
>
>   

Ah right.. I misunderstood the API.

Shouldn't the code for Darwin be only compiled into the Darwin
executable, and the code for Linux only on Linux systems?

Doing a check every time the program runs when it can be checked at
compile time seems a bit overkill, on the first thought.


>   
>>  struct cpuid_t *cpuid(void) {
>>  	uint32_t outeax;
>> +
>> +#ifdef __DARWIN__
>> +        asm volatile (
>> +                "pushl %%ebx    \n"
>> +                "cpuid          \n"
>> +                "popl %%ebx     \n"
>> +                : "=a" (outeax) : "a" (1) : "%ecx", "%edx"
>> +        );
>> +#else
>>  	asm ("cpuid" : "=a" (outeax) : "a" (1) : "%ebx", "%ecx", "%edx");
>> +#endif
>> +
>>     
> I have no problem with this, but can you explain why the manual
> push/pop is needed? Maybe the new variant is the only one we need?
>   
ebx is a reserved register on OSX/PIC


>
>   
>> -LDFLAGS=`trylink "libpci (from pciutils)" "${pc_LDFLAGS}" "-lpci -lz" "-L/usr/local/lib -lpci -lz" "-framework IOKit -L/usr/local/lib -lpci -lz"` || {
>> +LDFLAGS=`trylink "libpci (from pciutils)" "${pc_LDFLAGS}" "-lpci -lz" "-lpci -lz" "-framework IOKit -framework DirectIO -lpci -lz"` || {
>>     
> Why remove /usr/local/lib ? I'd like to have that still in there.
>   

Because the default install location for the packages is in /usr.. The
libpci in /usr/local comes from another source which is incompatible
with the one compiled with directio.

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