Revision e37e863f target-mips/op_helper.c

b/target-mips/op_helper.c
29 29
    longjmp(env->jmp_env, 1);
30 30
}
31 31

  
32
__attribute__ (( regparm(2) ))
33 32
void do_raise_exception_err (uint32_t exception, int error_code)
34 33
{
35 34
#if 1
......
42 41
    cpu_loop_exit();
43 42
}
44 43

  
45
__attribute__ (( regparm(1) ))
46 44
void do_raise_exception (uint32_t exception)
47 45
{
48 46
    do_raise_exception_err(exception, 0);
......
117 115
#endif
118 116

  
119 117
/* CP0 helpers */
120
__attribute__ (( regparm(2) ))
121 118
void do_mfc0 (int reg, int sel)
122 119
{
123 120
    const unsigned char *rn;
......
267 264
    return;
268 265
}
269 266

  
270
__attribute__ (( regparm(2) ))
271 267
void do_mtc0 (int reg, int sel)
272 268
{
273 269
    const unsigned char *rn;
274 270
    uint32_t val, old, mask;
275
    int i, raise;
276 271

  
277 272
    if (sel != 0 && reg != 16 && reg != 28) {
278 273
        val = -1;
......
379 374
        old = env->CP0_Cause;
380 375
        env->CP0_Cause = val;
381 376
#if 0
382
        /* Check if we ever asserted a software IRQ */
383
        for (i = 0; i < 2; i++) {
384
            mask = 0x100 << i;
385
            if ((val & mask) & !(old & mask))
386
                mips_set_irq(i);
377
        {
378
            int i;
379
            /* Check if we ever asserted a software IRQ */
380
            for (i = 0; i < 2; i++) {
381
                mask = 0x100 << i;
382
                if ((val & mask) & !(old & mask))
383
                    mips_set_irq(i);
384
            }
387 385
        }
388 386
#endif
389 387
        rn = "Cause";
......
486 484

  
487 485
/* TLB management */
488 486
#if defined(MIPS_USES_R4K_TLB)
489
__attribute__ (( regparm(1) ))
490 487
static void invalidate_tb (int idx)
491 488
{
492 489
    tlb_t *tlb;
......
505 502
    }
506 503
}
507 504

  
508
__attribute__ (( regparm(1) ))
509 505
static void fill_tb (int idx)
510 506
{
511 507
    tlb_t *tlb;
......
584 580
}
585 581
#endif
586 582

  
587
__attribute__ (( regparm(1) ))
588 583
void op_dump_ldst (const unsigned char *func)
589 584
{
590 585
    if (loglevel)
......
608 603
    }
609 604
}
610 605

  
611
__attribute__ (( regparm(1) ))
612 606
void do_pmon (int function)
613 607
{
614 608
    function /= 2;
......
634 628
        break;
635 629
    }
636 630
}
631

  
632
#if !defined(CONFIG_USER_ONLY) 
633

  
634
#define MMUSUFFIX _mmu
635
#define GETPC() (__builtin_return_address(0))
636

  
637
#define SHIFT 0
638
#include "softmmu_template.h"
639

  
640
#define SHIFT 1
641
#include "softmmu_template.h"
642

  
643
#define SHIFT 2
644
#include "softmmu_template.h"
645

  
646
#define SHIFT 3
647
#include "softmmu_template.h"
648

  
649
void tlb_fill (target_ulong addr, int is_write, int is_user, void *retaddr)
650
{
651
    TranslationBlock *tb;
652
    CPUState *saved_env;
653
    unsigned long pc;
654
    int ret;
655

  
656
    /* XXX: hack to restore env in all cases, even if not called from
657
       generated code */
658
    saved_env = env;
659
    env = cpu_single_env;
660
    ret = cpu_mips_handle_mmu_fault(env, addr, is_write, is_user, 1);
661
    if (ret) {
662
        if (retaddr) {
663
            /* now we have a real cpu fault */
664
            pc = (unsigned long)retaddr;
665
            tb = tb_find_pc(pc);
666
            if (tb) {
667
                /* the PC is inside the translated code. It means that we have
668
                   a virtual CPU fault */
669
                cpu_restore_state(tb, env, pc, NULL);
670
            }
671
        }
672
        do_raise_exception_err(env->exception_index, env->error_code);
673
    }
674
    env = saved_env;
675
}
676

  
677
#endif

Also available in: Unified diff