Changeset 407 for trunk/kernel/devices
- Timestamp:
- Nov 7, 2017, 3:08:12 PM (5 years ago)
- Location:
- trunk/kernel/devices
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_dma.c
r406 r407 88 88 thread_t * this = CURRENT_THREAD; 89 89 90 dma_dmsg("\n[D MSG] %s : enters for thread %x / dst = %l /src = %l / size = %x\n",90 dma_dmsg("\n[DBG] %s : enters for thread %x / dst = %l /src = %l / size = %x\n", 91 91 __FUNCTION__ , this->trdid , dst_xp , src_xp , size ); 92 92 … … 108 108 // block client thread on THREAD_BLOCKED_IO and deschedule. 109 109 // it is re-activated by the ISR signaling IO operation completion. 110 chdev_register_command( dev_xp , this);110 chdev_register_command( dev_xp ); 111 111 112 dma_dmsg("\n[D MSG] %s : completes for thread %x / error = %d\n",112 dma_dmsg("\n[DBG] %s : completes for thread %x / error = %d\n", 113 113 __FUNCTION__ , this->trdid , this->dma_cmd.error ); 114 114 -
trunk/kernel/devices/dev_fbf.c
r406 r407 143 143 } 144 144 145 fbf_dmsg("\n[D MSG] %s : thread %x in process %x / vaddr = %p / paddr = %l\n",145 fbf_dmsg("\n[DBG] %s : thread %x in process %x / vaddr = %p / paddr = %l\n", 146 146 __FUNCTION__ , this->trdid , this->process->pid , buffer , buf_paddr ); 147 147 -
trunk/kernel/devices/dev_ioc.c
r406 r407 51 51 52 52 // set chdev name 53 snprintf( ioc->name , 16 , "ioc _%d" , channel );53 snprintf( ioc->name , 16 , "ioc%d" , channel ); 54 54 55 55 // call driver init function … … 90 90 // It builds and registers the command in the calling thread descriptor. 91 91 // Then, it registers the calling thead in chdev waiting queue. 92 // Finally it blocks on the THREAD_BLOCKED_ DEVcondition and deschedule.92 // Finally it blocks on the THREAD_BLOCKED_IO condition and deschedule. 93 93 ////////////////////////////////////i///////////////////////////////////////////// 94 94 static error_t dev_ioc_access( uint32_t cmd_type, … … 99 99 thread_t * this = CURRENT_THREAD; // pointer on client thread 100 100 101 ioc_dmsg("\n[D MSG] %s : thread %x in process %x"101 ioc_dmsg("\n[DBG] %s : thread %x in process %x" 102 102 " for lba = %x / buffer = %x / at cycle %d\n", 103 103 __FUNCTION__ , this->trdid , this->process->pid , … … 126 126 // block client thread on THREAD_BLOCKED_IO and deschedule. 127 127 // it is re-activated by the ISR signaling IO operation completion. 128 chdev_register_command( dev_xp , this);129 130 ioc_dmsg("\n[D MSG] in %s : thread %x in process %x"128 chdev_register_command( dev_xp ); 129 130 ioc_dmsg("\n[DBG] in %s : thread %x in process %x" 131 131 " completes / error = %d / at cycle %d\n", 132 132 __FUNCTION__ , this->trdid , this->process->pid , … … 162 162 thread_t * this = CURRENT_THREAD; 163 163 164 ioc_dmsg("\n[D MSG] %s : core[%x,%d] enter for %d blocks / lba = %x / cycle %d\n",164 ioc_dmsg("\n[DBG] %s : core[%x,%d] enter for %d blocks / lba = %x / cycle %d\n", 165 165 __FUNCTION__ , local_cxy , this->core->lid , count , lba , hal_time_stamp() ); 166 166 … … 199 199 dev_pic_enable_irq( lid , ioc_xp ); 200 200 201 ioc_dmsg("\n[D MSG] %s : core[%x,%d] exit / error = %d / cycle %d\n",201 ioc_dmsg("\n[DBG] %s : core[%x,%d] exit / error = %d / cycle %d\n", 202 202 __FUNCTION__ , local_cxy , this->core->lid , this->ioc_cmd.error , hal_time_stamp() ); 203 203 -
trunk/kernel/devices/dev_mmc.c
r406 r407 99 99 thread_t * this = CURRENT_THREAD; 100 100 101 mmc_dmsg("\n[D MSG] %s enters for thread %x in process %x / buf_xp = %l\n",101 mmc_dmsg("\n[DBG] %s enters for thread %x in process %x / buf_xp = %l\n", 102 102 __FUNCTION__ , this->trdid , this->process->pid , buf_xp ); 103 103 … … 124 124 error = dev_mmc_access( this ); 125 125 126 mmc_dmsg("\n[D MSG] %s completes for thread %x in process %x / error = %d\n",126 mmc_dmsg("\n[DBG] %s completes for thread %x in process %x / error = %d\n", 127 127 __FUNCTION__ , this->trdid , this->process->pid , error ); 128 128 … … 139 139 thread_t * this = CURRENT_THREAD; 140 140 141 mmc_dmsg("\n[D MSG] %s enters for thread %x in process %x / buf_xp = %l\n",141 mmc_dmsg("\n[DBG] %s enters for thread %x in process %x / buf_xp = %l\n", 142 142 __FUNCTION__ , this->trdid , this->process->pid , buf_xp ); 143 143 … … 164 164 error = dev_mmc_access( this ); 165 165 166 mmc_dmsg("\n[D MSG] %s completes for thread %x in process %x / error = %d\n",166 mmc_dmsg("\n[DBG] %s completes for thread %x in process %x / error = %d\n", 167 167 __FUNCTION__ , this->trdid , this->process->pid , error ); 168 168 -
trunk/kernel/devices/dev_nic.c
r406 r407 51 51 52 52 // set chdev name 53 if( is_rx ) snprintf( nic->name , 16 , "nic _rx_%d" , channel );54 else snprintf( nic->name , 16 , "nic _tx_%d" , channel );53 if( is_rx ) snprintf( nic->name , 16 , "nic%d_rx" , channel ); 54 else snprintf( nic->name , 16 , "nic%d_tx" , channel ); 55 55 56 56 // call driver init function … … 97 97 core_t * core = thread_ptr->core; 98 98 99 nic_dmsg("\n[D MSG] %s enters for NIC-RX thread on core %d in cluster %x\n",99 nic_dmsg("\n[DBG] %s enters for NIC-RX thread on core %d in cluster %x\n", 100 100 __FUNCTION__ , core->lid , local_cxy ); 101 101 … … 129 129 // block on THREAD_BLOCKED_IO condition and deschedule 130 130 thread_block( thread_ptr , THREAD_BLOCKED_IO ); 131 sched_yield( NULL);131 sched_yield(); 132 132 133 133 // disable NIC-RX IRQ … … 147 147 pkd->length = thread_ptr->nic_cmd.length; 148 148 149 nic_dmsg("\n[D MSG] %s exit for NIC-RX thread on core %d in cluster %x\n",149 nic_dmsg("\n[DBG] %s exit for NIC-RX thread on core %d in cluster %x\n", 150 150 __FUNCTION__ , core->lid , local_cxy ); 151 151 … … 167 167 core_t * core = thread_ptr->core; 168 168 169 nic_dmsg("\n[D MSG] %s enters for NIC-RX thread on core %d in cluster %x\n",169 nic_dmsg("\n[DBG] %s enters for NIC-RX thread on core %d in cluster %x\n", 170 170 __FUNCTION__ , core->lid , local_cxy ); 171 171 … … 199 199 // block on THREAD_BLOCKED I/O condition and deschedule 200 200 thread_block( thread_ptr , THREAD_BLOCKED_IO ); 201 sched_yield( NULL);201 sched_yield(); 202 202 203 203 // disable NIC-TX IRQ … … 215 215 if( error ) return error; 216 216 217 nic_dmsg("\n[D MSG] %s exit for NIC-TX thread on core %d in cluster %x\n",217 nic_dmsg("\n[DBG] %s exit for NIC-TX thread on core %d in cluster %x\n", 218 218 __FUNCTION__ , core->lid , local_cxy ); 219 219 -
trunk/kernel/devices/dev_nic.h
r14 r407 107 107 enum nic_impl_e 108 108 { 109 IMPL_NIC_ SOC= 0,109 IMPL_NIC_CBF = 0, 110 110 IMPL_NIC_I86 = 1, 111 111 } -
trunk/kernel/devices/dev_pic.c
r406 r407 36 36 37 37 extern chdev_directory_t chdev_dir; // allocated in kernel_init.c 38 extern iopic_input_t iopic_input; // allocated in kernel_init.c 38 39 39 40 /////////////////////////////////// … … 83 84 xptr_t src_chdev_xp ) 84 85 { 85 irq_dmsg("\n[DMSG] %s : core = [%x,%d] / src_chdev_cxy = %x / src_chdev_ptr = %x\n", 86 __FUNCTION__ , local_cxy , lid , GET_CXY(src_chdev_xp) , GET_PTR(src_chdev_xp) ); 86 87 irq_dmsg("\n[DBG] %s : core = [%x,%d] / src_chdev_cxy = %x / src_chdev_ptr = %x\n", 88 __FUNCTION__ , local_cxy , lid , GET_CXY(src_chdev_xp) , GET_PTR(src_chdev_xp) ); 87 89 88 90 // get pointer on PIC chdev … … 101 103 xptr_t src_chdev_xp ) 102 104 { 103 irq_dmsg("\n[DMSG] %s : core = [%x,%d] / src_chdev_cxy = %x / src_chdev_ptr = %x\n", 104 __FUNCTION__ , local_cxy , lid , GET_CXY(src_chdev_xp) , GET_PTR(src_chdev_xp) ); 105 106 irq_dmsg("\n[DBG] %s : core = [%x,%d] / src_chdev_cxy = %x / src_chdev_ptr = %x\n", 107 __FUNCTION__ , local_cxy , lid , GET_CXY(src_chdev_xp) , GET_PTR(src_chdev_xp) ); 105 108 106 109 // get pointer on PIC chdev … … 118 121 void dev_pic_enable_timer( uint32_t period ) 119 122 { 120 irq_dmsg("\n[DMSG] %s : core = [%x,%d] / period = %d\n", 121 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , period ); 123 124 irq_dmsg("\n[DBG] %s : core = [%x,%d] / period = %d\n", 125 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , period ); 122 126 123 127 // get pointer on PIC chdev … … 135 139 void dev_pic_enable_ipi() 136 140 { 137 irq_dmsg("\n[DMSG] %s : core = [%x,%d]\n", 138 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid ); 141 142 irq_dmsg("\n[DBG] %s : core = [%x,%d] / cycle %d\n", 143 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , hal_time_stamp() ); 139 144 140 145 // get pointer on PIC chdev … … 153 158 lid_t lid ) 154 159 { 155 irq_dmsg("\n[DMSG] %s : enter / src_core = [%x,%d] / dst_core = [%x,%d] / cycle %d\n", 156 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, hal_time_stamp() ); 160 161 irq_dmsg("\n[DBG] %s : src_core = [%x,%d] / dst_core = [%x,%d] / cycle %d\n", 162 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, hal_time_stamp() ); 157 163 158 164 // get pointer on PIC chdev … … 165 171 // call relevant driver function 166 172 f( cxy , lid ); 167 168 irq_dmsg("\n[DMSG] %s : exit / src_core = [%x,%d] / dst_core = [%x,%d] / cycle %d\n", 169 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cxy, lid, hal_time_stamp() ); 170 } 171 173 } 174 175 ////////////////////// 176 void dev_pic_ack_ipi() 177 { 178 179 irq_dmsg("\n[DBG] %s : core = [%x,%d] / cycle %d\n", 180 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, hal_time_stamp() ); 181 182 // get pointer on PIC chdev 183 chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic ); 184 cxy_t pic_cxy = GET_CXY( chdev_dir.pic ); 185 186 // get pointer on ack_ipi function 187 ack_ipi_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.ack_ipi ) ); 188 189 // call relevant driver function 190 f(); 191 } 192 193 ///////////////////////////// 194 void dev_pic_inputs_display() 195 { 196 uint32_t k; 197 uint32_t save_sr; 198 199 // get pointers on TXT0 chdev 200 xptr_t txt0_xp = chdev_dir.txt_tx[0]; 201 cxy_t txt0_cxy = GET_CXY( txt0_xp ); 202 chdev_t * txt0_ptr = GET_PTR( txt0_xp ); 203 204 // get extended pointer on remote TXT0 chdev lock 205 xptr_t lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock ); 206 207 // get TXT0 lock in busy waiting mode 208 remote_spinlock_lock_busy( lock_xp , &save_sr ); 209 210 nolock_printk("\n***** iopic_inputs\n"); 211 212 for( k = 0 ; k < CONFIG_MAX_IOC_CHANNELS ; k++ ) 213 { 214 nolock_printk(" - IOC[%d] hwi_id = %d\n", k , iopic_input.ioc[k] ); 215 } 216 217 for( k = 0 ; k < CONFIG_MAX_TXT_CHANNELS ; k++ ) 218 { 219 nolock_printk(" - TXT_TX[%d] hwi_id = %d\n", k , iopic_input.txt_tx[k] ); 220 nolock_printk(" - TXT_RX[%d] hwi_id = %d\n", k , iopic_input.txt_rx[k] ); 221 } 222 223 for( k = 0 ; k < CONFIG_MAX_NIC_CHANNELS ; k++ ) 224 { 225 nolock_printk(" - NIC_TX[%d] hwi_id = %d\n", k , iopic_input.nic_tx[k] ); 226 nolock_printk(" - NIC_RX[%d] hwi_id = %d\n", k , iopic_input.nic_rx[k] ); 227 } 228 229 // release TXT0 lock 230 remote_spinlock_unlock_busy( lock_xp , save_sr ); 231 } 232 233 -
trunk/kernel/devices/dev_pic.h
r406 r407 80 80 /***************************************************************************************** 81 81 * This defines the specific extension for the PIC chdev descriptor. 82 * It contains four function pointers on the four PIC command types,83 * that must be implemented by alldrivers.82 * It contains the function pointers for all functions that mus be implemented 83 * by all implementation specific drivers. 84 84 ****************************************************************************************/ 85 85 … … 90 90 typedef void (enable_ipi_t) ( ); 91 91 typedef void (send_ipi_t) ( cxy_t cxy , lid_t lid ); 92 typedef void (ack_ipi_t) ( ); 92 93 typedef void (extend_init_t) ( uint32_t * lapic_base ); 93 94 … … 98 99 disable_irq_t * disable_irq; /*! pointer on the driver "disable_irq" function */ 99 100 enable_timer_t * enable_timer; /*! pointer on the driver "enable_timer" function */ 100 enable_ timer_t* enable_ipi; /*! pointer on the driver "enable_ipi" function */101 enable_ipi_t * enable_ipi; /*! pointer on the driver "enable_ipi" function */ 101 102 send_ipi_t * send_ipi; /*! pointer on the driver "send_ipi" function */ 103 ack_ipi_t * ack_ipi; /*! pointer on the driver "ack_ipi" function */ 102 104 extend_init_t * extend_init; /*! pointer on the driver "init_extend" function */ 103 105 } … … 109 111 * It describes the hardware wiring of IRQs between external peripherals and the IOPIC, 110 112 * as each entry contains the input IRQ index in IOPIC. 111 * For a multi-channels peripheral, there is one chdev and one IRQ per channel.113 * For a multi-channels/multi_IRQ peripheral, there is one chdev per IRQ. 112 114 * This structure is replicated in each cluster. It is allocated as a global variable 113 115 * in the kernel_init.c file. … … 116 118 typedef struct iopic_input_s 117 119 { 118 uint32_t txt[CONFIG_MAX_TXT_CHANNELS];119 120 uint32_t ioc[CONFIG_MAX_IOC_CHANNELS]; 121 uint32_t txt_rx[CONFIG_MAX_TXT_CHANNELS]; 122 uint32_t txt_tx[CONFIG_MAX_TXT_CHANNELS]; 120 123 uint32_t nic_rx[CONFIG_MAX_NIC_CHANNELS]; 121 124 uint32_t nic_tx[CONFIG_MAX_NIC_CHANNELS]; … … 180 183 * This is a static binding, defined during kernel init: IRQ can be enabled/disabled, 181 184 * but the binding cannot be released. It can be used for both internal & external IRQs. 185 * The configuration is actually done by the - implementation specific - driver, 186 * and this function just call the relevant driver. 182 187 * WARNING : the IRQ must be explicitely enabled by the dev_pic_enable_irq() function. 183 188 ***************************************************************************************** … … 234 239 lid_t lid ); 235 240 241 /***************************************************************************************** 242 * This function acknowledges the IPI identified by the calling core local index, 243 * in the local LAPIC component. 244 ****************************************************************************************/ 245 void dev_pic_ack_ipi(); 246 247 /***************************************************************************************** 248 * This debug function displays the content of the iopic_input structure, 249 * that register the input IRQS for the external IOPIC controller. 250 ****************************************************************************************/ 251 void dev_pic_inputs_display(); 236 252 237 253 #endif /* _DEV_PIC_H_ */ -
trunk/kernel/devices/dev_txt.c
r406 r407 27 27 #include <hal_drivers.h> 28 28 #include <thread.h> 29 #include <chdev.h> 29 30 #include <rpc.h> 30 31 #include <printk.h> … … 36 37 37 38 extern chdev_directory_t chdev_dir; // allocated in kernel_init.c 39 40 #if CONFIG_READ_DEBUG 41 extern uint32_t enter_txt_read; 42 extern uint32_t exit_txt_read; 43 #endif 38 44 39 45 ////////////////////////////////// … … 47 53 uint32_t channel = txt->channel; 48 54 uint32_t impl = txt->impl; 55 bool_t is_rx = txt->is_rx; 49 56 50 57 assert( (pic_xp != XPTR_NULL) || (channel == 0) , __FUNCTION__ , … … 52 59 53 60 // set chdev name 54 snprintf( txt->name , 16 , "txt_%d" , channel ); 61 if( is_rx ) snprintf( txt->name , 16 , "txt%d_rx" , channel ); 62 else snprintf( txt->name , 16 , "txt%d_tx" , channel ); 55 63 56 64 // call driver init function … … 61 69 if( channel != 0 && impl != IMPL_TXT_RS2 ) 62 70 { 63 // select a core to execute the TXTserver thread71 // select a core to execute the server thread 64 72 lid_t lid = cluster_select_local_core(); 65 73 66 // bind TXTIRQ to the selected core74 // bind IRQ to the selected core 67 75 dev_pic_bind_irq( lid , txt ); 68 76 69 // enable TXTIRQ77 // enable IRQ 70 78 dev_pic_enable_irq( lid , XPTR( local_cxy , txt ) ); 71 79 … … 99 107 uint32_t count ) 100 108 { 109 xptr_t dev_xp; 101 110 thread_t * this = CURRENT_THREAD; 102 111 103 txt_dmsg("\n[DMSG] in %s : thread %x in process %x enters\n",104 __FUNCTION__ , this->trdid , this->process->pid);112 txt_dmsg("\n[DBG] %s : core[%x,%d] (thread %s) enters / cycle %d\n", 113 __FUNCTION__, local_cxy, this->core->lid, thread_type_str(this->type), hal_time_stamp() ); 105 114 106 115 // check channel argument … … 108 117 109 118 // get extended pointer on remote TXT chdev descriptor 110 xptr_t dev_xp = chdev_dir.txt[channel]; 119 if( type == TXT_WRITE ) dev_xp = chdev_dir.txt_tx[channel]; 120 else dev_xp = chdev_dir.txt_rx[channel]; 111 121 112 122 assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined TXT chdev descriptor" ); … … 121 131 // block client thread on THREAD_BLOCKED_IO and deschedule. 122 132 // it is re-activated by the ISR signaling IO operation completion. 123 chdev_register_command( dev_xp , this);133 chdev_register_command( dev_xp ); 124 134 125 txt_dmsg("\n[DMSG] in %s : thread %x in process %x completes / error =%d\n",126 __FUNCTION__ , this->trdid , this->process->pid , this->txt_cmd.error);135 txt_dmsg("\n[DBG] %s : core[%x,%d] (thread %s) exit / cycle %d\n", 136 __FUNCTION__, local_cxy, this->core->lid, thread_type_str(this->type), hal_time_stamp() ); 127 137 128 138 // return I/O operation status from calling thread descriptor … … 135 145 uint32_t count ) 136 146 { 137 return dev_txt_access( TXT_WRITE , channel , buffer , count ); 147 error_t error = dev_txt_access( TXT_WRITE , channel , buffer , count ); 148 return error; 138 149 } 139 150 … … 142 153 char * buffer ) 143 154 { 144 return dev_txt_access( TXT_READ , channel , buffer , 1 ); 155 156 #if CONFIG_READ_DEBUG 157 enter_txt_read = hal_time_stamp(); 158 #endif 159 160 error_t error = dev_txt_access( TXT_READ , channel , buffer , 1 ); 161 162 #if CONFIG_READ_DEBUG 163 exit_txt_read = hal_time_stamp(); 164 #endif 165 166 return error; 167 145 168 } 146 169 147 /////////////////////////////////////////////// 148 error_t dev_txt_sync_write( uint32_t channel, 149 char * buffer, 170 ////////////////////////////////////////////// 171 error_t dev_txt_sync_write( char * buffer, 150 172 uint32_t count ) 151 173 { 152 // get pointer on calling thread153 thread_t * this = CURRENT_THREAD;174 // get extended pointer on TXT[0] chdev 175 xptr_t dev_xp = chdev_dir.txt_tx[0]; 154 176 155 // get extended pointer on TXT[0] chdev156 xptr_t dev_xp = chdev_dir.txt[channel];177 assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , 178 "undefined TXT0 chdev descriptor" ); 157 179 158 assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined TXT0 chdev descriptor" ); 159 160 // register command in calling thread descriptor 161 this->txt_cmd.dev_xp = dev_xp; 162 this->txt_cmd.type = TXT_SYNC_WRITE; 163 this->txt_cmd.buf_xp = XPTR( local_cxy , buffer ); 164 this->txt_cmd.count = count; 180 // get TXTO chdev cluster and local pointer 181 cxy_t dev_cxy = GET_CXY( dev_xp ); 182 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp ); 165 183 166 184 // get driver command function 167 cxy_t dev_cxy = GET_CXY( dev_xp ); 168 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp ); 169 dev_cmd_t * cmd = (dev_cmd_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ) ); 185 dev_aux_t * aux = (dev_aux_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->aux ) ); 186 187 // build arguments structure 188 txt_aux_t args; 189 args.dev_xp = dev_xp; 190 args.buffer = buffer; 191 args.count = count; 170 192 171 193 // call driver function 172 cmd( XPTR( local_cxy , this ));194 aux( &args ); 173 195 174 // return I/O operation status from calling thread descriptor 175 return this->txt_cmd.error; 196 return 0; 176 197 } 177 198 -
trunk/kernel/devices/dev_txt.h
r254 r407 36 36 * 37 37 * This multi-channels generic TXT device provides access to a text terminal. 38 * It supports three operation types : 38 * 39 * It supports two operations that must be implemented by the driver cmd() function: 39 40 * - TXT_READ : read a single character from the text terminal identified by its channel 40 41 * index, using a descheduling strategy for the calling thread. 41 42 * - TXT_WRITE : write a character string to the text terminal identified by its channel 42 43 * index, using a descheduling strategy for the calling thread. 43 * - TXT_SYNC_WRITE : write a character string to the terminal identified by its channel 44 * index, using a busy waiting strategy for the calling thread. 44 * 45 * It supports one operation, that must be implemented by the driver aux() function 46 * - TXT_SYNC_WRITE write a character string to the TXT0 kernel terminal, using a busy 47 * waiting strategy for the calling thread. 45 48 *****************************************************************************************/ 46 49 … … 58 61 59 62 /****************************************************************************************** 60 * This defines the (implementation independent) command passed to the driver.63 * This defines the arguments passed to the driver CMD function. 61 64 *****************************************************************************************/ 62 65 … … 65 68 TXT_READ = 0, 66 69 TXT_WRITE = 1, 67 TXT_SYNC_WRITE = 2,68 70 }; 69 71 … … 77 79 } 78 80 txt_command_t; 81 82 /****************************************************************************************** 83 * This defines the arguments passed to the driver AUX function. 84 * This function implement the TXT_SYNC_WRITE operation. 85 *****************************************************************************************/ 86 87 typedef struct txt_aux_s 88 { 89 xptr_t dev_xp; /*! extended pointer on the TXT0 device descriptor */ 90 char * buffer; /*! local pointer on characters array */ 91 uint32_t count; /*! number of characters in buffer */ 92 } 93 txt_aux_t; 79 94 80 95 /****************************************************************************************** … … 122 137 123 138 /*************************************************************************************** 124 * This low-level blocking function is used by the kernel to display one string on a 125 * given TXT channel without descheduling the calling thread, without registering it 126 * in the TXT device waiting queue, and without using the TXT irq. 139 * This blocking function is used by the kernel to display a string on the TXT0 140 * terminal, without descheduling the calling thread, without registering it 141 * in the TXT0 device waiting queue, without using the TXT0 irq, and without 142 * interfering with another possible TXT access to another terminal. 143 * As it is used for debug, the command arguments <buffer> and <count> are registerd 144 * in a specific "dbg_cmd" field of the calling thread. 145 * other TXT accesses. 127 146 **************************************************************************************** 128 * @ channel : TXT channel index.129 147 * @ buffer : local pointer on source buffer containing the string. 130 148 * @ count : number of characters. 131 149 * @ returns 0 if success / returns EINVAL if error. 132 150 ***************************************************************************************/ 133 error_t dev_txt_sync_write( uint32_t channel, 134 char * buffer, 151 error_t dev_txt_sync_write( char * buffer, 135 152 uint32_t count ); 136 153
Note: See TracChangeset
for help on using the changeset viewer.