[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/23] bsd-user: add initial support for mips/mi
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 02/23] bsd-user: add initial support for mips/mips64 |
Date: |
Mon, 24 Jun 2013 18:15:12 +0100 |
On 24 June 2013 03:03, Stacey Son <address@hidden> wrote:
> Add the main cpu loop, cpu_loop(), for mips and mips64 architecture. Set the
> cpu model. Add some stubs for future code.
>
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -2,6 +2,7 @@
> * qemu user main
> *
> * Copyright (c) 2003-2008 Fabrice Bellard
> + * Copyright (c) 2013 Stacey Son
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License as published by
> @@ -23,6 +24,7 @@
> #include <errno.h>
> #include <unistd.h>
> #include <machine/trap.h>
> +#include <sys/syscall.h>
> #include <sys/types.h>
> #include <sys/mman.h>
>
> @@ -387,6 +389,172 @@ void cpu_loop(CPUX86State *env)
> }
> #endif
>
> +#if defined(TARGET_MIPS)
> +
> +/* Compare to sys/mips/mips/trap.c */
> +
> +void cpu_loop(CPUMIPSState *env)
I suspect you'd do better in the long term to restructure
to pull cpu_loop out into a per-architecture source file
and avoid the ifdefs. (This is something I'd like to do to
the linux-user/ code, which is currently even more ifdef-ridden
than bsd-user/.)
> --- a/target-mips/mips-defs.h
> +++ b/target-mips/mips-defs.h
> @@ -10,8 +10,17 @@
>
> #if defined(TARGET_MIPS64)
> #define TARGET_LONG_BITS 64
> -#define TARGET_PHYS_ADDR_SPACE_BITS 36
> -#define TARGET_VIRT_ADDR_SPACE_BITS 42
> +# if defined(CONFIG_BSD) && defined(CONFIG_USER_ONLY)
> +# define TARGET_PHYS_ADDR_SPACE_BITS 59
> +# ifdef TARGET_ABI32
> +# define TARGET_VIRT_ADDR_SPACE_BITS 32
> +# else
> +# define TARGET_VIRT_ADDR_SPACE_BITS 62
> +# endif
> +# else
> +# define TARGET_PHYS_ADDR_SPACE_BITS 36
> +# define TARGET_VIRT_ADDR_SPACE_BITS 42
> +# endif
> #else
> #define TARGET_LONG_BITS 32
> #define TARGET_PHYS_ADDR_SPACE_BITS 36
This looks a little fishy -- could you give some rationale?
Why does only BSD need to do this? Why do you need to
change the TARGET_PHYS_ADDR_SPACE_BITS for a -user target?
Where do the numbers come from?
thanks
-- PMM
- [Qemu-devel] [PATCH 00/23] bsd-user: FreeBSD support for mips/mips64 and arm, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 07/23] bsd-user: find target executable in path when absolute path not given, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 05/23] bsd-user: add bsd_binprm to TaskState for core dumping emulation, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 06/23] bsd-user: fix thread initialization and ELF addresses for mips/mips64, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 13/23] bsd-user: add shims for signal related system calls, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 08/23] bsd-user: initialize stack with signal trampolin code and canary, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 02/23] bsd-user: add initial support for mips/mips64, Stacey Son, 2013/06/24
- Re: [Qemu-devel] [PATCH 02/23] bsd-user: add initial support for mips/mips64,
Peter Maydell <=
- [Qemu-devel] [PATCH 01/23] bsd-user: initial code clean up, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 11/23] bsd-user: add shims for file related system calls, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 10/23] bsd-user: add shims for memory management related syscalls, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 09/23] bsd-user: refresh FreeBSD's system call numbers, Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 12/23] bsd-user: add shims for time related system calls., Stacey Son, 2013/06/24
- [Qemu-devel] [PATCH 03/23] bsd-user: additional seperation of OS and architecture dependent code, Stacey Son, 2013/06/24