Richard Henderson | 74433bf | 2019-03-22 11:51:19 -0700 | [diff] [blame] | 1 | /* |
| 2 | * MIPS cpu parameters for qemu. |
| 3 | * |
| 4 | * SPDX-License-Identifier: LGPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #ifndef MIPS_CPU_PARAM_H |
Markus Armbruster | 4f31b54 | 2022-05-06 15:49:10 +0200 | [diff] [blame] | 8 | #define MIPS_CPU_PARAM_H |
Richard Henderson | 74433bf | 2019-03-22 11:51:19 -0700 | [diff] [blame] | 9 | |
| 10 | #ifdef TARGET_MIPS64 |
| 11 | # define TARGET_LONG_BITS 64 |
| 12 | #else |
| 13 | # define TARGET_LONG_BITS 32 |
| 14 | #endif |
WANG Xuerui | 8cd0e66 | 2022-03-28 11:59:42 +0800 | [diff] [blame] | 15 | #ifdef TARGET_ABI_MIPSN64 |
Richard Henderson | 74433bf | 2019-03-22 11:51:19 -0700 | [diff] [blame] | 16 | #define TARGET_PHYS_ADDR_SPACE_BITS 48 |
| 17 | #define TARGET_VIRT_ADDR_SPACE_BITS 48 |
| 18 | #else |
| 19 | #define TARGET_PHYS_ADDR_SPACE_BITS 40 |
| 20 | # ifdef CONFIG_USER_ONLY |
| 21 | # define TARGET_VIRT_ADDR_SPACE_BITS 31 |
| 22 | # else |
| 23 | # define TARGET_VIRT_ADDR_SPACE_BITS 32 |
| 24 | #endif |
| 25 | #endif |
Huacai Chen | ee3863b | 2020-04-08 17:16:18 +0800 | [diff] [blame] | 26 | #ifdef CONFIG_USER_ONLY |
Richard Henderson | 74433bf | 2019-03-22 11:51:19 -0700 | [diff] [blame] | 27 | #define TARGET_PAGE_BITS 12 |
Huacai Chen | ee3863b | 2020-04-08 17:16:18 +0800 | [diff] [blame] | 28 | #else |
| 29 | #define TARGET_PAGE_BITS_VARY |
| 30 | #define TARGET_PAGE_BITS_MIN 12 |
| 31 | #endif |
Richard Henderson | 74433bf | 2019-03-22 11:51:19 -0700 | [diff] [blame] | 32 | |
| 33 | #endif |