static void *stopIntr();


disassembled listing :
stopIntr:
    addiu   sp,sp,-24
    sw      s0,16(sp)
    lui     s0,_hi(data_58)
    addiu   s0,s0,_lo(data_58)
    sw      ra,20(sp)
    lhu     v0,0(s0)
    nop
    beqz    v0,text_614
    move    v0,zero
    jal     EnterCriticalSection
    nop
    lui     v0,_hi(data_10E8)
    lw      v0,_lo(data_10E8)(v0)
    lui     a0,_hi(data_10EC)
    lw      a0,_lo(data_10EC)(a0)
    lhu     v1,0(v0)
    nop
    sh      v1,50(s0)
    lw      v1,0(a0)
    lui     a0,_hi(data_10E4)
    lw      a0,_lo(data_10E4)(a0)
    sw      v1,52(s0)
    sh      zero,0(v0)
    lhu     v0,0(v0)
    nop
    sh      v0,0(a0)
    lui     a0,_hi(data_10EC)
    lw      a0,_lo(data_10EC)(a0)
    lui     v1,$7777
    lw      v0,0(a0)
    ori     v1,v1,$7777
    and     v0,v0,v1
    jal     ResetEntryInt
    sw      v0,0(a0)
    move    v0,s0
    sh      zero,0(v0)
text_614:
    lw      ra,20(sp)
    lw      s0,16(sp)
    jr      ra
    addiu   sp,sp,24
source code :
static struct
{
    u_short     started;
    u_short     trapped;
    void        (*cbIntr[11])();
    u_short     mask, oldmask;
    u_long      dma;
    jmp_buf     trap;
    u_char      stack[0x1000];
} intrData;

static volatile u_short *int_reg = (void *)0x1f801070;
static volatile u_short *int_mask = (void *)0x1f801074;
static u_long *dpcr = (void *)0x1f8010f0;

static void *stopIntr()
{
    if(intrData.started)
    {
        EnterCriticalSection();
        intrData.oldmask = *int_mask;
        intrData.dma = *dpcr;
        *int_reg = *int_mask = 0;
        *dpcr &= 0x77777777;
        ResetEntryInt();
        intrData.started = 0;
        return &intrData;
    }
    else return 0;
}
reversed listing :
stopIntr:
    subu    $sp,$sp,24
    sw      $16,16($sp)
    la      $16,intrData
    sw      $31,20($sp)
    lhu     $2,0($16)
    nop
    beq     $2,$0,$L32
    move    $2,$0
    jal     EnterCriticalSection
    lw      $2,int_mask
    lw      $4,dpcr
    lhu     $3,0($2)
    nop
    sh      $3,intrData+50
    lw      $3,0($4)
    lw      $4,int_reg
    sw      $3,intrData+52
    sh      $0,0($2)
    lhu     $2,0($2)
    nop
    sh      $2,0($4)
    lw      $4,dpcr
    li      $3,0x77770000
    lw      $2,0($4)
    ori     $3,$3,0x7777
    and     $2,$2,$3
    jal     ResetEntryInt
    sw      $2,0($4)
    move    $2,$16
    sh      $0,0($2)
$L32:
    lw      $31,20($sp)
    lw      $16,16($sp)
    j       $31
    addu    $sp,$sp,24
coincidence: 100%

STATUS: COMPLETE
19 Apr 2003
Hosted by uCoz