Changeset 909c6e3 in mainline for arch/mips/src/exception.c


Ignore:
Timestamp:
2005-09-07T09:44:30Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d246e7e
Parents:
24bd23a
Message:

MIPS exception now saves all necesssary information only on stack.

File:
1 edited

Legend:

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

    r24bd23a r909c6e3  
    3535#include <debug.h>
    3636
    37 void exception(void)
     37void exception(struct exception_regdump *pstate)
    3838{
    3939        int excno;
    40         __u32 epc;
    4140        __u32 epc_shift = 0;
    4241
     
    4645         * NOTE ON OPERATION ORDERING
    4746         *
    48          * On entry, cpu_priority_high() must be called before exception bit is cleared.
    49          * On exit, exception bit must be set before cpu_priority_restore() is called.
     47         * On entry, cpu_priority_high() must be called before
     48         * exception bit is cleared.
    5049         */
    5150
    5251        cpu_priority_high();
    53         epc = cp0_epc_read();
    5452        cp0_status_write(cp0_status_read() & ~ (cp0_status_exl_exception_bit |
    5553                                                cp0_status_um_bit));
    5654
    57         if (THREAD) {
    58                 THREAD->saved_epc = epc;
    59         }
    6055        /* decode exception number and process the exception */
    6156        switch (excno = (cp0_cause_read() >> 2) & 0x1f) {
     
    6560                case EXC_TLBL:
    6661                case EXC_TLBS:
    67                         tlb_invalid();
     62                        tlb_invalid(pstate);
    6863                        break;
    6964                case EXC_Mod:
     
    115110        }
    116111       
    117         if (THREAD)
    118                 epc = THREAD->saved_epc;
    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);
    124         cp0_epc_write(epc + epc_shift);
     112        pstate->epc += epc_shift;
    125113}
Note: See TracChangeset for help on using the changeset viewer.