Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tcg: Split out target/arch/cpu-param.h
For all targets, into this new file move TARGET_LONG_BITS, TARGET_PAGE_BITS, TARGET_PHYS_ADDR_SPACE_BITS, TARGET_VIRT_ADDR_SPACE_BITS, and NB_MMU_MODES. Include this new file from exec/cpu-defs.h. This now removes the somewhat odd requirement that target/arch/cpu.h defines TARGET_LONG_BITS before including exec/cpu-defs.h, so push the bulk of the includes within target/arch/cpu.h to the top. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
- Loading branch information
Showing
45 changed files
with
544 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Alpha cpu parameters for qemu. | ||
* | ||
* Copyright (c) 2007 Jocelyn Mayer | ||
* SPDX-License-Identifier: LGPL-2.0+ | ||
*/ | ||
|
||
#ifndef ALPHA_CPU_PARAM_H | ||
#define ALPHA_CPU_PARAM_H 1 | ||
|
||
#define TARGET_LONG_BITS 64 | ||
#define TARGET_PAGE_BITS 13 | ||
#ifdef CONFIG_USER_ONLY | ||
/* | ||
* ??? The kernel likes to give addresses in high memory. If the host has | ||
* more virtual address space than the guest, this can lead to impossible | ||
* allocations. Honor the long-standing assumption that only kernel addrs | ||
* are negative, but otherwise allow allocations anywhere. This could lead | ||
* to tricky emulation problems for programs doing tagged addressing, but | ||
* that's far fewer than encounter the impossible allocation problem. | ||
*/ | ||
#define TARGET_PHYS_ADDR_SPACE_BITS 63 | ||
#define TARGET_VIRT_ADDR_SPACE_BITS 63 | ||
#else | ||
/* ??? EV4 has 34 phys addr bits, EV5 has 40, EV6 has 44. */ | ||
#define TARGET_PHYS_ADDR_SPACE_BITS 44 | ||
#define TARGET_VIRT_ADDR_SPACE_BITS (30 + TARGET_PAGE_BITS) | ||
#endif | ||
#define NB_MMU_MODES 3 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* ARM cpu parameters for qemu. | ||
* | ||
* Copyright (c) 2003 Fabrice Bellard | ||
* SPDX-License-Identifier: LGPL-2.0+ | ||
*/ | ||
|
||
#ifndef ARM_CPU_PARAM_H | ||
#define ARM_CPU_PARAM_H 1 | ||
|
||
#ifdef TARGET_AARCH64 | ||
# define TARGET_LONG_BITS 64 | ||
# define TARGET_PHYS_ADDR_SPACE_BITS 48 | ||
# define TARGET_VIRT_ADDR_SPACE_BITS 48 | ||
#else | ||
# define TARGET_LONG_BITS 32 | ||
# define TARGET_PHYS_ADDR_SPACE_BITS 40 | ||
# define TARGET_VIRT_ADDR_SPACE_BITS 32 | ||
#endif | ||
|
||
#ifdef CONFIG_USER_ONLY | ||
#define TARGET_PAGE_BITS 12 | ||
#else | ||
/* | ||
* ARMv7 and later CPUs have 4K pages minimum, but ARMv5 and v6 | ||
* have to support 1K tiny pages. | ||
*/ | ||
# define TARGET_PAGE_BITS_VARY | ||
# define TARGET_PAGE_BITS_MIN 10 | ||
#endif | ||
|
||
#define NB_MMU_MODES 8 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* CRIS cpu parameters for qemu. | ||
* | ||
* Copyright (c) 2007 AXIS Communications AB | ||
* SPDX-License-Identifier: LGPL-2.0+ | ||
*/ | ||
|
||
#ifndef CRIS_CPU_PARAM_H | ||
#define CRIS_CPU_PARAM_H 1 | ||
|
||
#define TARGET_LONG_BITS 32 | ||
#define TARGET_PAGE_BITS 13 | ||
#define TARGET_PHYS_ADDR_SPACE_BITS 32 | ||
#define TARGET_VIRT_ADDR_SPACE_BITS 32 | ||
#define NB_MMU_MODES 2 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* PA-RISC cpu parameters for qemu. | ||
* | ||
* Copyright (c) 2016 Richard Henderson <rth@twiddle.net> | ||
* SPDX-License-Identifier: LGPL-2.0+ | ||
*/ | ||
|
||
#ifndef HPPA_CPU_PARAM_H | ||
#define HPPA_CPU_PARAM_H 1 | ||
|
||
#ifdef TARGET_HPPA64 | ||
# define TARGET_LONG_BITS 64 | ||
# define TARGET_REGISTER_BITS 64 | ||
# define TARGET_VIRT_ADDR_SPACE_BITS 64 | ||
# define TARGET_PHYS_ADDR_SPACE_BITS 64 | ||
#elif defined(CONFIG_USER_ONLY) | ||
# define TARGET_LONG_BITS 32 | ||
# define TARGET_REGISTER_BITS 32 | ||
# define TARGET_VIRT_ADDR_SPACE_BITS 32 | ||
# define TARGET_PHYS_ADDR_SPACE_BITS 32 | ||
#else | ||
/* | ||
* In order to form the GVA from space:offset, | ||
* we need a 64-bit virtual address space. | ||
*/ | ||
# define TARGET_LONG_BITS 64 | ||
# define TARGET_REGISTER_BITS 32 | ||
# define TARGET_VIRT_ADDR_SPACE_BITS 64 | ||
# define TARGET_PHYS_ADDR_SPACE_BITS 32 | ||
#endif | ||
#define TARGET_PAGE_BITS 12 | ||
#define NB_MMU_MODES 5 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* i386 cpu parameters for qemu. | ||
* | ||
* Copyright (c) 2003 Fabrice Bellard | ||
* SPDX-License-Identifier: LGPL-2.0+ | ||
*/ | ||
|
||
#ifndef I386_CPU_PARAM_H | ||
#define I386_CPU_PARAM_H 1 | ||
|
||
#ifdef TARGET_X86_64 | ||
# define TARGET_LONG_BITS 64 | ||
# define TARGET_PHYS_ADDR_SPACE_BITS 52 | ||
/* | ||
* ??? This is really 48 bits, sign-extended, but the only thing | ||
* accessible to userland with bit 48 set is the VSYSCALL, and that | ||
* is handled via other mechanisms. | ||
*/ | ||
# define TARGET_VIRT_ADDR_SPACE_BITS 47 | ||
#else | ||
# define TARGET_LONG_BITS 32 | ||
# define TARGET_PHYS_ADDR_SPACE_BITS 36 | ||
# define TARGET_VIRT_ADDR_SPACE_BITS 32 | ||
#endif | ||
#define TARGET_PAGE_BITS 12 | ||
#define NB_MMU_MODES 3 | ||
|
||
#endif |
Oops, something went wrong.