Statistics
| Branch: | Revision:

root / target-mips / mips-defs.h @ 1b2b0af5

History | View | Annotate | Download (1.9 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 6af0bf9c bellard
enum {
10 6af0bf9c bellard
    MIPS_R4Kc = 0x00018000,
11 6af0bf9c bellard
    MIPS_R4Kp = 0x00018300,
12 6af0bf9c bellard
};
13 6af0bf9c bellard
14 6af0bf9c bellard
/* Emulate MIPS R4Kc for now */
15 6af0bf9c bellard
#define MIPS_CPU MIPS_R4Kc
16 6af0bf9c bellard
17 6af0bf9c bellard
#if (MIPS_CPU == MIPS_R4Kc)
18 6af0bf9c bellard
/* 32 bits target */
19 6af0bf9c bellard
#define TARGET_LONG_BITS 32
20 6af0bf9c bellard
/* real pages are variable size... */
21 6af0bf9c bellard
#define TARGET_PAGE_BITS 12
22 6af0bf9c bellard
/* Uses MIPS R4Kx ehancements to MIPS32 architecture */
23 6af0bf9c bellard
#define MIPS_USES_R4K_EXT
24 6af0bf9c bellard
/* Uses MIPS R4Kc TLB model */
25 6af0bf9c bellard
#define MIPS_USES_R4K_TLB
26 6af0bf9c bellard
#define MIPS_TLB_NB 16
27 6af0bf9c bellard
/* Have config1, runs in big-endian mode, uses TLB */
28 6af0bf9c bellard
#define MIPS_CONFIG0                                            \
29 6af0bf9c bellard
((1 << CP0C0_M) | (0x000 << CP0C0_K23) | (0x000 << CP0C0_KU) |  \
30 6af0bf9c bellard
 (1 << CP0C0_BE) | (0x001 << CP0C0_MT) | (0x010 << CP0C0_K0))
31 6af0bf9c bellard
/* 16 TLBs, 64 sets Icache, 16 bytes Icache line, 2-way Icache,
32 6af0bf9c bellard
 * 64 sets Dcache, 16 bytes Dcache line, 2-way Dcache,
33 6af0bf9c bellard
 * no performance counters, watch registers present, no code compression,
34 6af0bf9c bellard
 * EJTAG present, no FPU
35 6af0bf9c bellard
 */
36 6af0bf9c bellard
#define MIPS_CONFIG1                                            \
37 6af0bf9c bellard
((15 << CP0C1_MMU) |                                            \
38 6af0bf9c bellard
 (0x000 << CP0C1_IS) | (0x3 << CP0C1_IL) | (0x01 << CP0C1_IA) | \
39 6af0bf9c bellard
 (0x000 << CP0C1_DS) | (0x3 << CP0C1_DL) | (0x01 << CP0C1_DA) | \
40 6af0bf9c bellard
 (0 << CP0C1_PC) | (1 << CP0C1_WR) | (0 << CP0C1_CA) |          \
41 6af0bf9c bellard
 (1 << CP0C1_EP) | (0 << CP0C1_FP))
42 6af0bf9c bellard
#elif defined (MIPS_CPU == MIPS_R4Kp)
43 6af0bf9c bellard
/* 32 bits target */
44 6af0bf9c bellard
#define TARGET_LONG_BITS 32
45 6af0bf9c bellard
/* real pages are variable size... */
46 6af0bf9c bellard
#define TARGET_PAGE_BITS 12
47 6af0bf9c bellard
/* Uses MIPS R4Kx ehancements to MIPS32 architecture */
48 6af0bf9c bellard
#define MIPS_USES_R4K_EXT
49 6af0bf9c bellard
/* Uses MIPS R4Km FPM MMU model */
50 6af0bf9c bellard
#define MIPS_USES_R4K_FPM
51 6af0bf9c bellard
#else
52 6af0bf9c bellard
#error "MIPS CPU not defined"
53 6af0bf9c bellard
/* Remainder for other flags */
54 6af0bf9c bellard
//#define TARGET_MIPS64
55 6af0bf9c bellard
//define MIPS_USES_FPU
56 6af0bf9c bellard
#endif
57 6af0bf9c bellard
58 6af0bf9c bellard
#endif /* !defined (__QEMU_MIPS_DEFS_H__) */