[U-Boot] show_boot_progress
Albert ARIBAUD
albert.u.boot at aribaud.net
Wed Feb 19 11:32:24 CET 2014
Hi Abdullah,
On Wed, 19 Feb 2014 11:44:26 +0200, Abdullah YILDIZ
<abdullah.mails at gmail.com> wrote:
> I use u-boot version 1.3.3.
Any reason to use a five-years-old release?
> The function call __show_boot_progress is
> defined in common/main.c as
>
> void inline __show_boot_progress (int val) {}
>
> There are many calls to this function in particular locations with
> specific parameters. But it does nothing. What is the purpose of this?
See below.
> Since I'm not a very good programmer, I also wonder the meaning of
> void inline (int val) __attribute__((weak,
> alias("__show_boot_progress")));
>
> Is it a directive to the compiler?
Yes, it is.
It tells the compiler that the function name 'show_boot_progress'
actually refers to function '__show_boot_progress', but that if
someother part of the program defines an actual function called
'show_boot_progress', then that definition is "strong" and will
replace the "weak" definition.
This is a common way to define a generic functionality where some
functions should be adapted on specific architectures or even boards.
Here, the boot progress framework defines a function to call to show
boot progress, but each board will have its own way of presenting that
progress to the board operator, and will implement is own "strong"
show_boot_progress function for this.
> abdullah
Amicalement,
--
Albert.
More information about the U-Boot
mailing list