From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYfid-0000ZY-7z for qemu-devel@nongnu.org; Thu, 08 Dec 2011 10:17:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYfiX-0003Zx-MI for qemu-devel@nongnu.org; Thu, 08 Dec 2011 10:17:07 -0500 Received: from mout.web.de ([212.227.15.3]:57804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYfiX-0003ZZ-6e for qemu-devel@nongnu.org; Thu, 08 Dec 2011 10:17:01 -0500 Message-ID: <4EE0D4AD.5060604@web.de> Date: Thu, 08 Dec 2011 16:15:57 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1323321912-15922-1-git-send-email-khansa@kics.edu.pk> <1323321912-15922-2-git-send-email-khansa@kics.edu.pk> In-Reply-To: <1323321912-15922-2-git-send-email-khansa@kics.edu.pk> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] linux-user:Support for MIPS64 user mode emulation in QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: khansa@kics.edu.pk Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, qemu-devel@nongnu.org, aurelien@aurel32.net This is about QEMU and linux-user is the user mode emulation, so please change the subject to "linux-user: Add support for MIPS64" (note the space that I reminded you of earlier, it looks weird without on Western left-to-right screens). Am 08.12.2011 06:25, schrieb khansa@kics.edu.pk: > From: Khansa Butt > As requested earlier, since this is a non-trivial change, please include a summary here of what the patch does below. Should mention that people can use it via "mips64-linux-user" and should describe syscall differences. > > Signed-off-by: Khansa Butt > --- > configure | 1 + > default-configs/mips64-linux-user.mak | 1 + > linux-user/main.c | 21 +++++++++++++++++++-- > linux-user/mips64/syscall.h | 2 ++ > 4 files changed, 23 insertions(+), 2 deletions(-) > create mode 100644 default-configs/mips64-linux-user.mak > > diff --git a/configure b/configure > index ac4840d..e31229b 100755 > --- a/configure > +++ b/configure > @@ -914,6 +914,7 @@ m68k-linux-user \ > microblaze-linux-user \ > microblazeel-linux-user \ > mips-linux-user \ > +mips64-linux-user \ > mipsel-linux-user \ I would suggest to move your addition one line down, so that mips and mipsel stay together. For linux-user IIUC the ABI is relevant, so shouldn't this be mipsn64-linux-user? We have a patch for mipsn32/mipsn32el. What about mipsn64el? > ppc-linux-user \ > ppc64-linux-user \ > diff --git a/default-configs/mips64-linux-user.mak b/default-configs/mips64-linux-user.mak > new file mode 100644 > index 0000000..1598bfc > --- /dev/null > +++ b/default-configs/mips64-linux-user.mak > @@ -0,0 +1 @@ > +# Default configuration for mips64-linux-user > diff --git a/linux-user/main.c b/linux-user/main.c > index d1bbc57..17a74cd 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -2157,7 +2157,8 @@ static int do_store_exclusive(CPUMIPSState *env) > void cpu_loop(CPUMIPSState *env) > { > target_siginfo_t info; > - int trapnr, ret; > + int trapnr; > + abi_long ret; > unsigned int syscall_num; > > for(;;) { > @@ -2166,8 +2167,23 @@ void cpu_loop(CPUMIPSState *env) > cpu_exec_end(env); > switch(trapnr) { > case EXCP_SYSCALL: > - syscall_num = env->active_tc.gpr[2] - 4000; > env->active_tc.PC += 4; > +#if defined(TARGET_MIPS64) TARGET_ABI_MIPSN64? > + syscall_num = env->active_tc.gpr[2] - 5000; > + /* MIPS64 has eight argument registers so there is > + * no need to get arguments from stack > + */ > + ret = do_syscall(env, env->active_tc.gpr[2], > + env->active_tc.gpr[4], > + env->active_tc.gpr[5], > + env->active_tc.gpr[6], > + env->active_tc.gpr[7], > + env->active_tc.gpr[8], > + env->active_tc.gpr[9], > + env->active_tc.gpr[10], > + env->active_tc.gpr[11]); > +#else > + syscall_num = env->active_tc.gpr[2] - 4000; > if (syscall_num >= sizeof(mips_syscall_args)) { > ret = -TARGET_ENOSYS; > } else { > @@ -2205,6 +2221,7 @@ void cpu_loop(CPUMIPSState *env) > env->active_tc.gpr[7], > arg5, arg6, arg7, arg8); > } > +#endif > done_syscall: > if (ret == -TARGET_QEMU_ESIGRETURN) { > /* Returning from a successful sigreturn syscall. > diff --git a/linux-user/mips64/syscall.h b/linux-user/mips64/syscall.h > index 668a2b9..96f03da 100644 > --- a/linux-user/mips64/syscall.h > +++ b/linux-user/mips64/syscall.h > @@ -218,4 +218,6 @@ struct target_pt_regs { > > > > +#define TARGET_QEMU_ESIGRETURN 255 > + > #define UNAME_MACHINE "mips64" Andreas