Revision 07b6c13b

b/linux-user/main.c
2508 2508
            fprintf(stderr, "Machine check exception. Exit\n");
2509 2509
            exit(1);
2510 2510
            break;
2511
        case EXCP_ARITH:
2512
            env->lock_addr = -1;
2513
            info.si_signo = TARGET_SIGFPE;
2514
            info.si_errno = 0;
2515
            info.si_code = TARGET_FPE_FLTINV;
2516
            info._sifields._sigfault._addr = env->pc;
2517
            queue_signal(env, info.si_signo, &info);
2518
            break;
2519
        case EXCP_HW_INTERRUPT:
2511
        case EXCP_SMP_INTERRUPT:
2512
        case EXCP_CLK_INTERRUPT:
2513
        case EXCP_DEV_INTERRUPT:
2520 2514
            fprintf(stderr, "External interrupt. Exit\n");
2521 2515
            exit(1);
2522 2516
            break;
2523
        case EXCP_DFAULT:
2517
        case EXCP_MMFAULT:
2524 2518
            env->lock_addr = -1;
2525 2519
            info.si_signo = TARGET_SIGSEGV;
2526 2520
            info.si_errno = 0;
......
2529 2523
            info._sifields._sigfault._addr = env->trap_arg0;
2530 2524
            queue_signal(env, info.si_signo, &info);
2531 2525
            break;
2532
        case EXCP_DTB_MISS_PAL:
2533
            fprintf(stderr, "MMU data TLB miss in PALcode\n");
2534
            exit(1);
2535
            break;
2536
        case EXCP_ITB_MISS:
2537
            fprintf(stderr, "MMU instruction TLB miss\n");
2538
            exit(1);
2539
            break;
2540
        case EXCP_ITB_ACV:
2541
            fprintf(stderr, "MMU instruction access violation\n");
2542
            exit(1);
2543
            break;
2544
        case EXCP_DTB_MISS_NATIVE:
2545
            fprintf(stderr, "MMU data TLB miss\n");
2546
            exit(1);
2547
            break;
2548 2526
        case EXCP_UNALIGN:
2549 2527
            env->lock_addr = -1;
2550 2528
            info.si_signo = TARGET_SIGBUS;
......
2562 2540
            info._sifields._sigfault._addr = env->pc;
2563 2541
            queue_signal(env, info.si_signo, &info);
2564 2542
            break;
2543
        case EXCP_ARITH:
2544
            env->lock_addr = -1;
2545
            info.si_signo = TARGET_SIGFPE;
2546
            info.si_errno = 0;
2547
            info.si_code = TARGET_FPE_FLTINV;
2548
            info._sifields._sigfault._addr = env->pc;
2549
            queue_signal(env, info.si_signo, &info);
2550
            break;
2565 2551
        case EXCP_FEN:
2566 2552
            /* No-op.  Linux simply re-enables the FPU.  */
2567 2553
            break;
2568
        case EXCP_CALL_PAL ... (EXCP_CALL_PALP - 1):
2554
        case EXCP_CALL_PAL:
2569 2555
            env->lock_addr = -1;
2570
            switch ((trapnr >> 6) | 0x80) {
2556
            switch (env->error_code) {
2571 2557
            case 0x80:
2572 2558
                /* BPT */
2573 2559
                info.si_signo = TARGET_SIGTRAP;
......
2658 2644
                goto do_sigill;
2659 2645
            }
2660 2646
            break;
2661
        case EXCP_CALL_PALP ... (EXCP_CALL_PALE - 1):
2662
            goto do_sigill;
2663 2647
        case EXCP_DEBUG:
2664 2648
            info.si_signo = gdb_handlesig (env, TARGET_SIGTRAP);
2665 2649
            if (info.si_signo) {
b/target-alpha/cpu.h
289 289
};
290 290

  
291 291
enum {
292
    EXCP_RESET            = 0x0000,
293
    EXCP_MCHK             = 0x0020,
294
    EXCP_ARITH            = 0x0060,
295
    EXCP_HW_INTERRUPT     = 0x00E0,
296
    EXCP_DFAULT           = 0x01E0,
297
    EXCP_DTB_MISS_PAL     = 0x09E0,
298
    EXCP_ITB_MISS         = 0x03E0,
299
    EXCP_ITB_ACV          = 0x07E0,
300
    EXCP_DTB_MISS_NATIVE  = 0x08E0,
301
    EXCP_UNALIGN          = 0x11E0,
302
    EXCP_OPCDEC           = 0x13E0,
303
    EXCP_FEN              = 0x17E0,
304
    EXCP_CALL_PAL         = 0x2000,
305
    EXCP_CALL_PALP        = 0x3000,
306
    EXCP_CALL_PALE        = 0x4000,
307
    /* Pseudo exception for console */
308
    EXCP_CONSOLE_DISPATCH = 0x4001,
309
    EXCP_CONSOLE_FIXUP    = 0x4002,
310
    EXCP_STL_C            = 0x4003,
311
    EXCP_STQ_C            = 0x4004,
292
    EXCP_RESET,
293
    EXCP_MCHK,
294
    EXCP_SMP_INTERRUPT,
295
    EXCP_CLK_INTERRUPT,
296
    EXCP_DEV_INTERRUPT,
297
    EXCP_MMFAULT,
298
    EXCP_UNALIGN,
299
    EXCP_OPCDEC,
300
    EXCP_ARITH,
301
    EXCP_FEN,
302
    EXCP_CALL_PAL,
303
    /* For Usermode emulation.  */
304
    EXCP_STL_C,
305
    EXCP_STQ_C,
312 306
};
313 307

  
314 308
/* Arithmetic exception */
b/target-alpha/helper.c
164 164
int cpu_alpha_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
165 165
                                int mmu_idx, int is_softmmu)
166 166
{
167
    if (rw == 2)
168
        env->exception_index = EXCP_ITB_MISS;
169
    else
170
        env->exception_index = EXCP_DFAULT;
167
    env->exception_index = EXCP_MMFAULT;
171 168
    env->trap_arg0 = address;
172 169
    return 1;
173 170
}
b/target-alpha/translate.c
1516 1516
#endif
1517 1517
        if (palcode >= 0x80 && palcode < 0xC0) {
1518 1518
            /* Unprivileged PAL call */
1519
            ret = gen_excp(ctx, EXCP_CALL_PAL + ((palcode & 0x3F) << 6), 0);
1519
            ret = gen_excp(ctx, EXCP_CALL_PAL, palcode & 0xBF);
1520 1520
            break;
1521 1521
        }
1522 1522
#ifndef CONFIG_USER_ONLY
......
1525 1525
            if (ctx->mem_idx != MMU_KERNEL_IDX) {
1526 1526
                goto invalid_opc;
1527 1527
            }
1528
            ret = gen_excp(ctx, EXCP_CALL_PALP + ((palcode & 0x3F) << 6), 0);
1528
            ret = gen_excp(ctx, EXCP_CALL_PAL, palcode & 0x3F);
1529 1529
        }
1530 1530
#endif
1531 1531
        /* Invalid PAL call */

Also available in: Unified diff