From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Wed, 19 Feb 2014 11:32:24 +0100 Subject: [U-Boot] show_boot_progress In-Reply-To: References: Message-ID: <20140219113224.72175364@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Abdullah, On Wed, 19 Feb 2014 11:44:26 +0200, Abdullah YILDIZ 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.