mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@kymetacorp.com>
To: barebox <barebox@lists.infradead.org>
Subject: [PATCH] ARM: Remove do_execute and thumb2_execute
Date: Fri, 4 Dec 2015 19:24:19 +0000	[thread overview]
Message-ID: <1449257064.26955.20.camel@rtred1test09.kymeta.local> (raw)

In commit 104a6a7ccfb7928ca5dc28c8cbe0ea231ffc45ee support was added
for Thumb2.  It added do_execute() as a way to provide arch dependent
calling veneers for use in "go" and thumb2_execute() as the thumb2 to
arm veneer.

But thumb2_execute() isn't necessary as gcc generates a proper calling
sequence from a standard function pointer call.  Thumb2 barebox is
compiled with the AAPCS ABI which requires this.

It also had a bug and didn't pass the arguments properly, but code
execute via "go" rarely uses arguments so this wasn't very noticeable.

Since thumb2 was always the only user of do_execute(), go ahead and
delete that too.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
---
 arch/arm/cpu/cpu.c | 26 --------------------------
 commands/go.c      |  5 +----
 common/misc.c      |  3 ---
 include/common.h   |  6 ------
 4 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/arch/arm/cpu/cpu.c b/arch/arm/cpu/cpu.c
index e8191ec..eb12166 100644
--- a/arch/arm/cpu/cpu.c
+++ b/arch/arm/cpu/cpu.c
@@ -121,29 +121,3 @@ static int arm_request_stack(void)
 	return 0;
 }
 coredevice_initcall(arm_request_stack);
-
-#ifdef CONFIG_THUMB2_BAREBOX
-static void thumb2_execute(void *func, int argc, char *argv[])
-{
-	/*
-	 * Switch back to ARM mode before executing external
-	 * programs.
-	 */
-	__asm__ __volatile__ (
-		"mov r0, #0\n"
-		"mov r1, %0\n"
-		"mov r2, %1\n"
-		"bx %2\n"
-		:
-		: "r" (argc - 1), "r" (&argv[1]), "r" (func)
-		: "r0", "r1", "r2"
-	);
-}
-
-static int execute_init(void)
-{
-	do_execute = thumb2_execute;
-	return 0;
-}
-postcore_initcall(execute_init);
-#endif
diff --git a/commands/go.c b/commands/go.c
index f25db48..fb319b3 100644
--- a/commands/go.c
+++ b/commands/go.c
@@ -60,10 +60,7 @@ static int do_go(int argc, char *argv[])
 
 	shutdown_barebox();
 
-	if (do_execute)
-		do_execute(func, argc - 1, &argv[1]);
-	else
-		func(argc - 1, &argv[1]);
+	func(argc - 1, &argv[1]);
 
 	/*
 	 * The application returned. Since we have shutdown barebox and
diff --git a/common/misc.c b/common/misc.c
index 5532349..8b2417b 100644
--- a/common/misc.c
+++ b/common/misc.c
@@ -130,9 +130,6 @@ void perror(const char *s)
 }
 EXPORT_SYMBOL(perror);
 
-void (*do_execute)(void *func, int argc, char *argv[]);
-EXPORT_SYMBOL(do_execute);
-
 static char *model;
 
 /*
diff --git a/include/common.h b/include/common.h
index 03ceec2..38a6dbf 100644
--- a/include/common.h
+++ b/include/common.h
@@ -113,12 +113,6 @@ extern int (*barebox_main)(void);
 void __noreturn start_barebox(void);
 void shutdown_barebox(void);
 
-/*
- * architectures which have special calling conventions for
- * executing programs should set this. Used by the 'go' command
- */
-extern void (*do_execute)(void *func, int argc, char *argv[]);
-
 int run_shell(void);
 
 #ifdef CONFIG_SHELL_HUSH
-- 
1.8.3.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2015-12-04 19:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 19:24 Trent Piepho [this message]
2015-12-07  9:45 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449257064.26955.20.camel@rtred1test09.kymeta.local \
    --to=tpiepho@kymetacorp.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox