From: Stuart B. <zu...@us...> - 2008-02-23 16:44:30
|
Update of /cvsroot/hppaqemu/hppaqemu/linux-user In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv9809 Modified Files: elfload.c Log Message: Store argc in gr25, argv in gr24 and the entry point in gr31. Index: elfload.c =================================================================== RCS file: /cvsroot/hppaqemu/hppaqemu/linux-user/elfload.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- elfload.c 18 Feb 2008 05:24:48 -0000 1.6 +++ elfload.c 23 Feb 2008 16:44:14 -0000 1.7 @@ -465,9 +465,15 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) { - regs->iaoq[0] = infop->entry; - regs->iaoq[1]= regs->iaoq[0] + 4; - regs->gr[30] = infop->start_stack ; + abi_ulong stack = infop->start_stack; + abi_ulong entry = infop->entry; + + regs->iaoq[0] = entry; + regs->iaoq[1] = entry + 4; + get_user_ual(regs->gr[25], stack); /* argc */ + get_user_ual(regs->gr[24], stack + 4); /* argv */ + regs->gr[30] = stack; + regs->gr[31] = entry; } #endif |