Date: Tue, 24 Oct 2006 22:33:48 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 108362 for review Message-ID: <200610242233.k9OMXmdE096912@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=108362 Change 108362 by gonzo@gonzo_hq on 2006/10/24 22:33:25 o Set argc & argv for __start function. o Get env and environ variables from argc & argv values. Affected files ... .. //depot/projects/mips2/src/lib/csu/mips/crt1.c#2 edit Differences ... ==== //depot/projects/mips2/src/lib/csu/mips/crt1.c#2 (text+ko) ==== @@ -51,6 +51,7 @@ #include "crtbrand.c" #include <machine/asm.h> +typedef void (*fptr)(void); struct Struct_Obj_Entry; struct ps_strings; @@ -72,24 +73,34 @@ char **environ; const char *__progname = ""; -struct ps_strings *__ps_strings; /* The entry function. */ __asm(" .text \n" " .align 8 \n" " .globl _start \n" " _start: \n" -" /* TODO: Get argc, argv, and envp from stack */ \n" +" /* Get argc, argv from stack */ \n" +" \n" +" /* lw a0, -32(sp) */\n" +" /* move a1, sp */\n" +" /* addu a1, 32 + 4 */\n" +" \n" +" lw $4, -32($29) \n" +" move $5, $29 \n" +" addu $5, 36 \n" " /* TODO: Ensure the stack is properly aligned before calling C code. */\n" "\n" " j __start "); /* ARGSUSED */ void -__start(int argc, char **argv, char **env, struct ps_strings *ps_strings, - const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void)) +__start(int argc, char **argv) { + char **env; const char *s; + /* XXXMIPS: proper set a cleanup procedure */ + fptr cleanup = NULL; + env = argv + argc + 1; environ = env; if (argc > 0 && argv[0] != NULL) { @@ -99,9 +110,6 @@ __progname = s + 1; } - if (ps_strings != (struct ps_strings *)0) - __ps_strings = ps_strings; - if (&_DYNAMIC != NULL) atexit(cleanup); else
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610242233.k9OMXmdE096912>