Revision cc688901 target-arm/translate.c

b/target-arm/translate.c
2538 2538
    if (IS_USER(s) && !cp15_user_ok(insn)) {
2539 2539
        return 1;
2540 2540
    }
2541
    if ((insn & 0x0fff0fff) == 0x0e070f90
2542
        || (insn & 0x0fff0fff) == 0x0e070f58) {
2543
        /* Wait for interrupt.  */
2544
        gen_set_pc_im(s->pc);
2545
        s->is_jmp = DISAS_WFI;
2541

  
2542
    /* Pre-v7 versions of the architecture implemented WFI via coprocessor
2543
     * instructions rather than a separate instruction.
2544
     */
2545
    if ((insn & 0x0fff0fff) == 0x0e070f90) {
2546
        /* 0,c7,c0,4: Standard v6 WFI (also used in some pre-v6 cores).
2547
         * In v7, this must NOP.
2548
         */
2549
        if (!arm_feature(env, ARM_FEATURE_V7)) {
2550
            /* Wait for interrupt.  */
2551
            gen_set_pc_im(s->pc);
2552
            s->is_jmp = DISAS_WFI;
2553
        }
2546 2554
        return 0;
2547 2555
    }
2556

  
2557
    if ((insn & 0x0fff0fff) == 0x0e070f58) {
2558
        /* 0,c7,c8,2: Not all pre-v6 cores implemented this WFI,
2559
         * so this is slightly over-broad.
2560
         */
2561
        if (!arm_feature(env, ARM_FEATURE_V6)) {
2562
            /* Wait for interrupt.  */
2563
            gen_set_pc_im(s->pc);
2564
            s->is_jmp = DISAS_WFI;
2565
            return 0;
2566
        }
2567
        /* Otherwise fall through to handle via helper function.
2568
         * In particular, on v7 and some v6 cores this is one of
2569
         * the VA-PA registers.
2570
         */
2571
    }
2572

  
2548 2573
    rd = (insn >> 12) & 0xf;
2549 2574

  
2550 2575
    if (cp15_tls_load_store(env, s, insn, rd))

Also available in: Unified diff