[coreboot] [PATCH] [RFC] sata PHY settings callback on SB700

Stefan Reinauer stefan.reinauer at coresystems.de
Tue Sep 21 19:03:43 CEST 2010


 On 9/21/10 6:19 AM, Peter Stuge wrote:
> Bao, Zheng wrote:
>> I am not quite familiar with the attribute weak. It seems to be a
>> good way.
> Normally if two functions have the same name the linker will abort
> with an error. If one function is weak then it will be removed, and
> the non-weak function will be used.
>
> It is good and bad. It allows to override a general function easily,
> but on the other hand it may be difficult to determine which code is
> actually being used, when many functions have the same name.
If a weak function is not defined there will be no linker error... Thus,
in order to give a board an easy way to define a platform specific
(reboot) function in FILO, we used:

void filo_reset_handler(void)
{
void __attribute__((weak)) platform_reboot(void);

if (platform_reboot)
platform_reboot();
else
printf("Rebooting not supported.\n");

}

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