Ignore:
Timestamp:
Jul 31, 2017, 1:59:52 PM (7 years ago)
Author:
alain
Message:

Several modifs in the generic scheduler and in the hal_context to
fix the context switch mechanism.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/core/hal_exception.c

    r101 r296  
    4949typedef enum
    5050{
    51     XCODE_ADEL = 4,        // Illegal address for data load
    52     XCODE_ADES = 5,        // Illegal address for data store
    53     XCODE_IBE  = 6,        // Instruction MMU exception       (can be NON-FATAL)
    54     XCODE_DBE  = 7,        // Data MMU exception              (can be NON-FATAL)
    55     XCODE_RI   = 10,       // Reserved instruction exception
    56     XCODE_CPU  = 11,       // Coprocessor unusable exception  (can be NON-FATAl)
    57     XCODE_OVR  = 12        // Arithmetic Overflow exception
     51    XCODE_ADEL = 0x4,        // Illegal address for data load
     52    XCODE_ADES = 0x5,        // Illegal address for data store
     53    XCODE_IBE  = 0x6,        // Instruction MMU exception       (can be NON-FATAL)
     54    XCODE_DBE  = 0x7,        // Data MMU exception              (can be NON-FATAL)
     55    XCODE_RI   = 0xA,        // Reserved instruction exception
     56    XCODE_CPU  = 0xB,        // Coprocessor unusable exception  (can be NON-FATAl)
     57    XCODE_OVR  = 0xC,        // Arithmetic Overflow exception
    5858}
    5959xcode_values_t;
     
    105105        case XCODE_RI:   // user fatal error
    106106        {
    107             printk("\n[ERROR] in thread %x / arithmetic overflow\n",
     107            printk("\n[ERROR] in thread %x / Illegal Codop\n",
    108108                           this->trdid );
    109109                    error = EXCP_USER_ERROR;
     
    123123        default:
    124124        {
    125             printk("\n[PANIC] in %s for thread %x / illegal XCODE value\n",
    126                            __FUNCTION__ , this->trdid );
     125            printk("\n[PANIC] in %s for thread %x / illegal XCODE value = %x\n",
     126                           __FUNCTION__ , this->trdid , excCode );
    127127                    error = EXCP_USER_ERROR;
    128128        }
     
    149149    remote_spinlock_lock( XPTR( LOCAL_CLUSTER->io_cxy , &exception_lock ) );
    150150
    151     // dump core registers values
     151    if( this->type == THREAD_USER )
     152    printk("\n================= USER ERROR =======================================\n");
     153    else
     154    printk("\n================= KERNEL PANIC =====================================\n");
    152155
    153     printk("\n====================================================================\n");
    154         printk("  thread %x / process %x / core %x / cycle %d\n",
    155            this->trdid , this->process->pid , this->core->gid , hal_get_cycles() );
     156        printk("  thread type = %s / trdid = %x / pid %x / core[%x,%d]\n"
     157           "  local locks = %d / remote locks = %d / blocked_vector = %X\n\n",
     158           thread_type_str(this->type), this->trdid, this->process->pid, local_cxy,
     159           this->core->lid, this->local_locks, this->remote_locks, this->blocked );
    156160
    157         printk("  - Processor State:\n");
    158  
    159         printk("    CR:   %x\tEPC:  %x\tSR:   %x\tSP:    %x\n",
     161        printk("CR    %X  EPC   %X  SR    %X  SP     %X\n",
    160162                   regs_tbl[UZ_CR], regs_tbl[UZ_EPC], regs_tbl[UZ_SR], regs_tbl[UZ_SP]);
    161163
    162     printk("    at_1  %x\tv0_2  %x\t\tv1_3  %x\ta0_4   %x\ta1_5   %x\n",
     164    printk("at_1  %X  v0_2  %X  v1_3  %X  a0_4   %X  a1_5   %X\n",
    163165               regs_tbl[UZ_AT], regs_tbl[UZ_V0], regs_tbl[UZ_V1], regs_tbl[UZ_A0], regs_tbl[UZ_A1]);
    164166
    165     printk("    a2_6  %x\t\ta3_7  %x\tt0_8  %x\tt1_9   %x\tt2_10  %x\n",
     167    printk("a2_6  %X  a3_7  %X  t0_8  %X  t1_9   %X  t2_10  %X\n",
    166168                   regs_tbl[UZ_A2],regs_tbl[UZ_A3],regs_tbl[UZ_T0],regs_tbl[UZ_T1],regs_tbl[UZ_T2]);
    167169 
    168     printk("    t3_11 %x\tt4_12 %x\t\tt5_13 %x\tt6_14  %x\tt7_15  %x\n",
     170    printk("t3_11 %X  t4_12 %X  t5_13 %X  t6_14  %X  t7_15  %X\n",
    169171                   regs_tbl[UZ_T3],regs_tbl[UZ_T4],regs_tbl[UZ_T5],regs_tbl[UZ_T6],regs_tbl[UZ_T7]);
    170172
    171     printk("    t8_24 %x\t\tt9_25 %x\tgp_28 %x\tc0_hi  %x\tc0_lo  %x\n",
     173    printk("t8_24 %X  t9_25 %X  gp_28 %X  c0_hi  %X  c0_lo  %X\n",
    172174                   regs_tbl[UZ_T8],regs_tbl[UZ_T9],regs_tbl[UZ_GP],regs_tbl[UZ_HI],regs_tbl[UZ_LO]);
    173175
    174     printk("    s0_16 %x\ts1_17 %x\ts2_18 %x\ts3_19  %x\ts4_20  %x\n",
     176    printk("s0_16 %X  s1_17 %X  s2_18 %X  s3_19  %X  s4_20  %X\n",
    175177                   regs_tbl[UZ_S0],regs_tbl[UZ_S1],regs_tbl[UZ_S2],regs_tbl[UZ_S3],regs_tbl[UZ_S4]);
    176178 
    177     printk("    s5_21 %x\ts6_22 %x\t\ts7_23 %x\ts8_30  %x\tra_31  %x\n\n",
     179    printk("s5_21 %X  s6_22 %X  s7_23 %X  s8_30  %X  ra_31  %X\n",
    178180               regs_tbl[UZ_S5],regs_tbl[UZ_S6],regs_tbl[UZ_S7],regs_tbl[UZ_S8],regs_tbl[UZ_RA]);
    179 
    180     printk("  - Thread State: %x\n"
    181            "    type = %s / local_locks = %d / remote_locks = %d / blocked = %x\n",
    182            thread_type_str( this->type ), this->local_locks, this->remote_locks,
    183            this->blocked );
    184181
    185182    // release the exception_lock
Note: See TracChangeset for help on using the changeset viewer.