- Timestamp:
- Feb 12, 2019, 1:15:47 PM (6 years ago)
- Location:
- trunk/hal
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/generic/hal_exception.h
r587 r619 26 26 27 27 #include <hal_kernel_types.h> 28 #include <thread.h> 28 29 29 30 ////////////////////////////////////////////////////////////////////////////////////////// … … 59 60 EXCP_USER_ERROR, 60 61 EXCP_KERNEL_PANIC, 62 61 63 } 62 64 exception_handling_type_t; … … 69 71 void hal_do_exception( void ); 70 72 73 71 74 #endif // _HAL_EXCEPTION_H_ -
trunk/hal/generic/hal_remote.h
r570 r619 166 166 * destination remote buffer in kernel space. 167 167 ***************************************************************************************** 168 * @ dst 169 * @ src 168 * @ dst_xp : extended pointer to destination buffer 169 * @ src_xp : extended pointer to source buffer 170 170 * @ size : number of bytes to move 171 171 ****************************************************************************************/ 172 void hal_remote_memcpy( xptr_t dst ,173 xptr_t src ,172 void hal_remote_memcpy( xptr_t dst_xp, 173 xptr_t src_xp, 174 174 uint32_t size ); 175 175 -
trunk/hal/generic/hal_special.h
r480 r619 84 84 * This function returns the current value of stack pointer from core register. 85 85 ****************************************************************************************/ 86 uint32_t hal_get_stack( void ); 86 uint32_t hal_get_sp( void ); 87 88 /***************************************************************************************** 89 * This function returns the current value of the return adddress from core register. 90 ****************************************************************************************/ 91 uint32_t hal_get_ra( void ); 87 92 88 93 /***************************************************************************************** 89 94 * This function registers a new value in the core stack pointer and returns previous one. 90 95 ****************************************************************************************/ 91 inline uint32_t hal_set_s tack( void * new_val );96 inline uint32_t hal_set_sp( void * new_val ); 92 97 93 98 /***************************************************************************************** -
trunk/hal/tsar_mips32/core/hal_exception.c
r611 r619 219 219 uint32_t cycle = (uint32_t)hal_get_cycles(); 220 220 if( DEBUG_HAL_EXCEPTIONS < cycle ) 221 printk("\n[%s] thread[%x,%x] on core [%x,%x] enter /is_ins %d / %s / vaddr %x / cycle %d\n",221 printk("\n[%s] thread[%x,%x] on core [%x,%x] enter\n is_ins %d / %s / vaddr %x / cycle %d\n", 222 222 __FUNCTION__, process->pid, this->trdid, local_cxy, this->core->lid, 223 223 is_ins, hal_mmu_exception_str(excp_code), bad_vaddr, cycle); … … 242 242 cycle = (uint32_t)hal_get_cycles(); 243 243 if( DEBUG_HAL_EXCEPTIONS < cycle ) 244 printk("\n[%s] thread[%x,%x] on core [%x,%x] exit /page-fault handled for vaddr = %x\n",244 printk("\n[%s] thread[%x,%x] on core [%x,%x] exit\n page-fault handled for vaddr = %x\n", 245 245 __FUNCTION__, process->pid, this->trdid, local_cxy, this->core->lid, bad_vaddr ); 246 246 #endif … … 342 342 343 343 ////////////////////////////////////////////////////////////////////////////////////////// 344 // This staticfunction prints on the kernel terminal the saved context (core registers)344 // This function prints on the kernel terminal the saved context (core registers) 345 345 // and the thread state of a faulty thread. 346 346 ////////////////////////////////////////////////////////////////////////////////////////// 347 347 // @ this : pointer on faulty thread descriptor. 348 // @ uzone : pointer on register array.349 348 // @ error : EXCP_USER_ERROR or EXCP_KERNEL_PANIC 350 349 ////////////////////////////////////////////////////////////////////////////////////////// 351 350 static void hal_exception_dump( thread_t * this, 352 reg_t * uzone,353 351 error_t error ) 354 352 { 355 353 core_t * core = this->core; 356 354 process_t * process = this->process; 355 reg_t * uzone = this->uzone_current; 357 356 358 357 // get pointers on TXT0 chdev … … 399 398 uzone[UZ_S0], uzone[UZ_S1], uzone[UZ_S2], uzone[UZ_S3], uzone[UZ_S4] ); 400 399 401 nolock_printk("s5_21 %X s6_22 %X s7_23 %X s8_24 %X ra_25 %X\n",400 nolock_printk("s5_21 %X s6_22 %X s7_23 %X t8_24 %X t9_25 %X\n", 402 401 uzone[UZ_S5], uzone[UZ_S6], uzone[UZ_S7], uzone[UZ_T8], uzone[UZ_T9] ); 403 402 … … 508 507 if( error == EXCP_USER_ERROR ) // user error => kill user process 509 508 { 510 hal_exception_dump( this , uzone ,error );509 hal_exception_dump( this , error ); 511 510 512 511 sys_exit( EXIT_FAILURE ); … … 514 513 else if( error == EXCP_KERNEL_PANIC ) // kernel error => kernel panic 515 514 { 516 hal_exception_dump( this , uzone ,error );515 hal_exception_dump( this , error ); 517 516 518 517 hal_core_sleep(); -
trunk/hal/tsar_mips32/core/hal_special.c
r570 r619 25 25 #include <hal_kernel_types.h> 26 26 #include <hal_special.h> 27 #include <hal_exception.h> 27 28 #include <core.h> 28 29 #include <thread.h> … … 145 146 } 146 147 147 /////////////////////////// ///148 uint32_t hal_get_s tack( void )148 /////////////////////////// 149 uint32_t hal_get_sp( void ) 149 150 { 150 151 register uint32_t sp; … … 155 156 } 156 157 157 ///////////////////////////////////// ///158 uint32_t hal_set_s tack( void * new_val )158 ///////////////////////////////////// 159 uint32_t hal_set_sp( void * new_val ) 159 160 { 160 161 register uint32_t sp; … … 168 169 } 169 170 171 /////////////////////////// 172 uint32_t hal_get_ra( void ) 173 { 174 register uint32_t ra; 175 176 asm volatile ("or %0, $0, $31" : "=&r" (ra)); 177 178 return ra; 179 } 180 170 181 ////////////////////////////////// 171 182 uint32_t hal_get_bad_vaddr( void ) … … 216 227 void hal_core_sleep( void ) 217 228 { 229 thread_t * this = CURRENT_THREAD; 230 231 printk("\n*** thread[%x,%x] on core[%x,%d]/n" 232 " sr = %X / sp = %X / ra = %X\n", 233 this->process->pid, this->trdid, local_cxy, this->core->lid, 234 hal_get_sr(), hal_get_sp(), hal_get_ra() ); 235 218 236 while( 1 ) asm volatile ("nop"); 219 237 } -
trunk/hal/tsar_mips32/drivers/soclib_tty.c
r570 r619 131 131 #endif 132 132 133 #if( DEBUG_HAL_TXT_TX || DEBUG_HAL_TXT_RX ) 134 thread_t * this = CURRENT_THREAD; 135 #endif 136 133 137 // get TXT device cluster and pointers 134 138 xptr_t dev_xp = (xptr_t)hal_remote_l64( XPTR( th_cxy , &th_ptr->txt_cmd.dev_xp ) ); … … 160 164 161 165 #if DEBUG_HAL_TXT_TX 162 uint32_t tx_cycle = (uint32_t)hal_get_cycles();166 uint32_t tx_cycle = (uint32_t)hal_get_cycles(); 163 167 if( DEBUG_HAL_TXT_TX < tx_cycle ) 164 printk("\n[ DBG] %s : thread %xput character <%c> to TXT%d_TX fifo / cycle %d\n",165 __FUNCTION__, CURRENT_THREAD, byte, channel, tx_cycle );168 printk("\n[%s] thread[%x,%x] put character <%c> to TXT%d_TX fifo / cycle %d\n", 169 __FUNCTION__, this->process->pid, this->trdid, byte, channel, tx_cycle ); 166 170 #endif 167 171 // write byte to FIFO … … 195 199 } 196 200 /////////////////////////// 197 else if( type == TXT_READ ) // read bytes from TTY_RX FIFO201 else if( type == TXT_READ ) // read several bytes from TTY_RX FIFO 198 202 { 199 203 fifo = &tty_rx_fifo[channel]; … … 211 215 uint32_t rx_cycle = (uint32_t)hal_get_cycles(); 212 216 if( DEBUG_HAL_TXT_RX < rx_cycle ) 213 printk("\n[ DBG] %s : thread %xget character <%c> from TXT%d_RX fifo / cycle %d\n",214 __FUNCTION__, CURRENT_THREAD, byte, channel, rx_cycle );217 printk("\n[%s] thread[%x,%x] get character <%c> from TXT%d_RX fifo / cycle %d\n", 218 __FUNCTION__, this->process->pid, this->trdid, byte, channel, rx_cycle ); 215 219 #endif 216 220 // update FIFO state … … 328 332 #if DEBUG_HAL_TXT_RX 329 333 if( DEBUG_HAL_TXT_RX < rx_cycle ) 330 printk("\n[ DBG] %s :read ^Z character from TXT%d\n", __FUNCTION__, channel );334 printk("\n[%s] read ^Z character from TXT%d\n", __FUNCTION__, channel ); 331 335 #endif 332 336 // get pointers on TXT owner process in owner cluster … … 381 385 #if DEBUG_HAL_TXT_RX 382 386 if( DEBUG_HAL_TXT_RX < rx_cycle ) 383 printk("\n[ DBG] %s :read ^C character from TXT%d\n", __FUNCTION__, channel );387 printk("\n[%s] read ^C character from TXT%d\n", __FUNCTION__, channel ); 384 388 #endif 385 389 // get pointer on TXT owner process in owner cluster … … 434 438 #if DEBUG_HAL_TXT_RX 435 439 if( DEBUG_HAL_TXT_RX < rx_cycle ) 436 printk("\n[ DBG] %s :put character <%c> to TXT%d_RX fifo\n",440 printk("\n[%s] put character <%c> to TXT%d_RX fifo\n", 437 441 __FUNCTION__, byte, channel ); 438 442 #endif … … 481 485 #if DEBUG_HAL_TXT_TX 482 486 if( DEBUG_HAL_TXT_TX < tx_cycle ) 483 printk("\n[ DBG] %s :get character <%c> from TXT%d_TX fifo\n",487 printk("\n[%s] get character <%c> from TXT%d_TX fifo\n", 484 488 __FUNCTION__, byte, channel ); 485 489 #endif
Note: See TracChangeset
for help on using the changeset viewer.