Changeset 2bd4fdf in mainline for arch/mips/src/exception.c


Ignore:
Timestamp:
2005-09-06T23:10:17Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b512a8
Parents:
2c9de7e
Message:

MIPS bug fixes.
Added usermode to MIPS, unfortunately impossible to test until
MM is ready.

File:
1 edited

Legend:

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

    r2c9de7e r2bd4fdf  
    4040        __u32 epc;
    4141        __u32 epc_shift = 0;
    42         pri_t pri;
    4342
    4443        ASSERT(CPU != NULL);
     
    5150         */
    5251
    53         pri = cpu_priority_high();
     52        cpu_priority_high();
    5453        epc = cp0_epc_read();
    55         cp0_status_write(cp0_status_read() & ~ cp0_status_exl_exception_bit);
     54        cp0_status_write(cp0_status_read() & ~ (cp0_status_exl_exception_bit |
     55                                                cp0_status_um_bit));
    5656
    5757        if (THREAD) {
    58                 THREAD->saved_pri = pri;
    5958                THREAD->saved_epc = epc;
    6059        }
     
    116115        }
    117116       
    118         if (THREAD) {
    119                 pri = THREAD->saved_pri;
     117        if (THREAD)
    120118                epc = THREAD->saved_epc;
    121         }
    122 
     119       
     120        /* Raise EXL bit before epc_write, so that we support
     121         * properly nested exceptions
     122         */
     123        cp0_status_write(cp0_status_read() | cp0_status_exl_exception_bit);
    123124        cp0_epc_write(epc + epc_shift);
    124         cp0_status_write(cp0_status_read() | cp0_status_exl_exception_bit);
    125         cpu_priority_restore(pri);
    126125}
Note: See TracChangeset for help on using the changeset viewer.