Changeset 4 for trunk/kernel/drivers/soclib/soclib_hba.c
- Timestamp:
- Apr 26, 2017, 2:10:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/drivers/soclib/soclib_hba.c
r1 r4 24 24 #include <printk.h> 25 25 #include <hal_special.h> 26 #include < device.h>26 #include <chdev.h> 27 27 #include <dev_ioc.h> 28 28 #include <soclib_hba.h> … … 54 54 spinlock_t hba_lock; 55 55 56 ///////////////////////////////////// 57 void soclib_hba_init( xptr_t dev_xp)56 /////////////////////////////////////// 57 void soclib_hba_init( chdev_t * chdev ) 58 58 { 59 // get IOC device descriptor cluster and local pointer60 cxy_t dev_cxy = GET_CXY( dev_xp );61 device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );62 63 59 // get hardware device base address 64 xptr_t hba_xp = (xptr_t)hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );60 xptr_t hba_xp = chdev->base; 65 61 66 62 // get hardware device cluster and local pointer … … 73 69 74 70 // set device descriptor extension 75 hal_remote_sw( XPTR( dev_cxy , &dev_ptr->ext.ioc.size ) , block_size );76 hal_remote_sw( XPTR( dev_cxy , &dev_ptr->ext.ioc.count ) , block_count );71 chdev->ext.ioc.size = block_size; 72 chdev->ext.ioc.count = block_count; 77 73 78 74 // reset SOCLIB_HBA driver global variables … … 102 98 103 99 // get command arguments and extended pointer on IOC device 104 to_mem = hal_remote_lw ( XPTR( th_cxy , &th_ptr-> dev.ioc.to_mem ) );105 lba = hal_remote_lw ( XPTR( th_cxy , &th_ptr-> dev.ioc.lba ) );106 count = hal_remote_lw ( XPTR( th_cxy , &th_ptr-> dev.ioc.count ) );107 buf_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr-> dev.ioc.buf_xp ) );108 dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr-> dev.ioc.dev_xp ) );100 to_mem = hal_remote_lw ( XPTR( th_cxy , &th_ptr->command.ioc.to_mem ) ); 101 lba = hal_remote_lw ( XPTR( th_cxy , &th_ptr->command.ioc.lba ) ); 102 count = hal_remote_lw ( XPTR( th_cxy , &th_ptr->command.ioc.count ) ); 103 buf_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->command.ioc.buf_xp ) ); 104 dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->command.ioc.dev_xp ) ); 109 105 110 106 // get IOC device cluster and local pointer 111 cxy_t 112 device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );107 cxy_t dev_cxy = GET_CXY( dev_xp ); 108 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp ); 113 109 114 110 // get extended pointer on SOCLIB-HBA peripheral … … 218 214 219 215 220 //////////////////////////////////////////////////////////////// 221 void __attribute__ ((noinline)) soclib_hba_isr( device_t *dev )216 ///////////////////////////////////////////////////////////////// 217 void __attribute__ ((noinline)) soclib_hba_isr( chdev_t * chdev ) 222 218 { 223 219 // get extended pointer on client thread 224 xptr_t root = XPTR( local_cxy , & dev->wait_root );220 xptr_t root = XPTR( local_cxy , &chdev->wait_root ); 225 221 xptr_t client_xp = XLIST_FIRST_ELEMENT( root , thread_t , wait_list ); 226 222 … … 230 226 231 227 // get SOCLIB_HBA device cluster and local pointer 232 cxy_t hba_cxy = GET_CXY( dev->base );233 uint32_t * hba_ptr = (uint32_t *)GET_PTR( dev->base );228 cxy_t hba_cxy = GET_CXY( chdev->base ); 229 uint32_t * hba_ptr = (uint32_t *)GET_PTR( chdev->base ); 234 230 235 231 // get HBA_PXIS_REG and HBA_PXIS_REG current values … … 253 249 if( error && (iter == fault_id ) ) 254 250 { 255 hal_remote_sw( XPTR( client_cxy , &client_ptr-> dev.ioc.error ) , 1 );251 hal_remote_sw( XPTR( client_cxy , &client_ptr->command.ioc.error ) , 1 ); 256 252 } 257 253 else 258 254 { 259 hal_remote_sw( XPTR( client_cxy , &client_ptr-> dev.ioc.error ) , 0 );255 hal_remote_sw( XPTR( client_cxy , &client_ptr->command.ioc.error ) , 0 ); 260 256 } 261 257
Note: See TracChangeset
for help on using the changeset viewer.