Ignore:
Timestamp:
Jul 27, 2017, 12:23:29 AM (7 years ago)
Author:
alain
Message:

1) Introduce independant command fields for the various devices in the thread descriptor.
2) Introduce a new dev_pic_enable_ipi() function in the generic PIC device
3) Fix two bugs identified by Maxime in the scheduler initialisation, and in the sched_select().
4) fix several bugs in the TSAR hal_kentry.S.
5) Introduce a third kgiet segment (besides kdata and kcode) in the TSAR bootloader.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_ioc.c

    r238 r279  
    116116
    117117    // register command in calling thread descriptor
    118     this->command.ioc.dev_xp    = dev_xp;
    119     this->command.ioc.type      = cmd_type;
    120     this->command.ioc.buf_xp    = XPTR( local_cxy , buffer );
    121     this->command.ioc.lba       = lba;
    122     this->command.ioc.count     = count;
     118    this->ioc_cmd.dev_xp    = dev_xp;
     119    this->ioc_cmd.type      = cmd_type;
     120    this->ioc_cmd.buf_xp    = XPTR( local_cxy , buffer );
     121    this->ioc_cmd.lba       = lba;
     122    this->ioc_cmd.count     = count;
    123123
    124124    // register client thread in IOC chdev waiting queue, activate server thread,
     
    130130             " completes / error = %d / at cycle %d\n",
    131131             __FUNCTION__ , this->trdid , this->process->pid ,
    132              this->command.ioc.error , hal_get_cycles() );
     132             this->ioc_cmd.error , hal_get_cycles() );
    133133
    134134    // return I/O operation status
    135     return this->command.ioc.error;
     135    return this->ioc_cmd.error;
    136136
    137137}  // end dev_ioc_access()
     
    158158                           uint32_t   count )
    159159{
     160    ioc_dmsg("\n[INFO] %s : enter in cluster %x\n",
     161             __FUNCTION__ , local_cxy );
     162
    160163    // get pointer on calling thread
    161164    thread_t * this = CURRENT_THREAD;
     
    165168
    166169    // get extended pointer on IOC[0] chdev
    167     xptr_t  dev_xp = chdev_dir.ioc[0];
    168 
    169     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined IOC chdev descriptor" );
     170    xptr_t  ioc_xp = chdev_dir.ioc[0];
     171
     172    assert( (ioc_xp != XPTR_NULL) , __FUNCTION__ , "undefined IOC chdev descriptor" );
    170173
    171174    // register command in calling thread descriptor
    172     this->command.ioc.dev_xp    = dev_xp;
    173     this->command.ioc.type      = IOC_SYNC_READ;
    174     this->command.ioc.buf_xp    = XPTR( local_cxy , buffer );
    175     this->command.ioc.lba       = lba;
    176     this->command.ioc.count     = count;
     175    this->ioc_cmd.dev_xp    = ioc_xp;
     176    this->ioc_cmd.type      = IOC_SYNC_READ;
     177    this->ioc_cmd.buf_xp    = XPTR( local_cxy , buffer );
     178    this->ioc_cmd.lba       = lba;
     179    this->ioc_cmd.count     = count;
    177180
    178181    // get driver command function
    179     cxy_t       dev_cxy = GET_CXY( dev_xp );
    180     chdev_t   * dev_ptr = (chdev_t *)GET_PTR( dev_xp );
    181     dev_cmd_t * cmd = (dev_cmd_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ) );
     182    cxy_t       ioc_cxy = GET_CXY( ioc_xp );
     183    chdev_t   * ioc_ptr = (chdev_t *)GET_PTR( ioc_xp );
     184    dev_cmd_t * cmd = (dev_cmd_t *)hal_remote_lpt( XPTR( ioc_cxy , &ioc_ptr->cmd ) );
     185
     186    // get core local index for the core handling the IOC IRQ
     187    thread_t * server = (thread_t *)hal_remote_lpt( XPTR( ioc_cxy , &ioc_ptr->server ) );
     188    core_t   * core   = (core_t *)hal_remote_lpt( XPTR( ioc_cxy , &server->core ) );
     189    lid_t      lid    = (lid_t)hal_remote_lw( XPTR( ioc_cxy , &core->lid ) );
    182190
    183191    // mask the IRQ
    184     thread_t * server = (thread_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->server ) );
    185     core_t   * core = (core_t *)hal_remote_lpt( XPTR( dev_cxy , &server->core ) );
    186     lid_t      lid = (lid_t)hal_remote_lw( XPTR( dev_cxy , &core->lid ) );
    187     dev_pic_disable_irq( lid , dev_xp );
    188 
    189     // call directly driver command
     192    dev_pic_disable_irq( lid , ioc_xp );
     193
     194    ioc_dmsg("\n[INFO] %s : coucou 3\n",
     195             __FUNCTION__ );
     196
     197    // call driver function
    190198    cmd( XPTR( local_cxy , this ) );
    191199
    192200    // unmask the IRQ
    193     dev_pic_enable_irq( lid , dev_xp );
     201    dev_pic_enable_irq( lid , ioc_xp );
     202
     203    ioc_dmsg("\n[INFO] %s : exit in cluster %x\n",
     204             __FUNCTION__ , local_cxy );
    194205
    195206    // return I/O operation status from calling thread descriptor
    196     return this->command.ioc.error;
    197 }
    198 
     207    return this->ioc_cmd.error;
     208
     209}  // end ioc_sync_read()
     210
Note: See TracChangeset for help on using the changeset viewer.