From a49864593e083a5d0779fb9ca98e5a0f2053183d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 13 Apr 2008 19:42:19 -0400 Subject: allow ports to override go behavior Split the arch-specific logic out of the common go code and into a dedicated weak function called do_go_exec() that lives in cpu directories. This will need review from i386/nios people to make sure I didn't break them. --- lib_nios/board.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib_nios') diff --git a/lib_nios/board.c b/lib_nios/board.c index 0a0d2e38f..cdaf753ac 100644 --- a/lib_nios/board.c +++ b/lib_nios/board.c @@ -190,3 +190,13 @@ void hang (void) puts("### ERROR ### Please reset board ###\n"); for (;;); } + +unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[]) +{ + /* + * x86 does not use a dedicated register to pass the pointer + * to the global_data + */ + argv[-1] = (char *)gd; + return entry (argc, argv); +} -- cgit v1.2.3