Changeset 279 for trunk/kernel/devices/dev_ioc.c
- Timestamp:
- Jul 27, 2017, 12:23:29 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_ioc.c
r238 r279 116 116 117 117 // 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; 123 123 124 124 // register client thread in IOC chdev waiting queue, activate server thread, … … 130 130 " completes / error = %d / at cycle %d\n", 131 131 __FUNCTION__ , this->trdid , this->process->pid , 132 this-> command.ioc.error , hal_get_cycles() );132 this->ioc_cmd.error , hal_get_cycles() ); 133 133 134 134 // return I/O operation status 135 return this-> command.ioc.error;135 return this->ioc_cmd.error; 136 136 137 137 } // end dev_ioc_access() … … 158 158 uint32_t count ) 159 159 { 160 ioc_dmsg("\n[INFO] %s : enter in cluster %x\n", 161 __FUNCTION__ , local_cxy ); 162 160 163 // get pointer on calling thread 161 164 thread_t * this = CURRENT_THREAD; … … 165 168 166 169 // 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" ); 170 173 171 174 // 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; 177 180 178 181 // 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 ) ); 182 190 183 191 // 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 d irectly driver command192 dev_pic_disable_irq( lid , ioc_xp ); 193 194 ioc_dmsg("\n[INFO] %s : coucou 3\n", 195 __FUNCTION__ ); 196 197 // call driver function 190 198 cmd( XPTR( local_cxy , this ) ); 191 199 192 200 // 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 ); 194 205 195 206 // 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.