root / cpu-defs.h @ 97eb5b14
History | View | Annotate | Download (2 kB)
1 | ab93bbe2 | bellard | /*
|
---|---|---|---|
2 | ab93bbe2 | bellard | * common defines for all CPUs
|
3 | ab93bbe2 | bellard | *
|
4 | ab93bbe2 | bellard | * Copyright (c) 2003 Fabrice Bellard
|
5 | ab93bbe2 | bellard | *
|
6 | ab93bbe2 | bellard | * This library is free software; you can redistribute it and/or
|
7 | ab93bbe2 | bellard | * modify it under the terms of the GNU Lesser General Public
|
8 | ab93bbe2 | bellard | * License as published by the Free Software Foundation; either
|
9 | ab93bbe2 | bellard | * version 2 of the License, or (at your option) any later version.
|
10 | ab93bbe2 | bellard | *
|
11 | ab93bbe2 | bellard | * This library is distributed in the hope that it will be useful,
|
12 | ab93bbe2 | bellard | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | ab93bbe2 | bellard | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | ab93bbe2 | bellard | * Lesser General Public License for more details.
|
15 | ab93bbe2 | bellard | *
|
16 | ab93bbe2 | bellard | * You should have received a copy of the GNU Lesser General Public
|
17 | ab93bbe2 | bellard | * License along with this library; if not, write to the Free Software
|
18 | ab93bbe2 | bellard | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 | ab93bbe2 | bellard | */
|
20 | ab93bbe2 | bellard | #ifndef CPU_DEFS_H
|
21 | ab93bbe2 | bellard | #define CPU_DEFS_H
|
22 | ab93bbe2 | bellard | |
23 | ab93bbe2 | bellard | #include "config.h" |
24 | ab93bbe2 | bellard | #include <setjmp.h> |
25 | ed1c0bcb | bellard | #include <inttypes.h> |
26 | ed1c0bcb | bellard | #include "osdep.h" |
27 | ab93bbe2 | bellard | |
28 | 35b66fc4 | bellard | #ifndef TARGET_LONG_BITS
|
29 | 35b66fc4 | bellard | #error TARGET_LONG_BITS must be defined before including this header
|
30 | 35b66fc4 | bellard | #endif
|
31 | 35b66fc4 | bellard | |
32 | 35b66fc4 | bellard | #define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8) |
33 | 35b66fc4 | bellard | |
34 | 35b66fc4 | bellard | #if TARGET_LONG_SIZE == 4 |
35 | 35b66fc4 | bellard | typedef int32_t target_long;
|
36 | 35b66fc4 | bellard | typedef uint32_t target_ulong;
|
37 | 35b66fc4 | bellard | #elif TARGET_LONG_SIZE == 8 |
38 | 35b66fc4 | bellard | typedef int64_t target_long;
|
39 | 35b66fc4 | bellard | typedef uint64_t target_ulong;
|
40 | 35b66fc4 | bellard | #else
|
41 | 35b66fc4 | bellard | #error TARGET_LONG_SIZE undefined
|
42 | 35b66fc4 | bellard | #endif
|
43 | 35b66fc4 | bellard | |
44 | ab93bbe2 | bellard | #define EXCP_INTERRUPT 256 /* async interruption */ |
45 | ab93bbe2 | bellard | #define EXCP_HLT 257 /* hlt instruction reached */ |
46 | ab93bbe2 | bellard | #define EXCP_DEBUG 258 /* cpu stopped after a breakpoint or singlestep */ |
47 | ab93bbe2 | bellard | |
48 | ab93bbe2 | bellard | #define MAX_BREAKPOINTS 32 |
49 | ab93bbe2 | bellard | |
50 | ab93bbe2 | bellard | #define CPU_TLB_SIZE 256 |
51 | ab93bbe2 | bellard | |
52 | ab93bbe2 | bellard | typedef struct CPUTLBEntry { |
53 | db8d7466 | bellard | /* bit 31 to TARGET_PAGE_BITS : virtual address
|
54 | db8d7466 | bellard | bit TARGET_PAGE_BITS-1..IO_MEM_SHIFT : if non zero, memory io
|
55 | db8d7466 | bellard | zone number
|
56 | db8d7466 | bellard | bit 3 : indicates that the entry is invalid
|
57 | db8d7466 | bellard | bit 2..0 : zero
|
58 | db8d7466 | bellard | */
|
59 | db8d7466 | bellard | uint32_t address; |
60 | db8d7466 | bellard | /* addend to virtual address to get physical address */
|
61 | db8d7466 | bellard | uint32_t addend; |
62 | ab93bbe2 | bellard | } CPUTLBEntry; |
63 | ab93bbe2 | bellard | |
64 | ab93bbe2 | bellard | #endif |