From: Daniel Schwierzeck Date: Sun, 11 Aug 2013 21:39:02 +0200 Subject: [U-Boot] [PATCH v3 2/8] MIPS: bootm: optimize kernel entry call In-Reply-To: <1376249948-3215-1-git-send-email-daniel.schwierzeck@gmail.com> References: <1376249948-3215-1-git-send-email-daniel.schwierzeck@gmail.com> Message-ID: <1376249948-3215-3-git-send-email-daniel.schwierzeck@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Fix signature of kernel entry function. Mark the kernel entry with __noreturn for better code optimisation. Signed-off-by: Daniel Schwierzeck --- Changes in v3: None Changes in v2: None arch/mips/lib/bootm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index e7aa11a..692f7dc 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -69,20 +69,17 @@ static void boot_prep_linux(bootm_headers_t *images) static void boot_jump_linux(bootm_headers_t *images) { - void (*theKernel) (int, char **, char **, int *); + typedef void __noreturn (*kernel_entry_t)(int, ulong, ulong, ulong); + kernel_entry_t kernel = (kernel_entry_t) images->ep; - /* find kernel entry point */ - theKernel = (void (*)(int, char **, char **, int *))images->ep; - - debug("## Transferring control to Linux (at address %08lx) ...\n", - (ulong) theKernel); + debug("## Transferring control to Linux (at address %p) ...\n", kernel); bootstage_mark(BOOTSTAGE_ID_RUN_OS); /* we assume that the kernel is in place */ printf("\nStarting kernel ...\n\n"); - theKernel(linux_argc, linux_argv, linux_env, 0); + kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, 0); } int do_bootm_linux(int flag, int argc, char * const argv[], -- 1.8.1.2