~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to cpu-defs.h

Tags: upstream-0.9.0+20070816
ImportĀ upstreamĀ versionĀ 0.9.0+20070816

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
typedef int32_t target_long;
45
45
typedef uint32_t target_ulong;
46
46
#define TARGET_FMT_lx "%08x"
 
47
#define TARGET_FMT_ld "%d"
47
48
#elif TARGET_LONG_SIZE == 8
48
49
typedef int64_t target_long;
49
50
typedef uint64_t target_ulong;
50
51
#define TARGET_FMT_lx "%016" PRIx64
 
52
#define TARGET_FMT_ld "%" PRId64
51
53
#else
52
54
#error TARGET_LONG_SIZE undefined
53
55
#endif
60
62
 
61
63
#if TARGET_PHYS_ADDR_BITS == 32
62
64
typedef uint32_t target_phys_addr_t;
 
65
#define TARGET_FMT_plx "%08x"
63
66
#elif TARGET_PHYS_ADDR_BITS == 64
64
67
typedef uint64_t target_phys_addr_t;
 
68
#define TARGET_FMT_plx "%016" PRIx64
65
69
#else
66
70
#error TARGET_PHYS_ADDR_BITS undefined
67
71
#endif
76
80
#define EXCP_DEBUG      0x10002 /* cpu stopped after a breakpoint or singlestep */
77
81
#define EXCP_HALTED     0x10003 /* cpu is halted (waiting for external event) */
78
82
#define MAX_BREAKPOINTS 32
 
83
#define MAX_WATCHPOINTS 32
79
84
 
80
85
#define TB_JMP_CACHE_BITS 12
81
86
#define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS)
105
110
    target_phys_addr_t addend; 
106
111
} CPUTLBEntry;
107
112
 
 
113
/* Alpha has 4 different running levels */
 
114
#if defined(TARGET_ALPHA)
 
115
#define NB_MMU_MODES 4
 
116
#elif defined(TARGET_PPC64H) /* PowerPC 64 with hypervisor mode support */
 
117
#define NB_MMU_MODES 3
 
118
#else
 
119
#define NB_MMU_MODES 2
 
120
#endif
 
121
 
108
122
#define CPU_COMMON                                                      \
109
123
    struct TranslationBlock *current_tb; /* currently executing TB  */  \
110
124
    /* soft mmu support */                                              \
116
130
    target_ulong mem_write_vaddr; /* target virtual addr at which the   \
117
131
                                     memory was written */              \
118
132
    /* 0 = kernel, 1 = user */                                          \
119
 
    CPUTLBEntry tlb_table[2][CPU_TLB_SIZE];                             \
 
133
    CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE];                  \
120
134
    struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE];           \
121
135
                                                                        \
122
136
    /* from this point: preserved by CPU reset */                       \
125
139
    int nb_breakpoints;                                                 \
126
140
    int singlestep_enabled;                                             \
127
141
                                                                        \
 
142
    struct {                                                            \
 
143
        target_ulong vaddr;                                             \
 
144
        target_phys_addr_t addend;                                      \
 
145
    } watchpoint[MAX_WATCHPOINTS];                                      \
 
146
    int nb_watchpoints;                                                 \
 
147
    int watchpoint_hit;                                                 \
 
148
                                                                        \
128
149
    void *next_cpu; /* next CPU sharing TB cache */                     \
129
150
    int cpu_index; /* CPU index (informative) */                        \
130
151
    /* user data */                                                     \