Revision 79227036 target-sparc/int32_helper.c

b/target-sparc/int32_helper.c
20 20
#include "cpu.h"
21 21

  
22 22
//#define DEBUG_PCALL
23
//#define DEBUG_CACHE_CONTROL
24

  
25
#ifdef DEBUG_CACHE_CONTROL
26
#define DPRINTF_CACHE_CONTROL(fmt, ...)                                 \
27
    do { printf("CACHE_CONTROL: " fmt , ## __VA_ARGS__); } while (0)
28
#else
29
#define DPRINTF_CACHE_CONTROL(fmt, ...) do {} while (0)
30
#endif
23 31

  
24 32
#ifdef DEBUG_PCALL
25 33
static const char * const excp_names[0x80] = {
......
119 127
#if !defined(CONFIG_USER_ONLY)
120 128
    /* IRQ acknowledgment */
121 129
    if ((intno & ~15) == TT_EXTINT && env->qemu_irq_ack != NULL) {
122
        env->qemu_irq_ack(env->irq_manager, intno);
130
        env->qemu_irq_ack(env, env->irq_manager, intno);
123 131
    }
124 132
#endif
125 133
}
134

  
135
#if !defined(CONFIG_USER_ONLY)
136
static void leon3_cache_control_int(CPUState *env)
137
{
138
    uint32_t state = 0;
139

  
140
    if (env->cache_control & CACHE_CTRL_IF) {
141
        /* Instruction cache state */
142
        state = env->cache_control & CACHE_STATE_MASK;
143
        if (state == CACHE_ENABLED) {
144
            state = CACHE_FROZEN;
145
            DPRINTF_CACHE_CONTROL("Instruction cache: freeze\n");
146
        }
147

  
148
        env->cache_control &= ~CACHE_STATE_MASK;
149
        env->cache_control |= state;
150
    }
151

  
152
    if (env->cache_control & CACHE_CTRL_DF) {
153
        /* Data cache state */
154
        state = (env->cache_control >> 2) & CACHE_STATE_MASK;
155
        if (state == CACHE_ENABLED) {
156
            state = CACHE_FROZEN;
157
            DPRINTF_CACHE_CONTROL("Data cache: freeze\n");
158
        }
159

  
160
        env->cache_control &= ~(CACHE_STATE_MASK << 2);
161
        env->cache_control |= (state << 2);
162
    }
163
}
164

  
165
void leon3_irq_manager(CPUState *env, void *irq_manager, int intno)
166
{
167
    leon3_irq_ack(irq_manager, intno);
168
    leon3_cache_control_int(env);
169
}
170
#endif

Also available in: Unified diff