Ignore:
Timestamp:
Aug 29, 2017, 12:03:37 PM (7 years ago)
Author:
alain
Message:

This version executed successfully the user "init" process on a mono-processor TSAR architecture.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/drivers/soclib_pic.c

    r380 r406  
    116116    chdev_t  * src_chdev;    // pointer on source chdev descriptor
    117117    uint32_t   index;        // WTI / HWI / PTI index
    118     uint32_t   ack;          // XCU acknowledge requires a read...
    119 
    120     core_t * core = CURRENT_THREAD->core;
     118
     119    uint32_t * xcu_base = soclib_pic_xcu_base();
     120
     121    core_t   * core = CURRENT_THREAD->core;
    121122
    122123    // get XCU status
     
    126127                           &pti_status );
    127128
    128     irq_dmsg("\n[INFO] %s : enter for core[%x,%d] / WTI = %x / HWI = %x / WTI = %x\n",
     129    irq_dmsg("\n[DMSG] %s : enter for core[%x,%d] / WTI = %x / HWI = %x / WTI = %x\n",
    129130             __FUNCTION__ , local_cxy , core->lid , wti_status , hwi_status , pti_status );
    130131
     
    139140            assert( (index == core->lid) , __FUNCTION__ , "illegal IPI index" );
    140141
    141             // read mailbox content to acknowledge WTI,
    142             uint32_t * base = soclib_pic_xcu_base();
    143             ack = base[(XCU_WTI_REG << 5) | core->lid];
     142            irq_dmsg("\n[DMSG] %s : core[%x,%d] received an IPI / cycle %d\n",
     143             __FUNCTION__ , local_cxy , core->lid , hal_time_stamp() );
     144
     145            // acknowledge WTI (this require an XCU read)
     146            uint32_t   ack  = xcu_base[(XCU_WTI_REG << 5) | core->lid];
    144147           
    145148            // check RPC FIFO,  and activate or create a RPC thread
     
    165168            else                                 // call relevant ISR
    166169            {
    167                         irq_dmsg("\n[INFO] %s received WTI : index = %d for core %d in cluster %d\n",
    168                          __FUNCTION__ , index , core->lid , local_cxy );
     170                irq_dmsg("\n[DMSG] %s : core[%x,%d] received external WTI %d / cycle %d\n",
     171                __FUNCTION__ , local_cxy , core->lid , index , hal_time_stamp() );
    169172
    170173                // call ISR
     
    189192
    190193            // disable HWI in local XCU controller
    191             uint32_t * base = soclib_pic_xcu_base();
    192             base[(XCU_MSK_HWI_DISABLE << 5) | core->lid] = 1 << core->lid;
     194            xcu_base[(XCU_MSK_HWI_DISABLE << 5) | core->lid] = 1 << core->lid;
    193195                }
    194196        else                    // call relevant ISR
    195197        {
    196                     irq_dmsg("\n[INFO] %s received HWI : index = %d for core %d in cluster %d\n",
    197                      __FUNCTION__ , index , core->lid , local_cxy );
     198            irq_dmsg("\n[DMSG] %s : core[%x,%d] received HWI %d / cycle %d\n",
     199            __FUNCTION__ , local_cxy , core->lid , index , hal_time_stamp() );
    198200
    199201            // call ISR
     
    206208        index = pti_status - 1;
    207209
    208                 irq_dmsg("\n[INFO] %s received PTI : index = %d for cpu %d in cluster %d\n",
    209                  __FUNCTION__ , index , core->lid , local_cxy );
     210        irq_dmsg("\n[DMSG] %s : core[%x,%d] received PTI %d / cycle %d\n",
     211        __FUNCTION__ , core->lid , local_cxy , index , hal_time_stamp() );
    210212
    211213        assert( (index == core->lid) , __FUNCTION__ , "unconsistent PTI index\n");
    212214
    213         // acknowledge PTI
    214         uint32_t * base = soclib_pic_xcu_base();
    215         ack = base[(XCU_PTI_ACK << 5) | core->lid];
     215        // acknowledge PTI (this require a read access to XCU)
     216        uint32_t   ack  = xcu_base[(XCU_PTI_ACK << 5) | core->lid];
    216217
    217218        // execute all actions related to TICK event
    218         core_clock( core );
     219        // condition is always true, but we must use the ack value
     220        if( ack + 1 ) core_clock( core );
    219221        }
    220222}  // end soclib_pic_irq_handler()
Note: See TracChangeset for help on using the changeset viewer.