Changeset 238 for trunk/kernel/devices
- Timestamp:
- Jul 19, 2017, 3:31:39 PM (7 years ago)
- Location:
- trunk/kernel/devices
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_dma.c
r188 r238 40 40 extern chdev_directory_t chdev_dir; // allocated in kernel_init.c 41 41 42 ////////////////////////////////// //43 void dev_dma_init( chdev_t * chdev)42 ////////////////////////////////// 43 void dev_dma_init( chdev_t * dma ) 44 44 { 45 // get implementation & channel from DMA chdevdescriptor46 uint32_t impl = chdev->impl;47 uint32_t channel = chdev->channel;45 // get implementation & channel from DMA dma descriptor 46 uint32_t impl = dma->impl; 47 uint32_t channel = dma->channel; 48 48 49 // set chdevname50 snprintf( chdev->name , 16 , "dma_%d_%x" , channel , local_cxy );49 // set dma name 50 snprintf( dma->name , 16 , "dma_%d_%x" , channel , local_cxy ); 51 51 52 52 // set field "cmd", "isr", and call the relevant driver init function 53 53 if( impl == IMPL_DMA_SCL ) 54 54 { 55 chdev->cmd = &soclib_dma_cmd;56 chdev->isr = &soclib_dma_isr;57 soclib_dma_init( chdev);55 dma->cmd = &soclib_dma_cmd; 56 dma->isr = &soclib_dma_isr; 57 soclib_dma_init( dma ); 58 58 } 59 59 else … … 63 63 64 64 // bind IRQ to the core defined by the DMA channel 65 dev_pic_bind_irq( channel , chdev);65 dev_pic_bind_irq( channel , dma ); 66 66 67 67 // enable IRQ 68 dev_pic_enable_irq( channel, chdev);68 dev_pic_enable_irq( channel, XPTR( local_cxy , dma ) ); 69 69 70 70 // create server thread … … 75 75 THREAD_DEV, 76 76 &chdev_sequencial_server, 77 chdev,77 dma, 78 78 cluster_select_local_core() ); 79 79 if( error ) … … 83 83 84 84 // initialises server field in DMA chdev descriptor 85 chdev->server = new_thread;85 dma->server = new_thread; 86 86 87 87 // start server thread -
trunk/kernel/devices/dev_ioc.c
r216 r238 63 63 64 64 // enable IRQ 65 dev_pic_enable_irq( lid , ioc);65 dev_pic_enable_irq( lid , XPTR( local_cxy , ioc ) ); 66 66 67 67 // create server thread -
trunk/kernel/devices/dev_mmc.c
r188 r238 36 36 extern chdev_directory_t chdev_dir; // allocated in kernel_init.c 37 37 38 ////////////////////////////////// //39 void dev_mmc_init( chdev_t * chdev)38 ////////////////////////////////// 39 void dev_mmc_init( chdev_t * mmc ) 40 40 { 41 41 // get implementation from device descriptor 42 uint32_t impl = chdev->impl;43 44 // set chdevname45 snprintf( chdev->name , 16 , "mmc_%x" , local_cxy );42 uint32_t impl = mmc->impl; 43 44 // set mmc name 45 snprintf( mmc->name , 16 , "mmc_%x" , local_cxy ); 46 46 47 47 // set driver specific fields in device descriptor and call driver init function 48 48 if( impl == IMPL_MMC_TSR ) 49 49 { 50 chdev->cmd = &soclib_mmc_cmd;51 chdev->isr = &soclib_mmc_isr;52 soclib_mmc_init( chdev);50 mmc->cmd = &soclib_mmc_cmd; 51 mmc->isr = &soclib_mmc_isr; 52 soclib_mmc_init( mmc ); 53 53 } 54 54 else … … 58 58 59 59 // bind IRQ to CP0 60 dev_pic_bind_irq( 0 , chdev);60 dev_pic_bind_irq( 0 , mmc ); 61 61 62 62 // enable IRQ 63 dev_pic_enable_irq( 0 , chdev);63 dev_pic_enable_irq( 0 , XPTR( local_cxy , mmc ) ); 64 64 65 65 } // end dev_mmc_init() -
trunk/kernel/devices/dev_nic.c
r188 r238 133 133 { 134 134 // enable NIC-RX IRQ 135 dev_pic_enable_irq( core->lid , dev_ ptr);135 dev_pic_enable_irq( core->lid , dev_xp ); 136 136 137 137 // block on THREAD_BLOCKED_IO condition and deschedule … … 140 140 141 141 // disable NIC-RX IRQ 142 dev_pic_disable_irq( core->lid , dev_ ptr);142 dev_pic_disable_irq( core->lid , dev_xp ); 143 143 } 144 144 … … 203 203 { 204 204 // enable NIC-TX IRQ 205 dev_pic_enable_irq( core->lid ,dev_ ptr);205 dev_pic_enable_irq( core->lid ,dev_xp ); 206 206 207 207 // block on THREAD_BLOCKED I/O condition and deschedule … … 210 210 211 211 // disable NIC-TX IRQ 212 dev_pic_disable_irq( core->lid , dev_ ptr);212 dev_pic_disable_irq( core->lid , dev_xp ); 213 213 } 214 214 -
trunk/kernel/devices/dev_txt.c
r188 r238 77 77 78 78 // enable TXT IRQ 79 dev_pic_enable_irq( lid , txt);79 dev_pic_enable_irq( lid , XPTR( local_cxy , txt ) ); 80 80 81 81 // create server thread
Note: See TracChangeset
for help on using the changeset viewer.