Changeset 5201199 in mainline


Ignore:
Timestamp:
2006-03-24T12:17:22Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4037847
Parents:
11cb08ca
Message:

Fix bad order of EPC & STATUS change in syscall_shortcut.

Location:
arch/mips32/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/src/exception.c

    r11cb08ca r5201199  
    9090                istate->epc += 4;
    9191                istate->v1 = istate->k1;
    92         } else {
    93                 print_regdump(istate);
    94                 panic("reserved instruction");
    95         }
     92        } else
     93                unhandled_exception(n, istate);
    9694}
    9795
  • arch/mips32/src/start.S

    r11cb08ca r5201199  
    252252        mtc0 $t0, $status
    253253
     254        # CALL Syscall handler
    254255        jal syscall_handler
    255256        sw $v0, SS_ARG4($sp)        # save v0 - arg4 to stack
    256257
    257         # restore epc+4
    258         lw $t0,SS_EPC($sp)
    259         addi $t0, $t0, 4
    260         mtc0 $t0, $epc
    261        
    262258        # restore status
    263259        mfc0 $t0, $status
    264260        lw $t1,SS_STATUS($sp)
    265261
     262        # Change back to EXL=1(from last exception), otherwise
     263        # an interrupt could rewrite the CP0-EPC
    266264        li $t2, ~REG_SAVE_MASK      # Mask UM,EXL,ERL,IE
    267265        and $t0, $t0, $t2
     
    269267        mtc0 $t0, $status
    270268                       
     269        # restore epc+4
     270        lw $t0,SS_EPC($sp)
     271        addi $t0, $t0, 4
     272        mtc0 $t0, $epc
     273       
    271274        lw $sp,SS_SP($sp) # restore sp
    272275       
Note: See TracChangeset for help on using the changeset viewer.