Statistics
| Branch: | Revision:

root / target-mips / mips-defs.h @ 43057ab1

History | View | Annotate | Download (2.2 kB)

1 6af0bf9c bellard
#if !defined (__QEMU_MIPS_DEFS_H__)
2 6af0bf9c bellard
#define __QEMU_MIPS_DEFS_H__
3 6af0bf9c bellard
4 6af0bf9c bellard
/* If we want to use 64 bits host regs... */
5 6af0bf9c bellard
//#define USE_64BITS_REGS
6 6af0bf9c bellard
/* If we want to use host float regs... */
7 6af0bf9c bellard
//#define USE_HOST_FLOAT_REGS
8 6af0bf9c bellard
9 c5d6edc3 bellard
#define MIPS_R4Kc 0x00018000
10 c5d6edc3 bellard
#define MIPS_R4Kp 0x00018300
11 6af0bf9c bellard
12 6af0bf9c bellard
/* Emulate MIPS R4Kc for now */
13 6af0bf9c bellard
#define MIPS_CPU MIPS_R4Kc
14 6af0bf9c bellard
15 6af0bf9c bellard
#if (MIPS_CPU == MIPS_R4Kc)
16 6af0bf9c bellard
/* 32 bits target */
17 6af0bf9c bellard
#define TARGET_LONG_BITS 32
18 6af0bf9c bellard
/* real pages are variable size... */
19 6af0bf9c bellard
#define TARGET_PAGE_BITS 12
20 c5d6edc3 bellard
/* Uses MIPS R4Kx enhancements to MIPS32 architecture */
21 6af0bf9c bellard
#define MIPS_USES_R4K_EXT
22 6af0bf9c bellard
/* Uses MIPS R4Kc TLB model */
23 6af0bf9c bellard
#define MIPS_USES_R4K_TLB
24 6af0bf9c bellard
#define MIPS_TLB_NB 16
25 6ea83fed bellard
/* basic FPU register support */
26 6ea83fed bellard
#define MIPS_USES_FPU 1
27 6ea83fed bellard
/* Define a implementation number of 1.
28 6ea83fed bellard
 * Define a major version 1, minor version 0.
29 6ea83fed bellard
 */
30 6ea83fed bellard
#define MIPS_FCR0 ((0 << 16) | (1 << 8) | (1 << 4) | 0)
31 c5d6edc3 bellard
/* Have config1, uses TLB */
32 c5d6edc3 bellard
#define MIPS_CONFIG0_1                                          \
33 c5d6edc3 bellard
((1 << CP0C0_M) | (0 << CP0C0_K23) | (0 << CP0C0_KU) |          \
34 c5d6edc3 bellard
 (1 << CP0C0_MT) | (2 << CP0C0_K0))
35 c5d6edc3 bellard
#ifdef TARGET_WORDS_BIGENDIAN
36 c5d6edc3 bellard
#define MIPS_CONFIG0 (MIPS_CONFIG0_1 | (1 << CP0C0_BE))
37 c5d6edc3 bellard
#else
38 c5d6edc3 bellard
#define MIPS_CONFIG0 MIPS_CONFIG0_1
39 c5d6edc3 bellard
#endif
40 6af0bf9c bellard
/* 16 TLBs, 64 sets Icache, 16 bytes Icache line, 2-way Icache,
41 6af0bf9c bellard
 * 64 sets Dcache, 16 bytes Dcache line, 2-way Dcache,
42 6af0bf9c bellard
 * no performance counters, watch registers present, no code compression,
43 6ea83fed bellard
 * EJTAG present, FPU enable bit depending on MIPS_USES_FPU
44 6af0bf9c bellard
 */
45 6af0bf9c bellard
#define MIPS_CONFIG1                                            \
46 6af0bf9c bellard
((15 << CP0C1_MMU) |                                            \
47 6af0bf9c bellard
 (0x000 << CP0C1_IS) | (0x3 << CP0C1_IL) | (0x01 << CP0C1_IA) | \
48 6af0bf9c bellard
 (0x000 << CP0C1_DS) | (0x3 << CP0C1_DL) | (0x01 << CP0C1_DA) | \
49 6af0bf9c bellard
 (0 << CP0C1_PC) | (1 << CP0C1_WR) | (0 << CP0C1_CA) |          \
50 6ea83fed bellard
 (1 << CP0C1_EP) | (MIPS_USES_FPU << CP0C1_FP))
51 c5d6edc3 bellard
#elif (MIPS_CPU == MIPS_R4Kp)
52 6af0bf9c bellard
/* 32 bits target */
53 6af0bf9c bellard
#define TARGET_LONG_BITS 32
54 6af0bf9c bellard
/* real pages are variable size... */
55 6af0bf9c bellard
#define TARGET_PAGE_BITS 12
56 c5d6edc3 bellard
/* Uses MIPS R4Kx enhancements to MIPS32 architecture */
57 6af0bf9c bellard
#define MIPS_USES_R4K_EXT
58 6af0bf9c bellard
/* Uses MIPS R4Km FPM MMU model */
59 6af0bf9c bellard
#define MIPS_USES_R4K_FPM
60 6af0bf9c bellard
#else
61 6af0bf9c bellard
#error "MIPS CPU not defined"
62 6af0bf9c bellard
/* Remainder for other flags */
63 6af0bf9c bellard
//#define TARGET_MIPS64
64 6ea83fed bellard
//#define MIPS_USES_FPU
65 6af0bf9c bellard
#endif
66 6af0bf9c bellard
67 6af0bf9c bellard
#endif /* !defined (__QEMU_MIPS_DEFS_H__) */