Revision 3a6fa678 target-alpha/helper.c

b/target-alpha/helper.c
160 160
}
161 161

  
162 162
#if defined(CONFIG_USER_ONLY)
163

  
164 163
int cpu_alpha_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
165 164
                                int mmu_idx, int is_softmmu)
166 165
{
......
168 167
    env->trap_arg0 = address;
169 168
    return 1;
170 169
}
171

  
172
void do_interrupt (CPUState *env)
173
{
174
    env->exception_index = -1;
175
}
176

  
177 170
#else
178

  
179 171
target_phys_addr_t cpu_get_phys_page_debug (CPUState *env, target_ulong addr)
180 172
{
181 173
    return -1;
......
186 178
{
187 179
    return 0;
188 180
}
181
#endif /* USER_ONLY */
189 182

  
190 183
void do_interrupt (CPUState *env)
191 184
{
192
    abort();
185
    int i = env->exception_index;
186

  
187
    if (qemu_loglevel_mask(CPU_LOG_INT)) {
188
        static int count;
189
        const char *name = "<unknown>";
190

  
191
        switch (i) {
192
        case EXCP_RESET:
193
            name = "reset";
194
            break;
195
        case EXCP_MCHK:
196
            name = "mchk";
197
            break;
198
        case EXCP_SMP_INTERRUPT:
199
            name = "smp_interrupt";
200
            break;
201
        case EXCP_CLK_INTERRUPT:
202
            name = "clk_interrupt";
203
            break;
204
        case EXCP_DEV_INTERRUPT:
205
            name = "dev_interrupt";
206
            break;
207
        case EXCP_MMFAULT:
208
            name = "mmfault";
209
            break;
210
        case EXCP_UNALIGN:
211
            name = "unalign";
212
            break;
213
        case EXCP_OPCDEC:
214
            name = "opcdec";
215
            break;
216
        case EXCP_ARITH:
217
            name = "arith";
218
            break;
219
        case EXCP_FEN:
220
            name = "fen";
221
            break;
222
        case EXCP_CALL_PAL:
223
            name = "call_pal";
224
            break;
225
        case EXCP_STL_C:
226
            name = "stl_c";
227
            break;
228
        case EXCP_STQ_C:
229
            name = "stq_c";
230
            break;
231
        }
232
        qemu_log("INT %6d: %s(%#x) pc=%016" PRIx64 " sp=%016" PRIx64 "\n",
233
                 ++count, name, env->error_code, env->pc, env->ir[IR_SP]);
234
    }
235

  
236
    env->exception_index = -1;
237

  
238
#if !defined(CONFIG_USER_ONLY)
239
    switch (i) {
240
    case EXCP_RESET:
241
        i = 0x0000;
242
        break;
243
    case EXCP_MCHK:
244
        i = 0x0080;
245
        break;
246
    case EXCP_SMP_INTERRUPT:
247
        i = 0x0100;
248
        break;
249
    case EXCP_CLK_INTERRUPT:
250
        i = 0x0180;
251
        break;
252
    case EXCP_DEV_INTERRUPT:
253
        i = 0x0200;
254
        break;
255
    case EXCP_MMFAULT:
256
        i = 0x0280;
257
        break;
258
    case EXCP_UNALIGN:
259
        i = 0x0300;
260
        break;
261
    case EXCP_OPCDEC:
262
        i = 0x0380;
263
        break;
264
    case EXCP_ARITH:
265
        i = 0x0400;
266
        break;
267
    case EXCP_FEN:
268
        i = 0x0480;
269
        break;
270
    case EXCP_CALL_PAL:
271
        i = env->error_code;
272
        /* There are 64 entry points for both privileged and unprivileged,
273
           with bit 0x80 indicating unprivileged.  Each entry point gets
274
           64 bytes to do its job.  */
275
        if (i & 0x80) {
276
            i = 0x2000 + (i - 0x80) * 64;
277
        } else {
278
            i = 0x1000 + i * 64;
279
        }
280
        break;
281
    default:
282
        cpu_abort(env, "Unhandled CPU exception");
283
    }
284

  
285
    /* Remember where the exception happened.  Emulate real hardware in
286
       that the low bit of the PC indicates PALmode.  */
287
    env->exc_addr = env->pc | env->pal_mode;
288

  
289
    /* Continue execution at the PALcode entry point.  */
290
    env->pc = env->palbr + i;
291

  
292
    /* Switch to PALmode.  */
293
    env->pal_mode = 1;
294
#endif /* !USER_ONLY */
193 295
}
194
#endif
195 296

  
196 297
void cpu_dump_state (CPUState *env, FILE *f, fprintf_function cpu_fprintf,
197 298
                     int flags)

Also available in: Unified diff