- Timestamp:
- Nov 20, 2020, 12:30:31 AM (4 years ago)
- Location:
- trunk/hal
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/generic/hal_context.h
r654 r679 2 2 * hal_context.h - Generic Thread Context Access API definition. 3 3 * 4 * Author Alain Greiner (2016,2017,2018,2019 )4 * Author Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 50 50 /**************************************************************************************** 51 51 * This function initializes the CPU context of the thread identified by the <thread> 52 * argument. All slots required to start a new thread must be initialized. 52 * argument from the <thread> descriptor, depending on the thread type (user / kernel). 53 * All slots required to start a new thread must be initialized in the thread context. 54 * Moreover, for an user thread, the arguments to be passed to the entry function 55 * depend on the <is_main> argument below: 56 * - a main thread, created by sys_exec(), requires two arguments, defined by the two 57 * <argc> and <argv> arguments below. 58 * define the arguments 59 * - a pthread, created by sys_thread_create() requires only one argument, defined by 60 * the "entry_args" field in the thread descriptor. 53 61 **************************************************************************************** 54 62 * @ thread : pointer on the thread descriptor. 63 * @ is_main : main thread when non zero. 64 * @ argc : actual number of arguments (for main). 65 * @ argv : user space pointer on array of pointers on strings arguments (for main). 55 66 ***************************************************************************************/ 56 void hal_cpu_context_init( struct thread_s * thread ); 67 void hal_cpu_context_init( struct thread_s * thread, 68 bool_t is_main, 69 uint32_t argc, 70 intptr_t argv ); 57 71 58 72 /**************************************************************************************** … … 75 89 ***************************************************************************************/ 76 90 void hal_cpu_context_fork( xptr_t thread_xp ); 77 78 /****************************************************************************************79 * This function is used to implement the exec() system call.80 * 1) It initialize the relevant slots of the the calling thread CPU context.81 * 2) It call the hal_do_cpu_restore() function to return to user mode and start82 * execution of the new process.83 ****************************************************************************************84 * @ thread : pointer on the thread descriptor.85 ***************************************************************************************/86 void hal_cpu_context_exec( struct thread_s * thread );87 91 88 92 /**************************************************************************************** -
trunk/hal/generic/hal_special.h
r625 r679 66 66 67 67 /***************************************************************************************** 68 * This function returns the current value of the hardware cycles counter.68 * This low level function returns the current value of the hardware cycles counter. 69 69 * This cycle counter is reset when the core is initialised (at each boot). 70 70 ****************************************************************************************/ -
trunk/hal/generic/hal_uspace.h
r658 r679 95 95 /***************************************************************************************** 96 96 * This function returns the length of a string located in user space. 97 * This length does NOT include the terminating NUL character. 97 98 ***************************************************************************************** 98 * @ string : string in user space.99 * @ string : string pointer in user space. 99 100 * @ return length of the string. 100 101 ****************************************************************************************/ -
trunk/hal/generic/hal_vmm.h
r635 r679 2 2 * hal_vmm.h - Kernel Virtual Memory Manager initialisation 3 3 * 4 * Authors Alain Greiner (2016,2017,2018,2019 )4 * Authors Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites -
trunk/hal/tsar_mips32/core/hal_context.c
r654 r679 120 120 error_t hal_cpu_context_alloc( thread_t * thread ) 121 121 { 122 assert( (sizeof(hal_cpu_context_t) <= CONFIG_CPU_CTX_SIZE) , 123 122 123 assert( __FUNCTION__, (sizeof(hal_cpu_context_t) <= CONFIG_CPU_CTX_SIZE), "illegal CPU context size" ); 124 124 125 125 // allocate memory for cpu_context … … 139 139 } // end hal_cpu_context_alloc() 140 140 141 ///////////////////////////////////////////////// 142 // The following context slots are initialised 143 // GPR : a0_04 / sp_29 / ra_31141 ////////////////////////////////////////////////////////////////////////////// 142 // The following context slots are initialised for the MIPS32 architecture 143 // GPR : a0_04 / a1_05 / sp_29 / ra_31 144 144 // CP0 : c0_sr / c0_th / c0_epc 145 145 // CP2 : c2_ptpr / c2_mode 146 ///////////////////////////////////////////////// 147 void hal_cpu_context_init( thread_t * thread ) 146 ////////////////////////////////////////////////////////////////////////////// 147 void hal_cpu_context_init( thread_t * thread, 148 bool_t is_main, 149 uint32_t argc, 150 intptr_t argv ) 148 151 { 149 152 hal_cpu_context_t * context = (hal_cpu_context_t *)thread->cpu_context; 150 153 151 assert((context != NULL ), "CPU context not allocated" );154 assert( __FUNCTION__, (context != NULL ), "CPU context not allocated" ); 152 155 153 156 // compute the PPN for the GPT PT1 … … 155 158 156 159 // initialisation depends on thread type 157 if( thread->type == THREAD_USER ) 160 if( (thread->type == THREAD_USER) && (is_main != 0) ) 161 { 162 context->a0_04 = (uint32_t)argc; 163 context->a1_05 = (uint32_t)argv; 164 context->sp_29 = (uint32_t)thread->user_stack_vseg->max - 8; 165 context->ra_31 = (uint32_t)&hal_kentry_eret; 166 context->c0_epc = (uint32_t)thread->entry_func; 167 context->c0_sr = SR_USR_MODE; 168 context->c0_th = (uint32_t)thread; 169 context->c2_ptpr = (uint32_t)(gpt_pt1_ppn >> 1); 170 context->c2_mode = 0xF; 171 } 172 else if( (thread->type == THREAD_USER) && (is_main == 0) ) 158 173 { 159 174 context->a0_04 = (uint32_t)thread->entry_args; … … 353 368 } // end hal_cpu_context_fork() 354 369 355 //////////////////////////////////////////////356 void hal_cpu_context_exec( thread_t * thread )357 {358 // re_initialize CPU context359 hal_cpu_context_init( thread );360 361 // restore CPU registers ... and jump to user code362 hal_do_cpu_restore( (hal_cpu_context_t *)thread->cpu_context );363 364 } // end hal_cpu_context_exec()365 366 370 ///////////////////////////////////////////////// 367 371 void hal_cpu_context_display( xptr_t thread_xp ) … … 379 383 uint32_t sp_29 = hal_remote_l32( XPTR( cxy , &ctx->sp_29 ) ); 380 384 uint32_t ra_31 = hal_remote_l32( XPTR( cxy , &ctx->ra_31 ) ); 385 uint32_t a0_04 = hal_remote_l32( XPTR( cxy , &ctx->a0_04 ) ); 386 uint32_t a1_05 = hal_remote_l32( XPTR( cxy , &ctx->a1_05 ) ); 381 387 uint32_t c0_sr = hal_remote_l32( XPTR( cxy , &ctx->c0_sr ) ); 382 388 uint32_t c0_epc = hal_remote_l32( XPTR( cxy , &ctx->c0_epc ) ); … … 386 392 387 393 printk("\n***** CPU context for thread %x in process %x / cycle %d\n" 388 " sp_29 = %X ra_31= %X\n"389 " c0_sr = %X c0_epc = %Xc0_th = %X\n"390 " c2_ptpr = %X 394 " sp_29 = %X ra_31 = %X a0_04 = %X a1_05 = %X\n" 395 " c0_sr = %X c0_epc = %X c0_th = %X\n" 396 " c2_ptpr = %X c2_mode = %X\n", 391 397 ptr, ptr->process->pid, (uint32_t)hal_get_cycles(), 392 sp_29 , ra_31 ,398 sp_29 , ra_31 , a0_04 , a1_05, 393 399 c0_sr , c0_epc , c0_th, 394 400 c2_ptpr , c2_mode ); … … 417 423 418 424 425 426 427 428 419 429 ////////////////////////////////////////////////// 420 430 error_t hal_fpu_context_alloc( thread_t * thread ) 421 431 { 422 assert( (sizeof(hal_fpu_context_t) <= CONFIG_FPU_CTX_SIZE) ,432 assert( __FUNCTION__, (sizeof(hal_fpu_context_t) <= CONFIG_FPU_CTX_SIZE) , 423 433 "illegal CPU context size" ); 424 434 … … 444 454 hal_fpu_context_t * context = thread->fpu_context; 445 455 446 assert( (context != NULL) , "fpu context not allocated" );456 assert( __FUNCTION__, (context != NULL) , "fpu context not allocated" ); 447 457 448 458 memset( context , 0 , sizeof(hal_fpu_context_t) ); … … 453 463 thread_t * src ) 454 464 { 455 assert( (src != NULL) , "src thread pointer is NULL\n");456 assert( (dst != NULL) , "dst thread pointer is NULL\n");465 assert( __FUNCTION__, (src != NULL) , "src thread pointer is NULL\n"); 466 assert( __FUNCTION__, (dst != NULL) , "dst thread pointer is NULL\n"); 457 467 458 468 // get fpu context pointers -
trunk/hal/tsar_mips32/core/hal_drivers.c
r647 r679 62 62 else 63 63 { 64 assert( false, "undefined implementation" );64 assert( __FUNCTION__, false, "undefined implementation" ); 65 65 } 66 66 } … … 75 75 uint32_t impl = pic->impl; 76 76 77 assert( (impl == IMPL_PIC_SCL), "undefined implementation" );77 assert( __FUNCTION__, (impl == IMPL_PIC_SCL), "undefined implementation" ); 78 78 79 79 soclib_pic_init( pic ); … … 99 99 uint32_t impl = iob->impl; 100 100 101 assert( (impl == IMPL_IOB_TSR), "undefined implementation" );101 assert( __FUNCTION__, (impl == IMPL_IOB_TSR), "undefined implementation" ); 102 102 103 103 soclib_iob_init( iob ); … … 135 135 else 136 136 { 137 assert( false , "undefined IOC device implementation" );137 assert( __FUNCTION__, false , "undefined IOC device implementation" ); 138 138 } 139 139 } … … 148 148 uint32_t impl = mmc->impl; 149 149 150 assert( (impl == IMPL_MMC_TSR), "undefined implementation" );150 assert( __FUNCTION__, (impl == IMPL_MMC_TSR), "undefined implementation" ); 151 151 152 152 soclib_mmc_init( mmc ); … … 162 162 uint32_t impl = nic->impl; 163 163 164 assert( (impl == IMPL_NIC_CBF), "undefined implementation" );164 assert( __FUNCTION__, (impl == IMPL_NIC_CBF), "undefined implementation" ); 165 165 166 166 soclib_nic_init( nic ); … … 176 176 uint32_t impl = dma->impl; 177 177 178 assert( (impl == IMPL_DMA_SCL), "undefined implementation" );178 assert( __FUNCTION__, (impl == IMPL_DMA_SCL), "undefined implementation" ); 179 179 180 180 soclib_dma_init( dma ); … … 190 190 uint32_t impl = fbf->impl; 191 191 192 assert( (impl == IMPL_FBF_SCL), "undefined implementation" );192 assert( __FUNCTION__, (impl == IMPL_FBF_SCL), "undefined implementation" ); 193 193 194 194 soclib_fbf_init( fbf ); -
trunk/hal/tsar_mips32/core/hal_gpt.c
r658 r679 152 152 153 153 // check page size 154 assert( (CONFIG_PPM_PAGE_SIZE == 4096) , "the TSAR page size must be 4 Kbytes\n" );154 assert( __FUNCTION__, (CONFIG_PPM_PAGE_SIZE == 4096) , "the TSAR page size must be 4 Kbytes\n" ); 155 155 156 156 // allocates 2 physical pages for PT1 … … 423 423 424 424 // check PTE1 : only small and mapped pages can be locked 425 assert( (pte1 & (TSAR_PTE_SMALL | TSAR_PTE_MAPPED)) , "cannot lock a big or unmapped page\n");425 assert( __FUNCTION__, (pte1 & (TSAR_PTE_SMALL | TSAR_PTE_MAPPED)) , "cannot lock a big or unmapped page\n"); 426 426 427 427 #if DEBUG_HAL_GPT_LOCK_PTE … … 537 537 pte1 = hal_remote_l32( pte1_xp ); 538 538 539 assert( ((pte1 & TSAR_PTE_MAPPED) != 0),539 assert( __FUNCTION__, ((pte1 & TSAR_PTE_MAPPED) != 0), 540 540 "PTE1 for vpn %x in cluster %x is unmapped / pte1 = %x\n", vpn, gpt_cxy, pte1 ); 541 541 542 assert( ((pte1 & TSAR_PTE_SMALL ) != 0),542 assert( __FUNCTION__, ((pte1 & TSAR_PTE_SMALL ) != 0), 543 543 "PTE1 for vpn %x in cluster %x is not small / pte1 = %x\n", vpn, gpt_cxy, pte1 ); 544 544 … … 553 553 pte2_attr = hal_remote_l32( pte2_xp ); 554 554 555 assert( ((pte2_attr & TSAR_PTE_LOCKED) != 0),555 assert( __FUNCTION__, ((pte2_attr & TSAR_PTE_LOCKED) != 0), 556 556 "PTE2 for vpn %x in cluster %x is unlocked / pte2_attr = %x\n", vpn, gpt_cxy, pte2_attr ); 557 557 … … 630 630 631 631 // check PT1 entry not mapped 632 assert( (pte1 == 0) , "try to set a big page in an already mapped PTE1\n" );632 assert( __FUNCTION__, (pte1 == 0) , "try to set a big page in an already mapped PTE1\n" ); 633 633 634 634 // check VPN aligned 635 assert( (ix2 == 0) , "illegal vpn for a big page\n" );635 assert( __FUNCTION__, (ix2 == 0) , "illegal vpn for a big page\n" ); 636 636 637 637 // check PPN aligned 638 assert( ((ppn & 0x1FF) == 0) , "illegal ppn for a big page\n" );638 assert( __FUNCTION__, ((ppn & 0x1FF) == 0) , "illegal ppn for a big page\n" ); 639 639 640 640 // set the PTE1 value in PT1 … … 654 654 655 655 // PTE1 must be mapped because PTE2 must be locked 656 assert( (pte1 & TSAR_PTE_MAPPED),656 assert( __FUNCTION__, (pte1 & TSAR_PTE_MAPPED), 657 657 "PTE1 for vpn %x in cluster %x must be mapped / pte1 = %x\n", vpn, gpt_cxy, pte1 ); 658 658 … … 669 669 670 670 // PTE2 must be locked 671 assert( (pte2_attr & TSAR_PTE_LOCKED),671 assert( __FUNCTION__, (pte2_attr & TSAR_PTE_LOCKED), 672 672 "PTE2 for vpn %x in cluster %x must be locked / pte2_attr = %x\n", vpn, gpt_cxy, pte2_attr ); 673 673 … … 894 894 895 895 // check src_pt1 and dst_pt1 existence 896 assert( (src_pt1 != NULL) , "src_pt1 does not exist\n");897 assert( (dst_pt1 != NULL) , "dst_pt1 does not exist\n");896 assert( __FUNCTION__, (src_pt1 != NULL) , "src_pt1 does not exist\n"); 897 assert( __FUNCTION__, (dst_pt1 != NULL) , "dst_pt1 does not exist\n"); 898 898 899 899 // compute SRC indexes … … 1143 1143 1144 1144 // check MAPPED, SMALL, and not LOCKED in attr argument 1145 assert( ((attr & GPT_MAPPED) != 0), "attribute MAPPED must be set in new attributes\n" );1146 assert( ((attr & GPT_SMALL ) != 0), "attribute SMALL must be set in new attributes\n" );1147 assert( ((attr & GPT_LOCKED) == 0), "attribute LOCKED must not be set in new attributes\n" );1145 assert( __FUNCTION__, ((attr & GPT_MAPPED) != 0), "attribute MAPPED must be set in new attributes\n" ); 1146 assert( __FUNCTION__, ((attr & GPT_SMALL ) != 0), "attribute SMALL must be set in new attributes\n" ); 1147 assert( __FUNCTION__, ((attr & GPT_LOCKED) == 0), "attribute LOCKED must not be set in new attributes\n" ); 1148 1148 1149 1149 // get cluster and local pointer on remote GPT … … 1162 1162 1163 1163 // check MAPPED and SMALL in target PTE1 1164 assert( ((pte1 & TSAR_PTE_MAPPED) != 0), "attribute MAPPED must be set in target PTE1\n" );1165 assert( ((pte1 & TSAR_PTE_SMALL ) != 0), "attribute SMALL must be set in target PTE1\n" );1164 assert( __FUNCTION__, ((pte1 & TSAR_PTE_MAPPED) != 0), "attribute MAPPED must be set in target PTE1\n" ); 1165 assert( __FUNCTION__, ((pte1 & TSAR_PTE_SMALL ) != 0), "attribute SMALL must be set in target PTE1\n" ); 1166 1166 1167 1167 // get PT2 base … … 1175 1175 1176 1176 // check MAPPED in target PTE2 1177 assert( ((hal_remote_l32(pte2_attr_xp) & TSAR_PTE_MAPPED) != 0),1177 assert( __FUNCTION__, ((hal_remote_l32(pte2_attr_xp) & TSAR_PTE_MAPPED) != 0), 1178 1178 "attribute MAPPED must be set in target PTE2\n" ); 1179 1179 -
trunk/hal/tsar_mips32/core/hal_switch.S
r625 r679 2 2 * hal_witch.S - CPU context switch function for TSAR-MIPS32 3 3 * 4 * Author Alain Greiner (2016,2017,2018,2019 )4 * Author Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites -
trunk/hal/tsar_mips32/core/hal_uspace.c
r658 r679 49 49 uint32_t cxy = (uint32_t)GET_CXY( k_dst_xp ); 50 50 51 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" );51 assert( __FUNCTION__, (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 52 52 53 53 #if DEBUG_HAL_USPACE … … 147 147 uint32_t cxy = (uint32_t)GET_CXY( k_src_xp ); 148 148 149 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" );149 assert( __FUNCTION__, (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 150 150 151 151 #if DEBUG_HAL_USPACE … … 236 236 uint32_t cxy = (uint32_t)GET_CXY( k_dst_xp ); 237 237 238 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" );238 assert( __FUNCTION__, (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 239 239 240 240 hal_disable_irq( &save_sr ); … … 291 291 uint32_t cxy = (uint32_t)GET_CXY( k_src_xp ); 292 292 293 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" );293 assert( __FUNCTION__, (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 294 294 295 295 hal_disable_irq( &save_sr ); … … 343 343 uint32_t str = (uint32_t)u_str; 344 344 345 assert( (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" );345 assert( __FUNCTION__, (CURRENT_THREAD->process->pid > 0), "must be called by an user thread" ); 346 346 347 347 hal_disable_irq( &save_sr ); -
trunk/hal/tsar_mips32/core/hal_vmm.c
r656 r679 2 2 * hal_vmm.c - Virtual Memory Manager Initialisation for TSAR 3 3 * 4 * Authors Alain Greiner (2016,2017,2018,2019 )4 * Authors Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 167 167 168 168 // check vsegs_nr 169 assert( (process_zero.vmm.vsegs_nr == 1 ) ,169 assert( __FUNCTION__, (process_zero.vmm.vsegs_nr == 1 ) , 170 170 "bad vsegs number in kernel VSL = %d\n", process_zero.vmm.vsegs_nr ); 171 171 … … 227 227 uint32_t * pt1 = hal_remote_lpt( XPTR( process_cxy , &vmm->gpt.ptr ) ); 228 228 229 nolock_printk("\n***** VSL and GPT / p rocess %x / cluster %x / PT1%x / cycle %d\n",230 pid , process_cxy , pt1 , (uint32_t)hal_get_cycles() );229 nolock_printk("\n***** VSL and GPT / pid %x / cxy %x / PT1 %x / entry %x / cycle %d\n", 230 pid , process_cxy , pt1 , vmm->entry_point , (uint32_t)hal_get_cycles() ); 231 231 232 232 if( xlist_is_empty( vsl_root_xp ) ) -
trunk/hal/tsar_mips32/drivers/soclib_bdv.c
r657 r679 89 89 if ( (cmd_type == IOC_READ) || (cmd_type == IOC_SYNC_READ) ) op = BDV_OP_READ; 90 90 else if( (cmd_type == IOC_WRITE) || (cmd_type == IOC_SYNC_WRITE) ) op = BDV_OP_WRITE; 91 else assert( false , "illegal command" );91 else assert( __FUNCTION__, false , "illegal command" ); 92 92 93 93 // get cluster and local pointer on IOC chdev … … 317 317 else 318 318 { 319 assert( false , "illegal command %d", cmd_type );319 assert( __FUNCTION__, false , "illegal command %d", cmd_type ); 320 320 } 321 321 -
trunk/hal/tsar_mips32/drivers/soclib_fbf.c
r657 r679 63 63 uint32_t npixels; // number of pixels to move 64 64 xptr_t fbf_xp; // extended pointer on FBF chdev descriptor 65 uint32_t status; // I/0 operation status (from BDV)66 65 void * buffer; // pointer on kernel or user buffer 67 66 -
trunk/hal/tsar_mips32/drivers/soclib_hba.c
r570 r679 188 188 { 189 189 // fatal if synchronous access 190 assert( cmd_type == IOC_SYNC_READ, "no slot available for a IOC_SYNC_READ\n" );190 assert( __FUNCTION__, cmd_type == IOC_SYNC_READ, "no slot available for a IOC_SYNC_READ\n" ); 191 191 sched_yield( "blocked on ISR" ); 192 192 } -
trunk/hal/tsar_mips32/drivers/soclib_memc.c
r494 r679 172 172 uint_t *dst; 173 173 174 assert( rq->file != NULL, "rq->file should'nt be NULL.\n");174 assert( __FUNCTION__,rq->file != NULL, "rq->file should'nt be NULL.\n"); 175 175 176 176 count = rq->count >> 2; /* 32 bits registers */ -
trunk/hal/tsar_mips32/drivers/soclib_mty.c
r587 r679 230 230 else 231 231 { 232 assert( false , __FUNCTION__, "illegal TXT command\n" );232 assert( __FUNCTION__, false , "illegal TXT command\n" ); 233 233 } 234 234 … … 321 321 322 322 // check process exist 323 assert( (owner_xp != XPTR_NULL) , __FUNCTION__, 324 "TXT owner process not found\n" ); 323 assert( __FUNCTION__, (owner_xp != XPTR_NULL) , "TXT owner process not found\n" ); 325 324 326 325 // get relevant infos on TXT owner process … … 376 375 377 376 // check process exist 378 assert( (owner_xp != XPTR_NULL) , __FUNCTION__, 379 "TXT owner process not found\n" ); 377 assert( __FUNCTION__, (owner_xp != XPTR_NULL) , "TXT owner process not found\n" ); 380 378 381 379 // get relevant infos on TXT owner process -
trunk/hal/tsar_mips32/drivers/soclib_nic.c
r658 r679 268 268 269 269 // check calling thread == client thread 270 assert( (thread_xp == XPTR( local_cxy , this )), "calling thread must be the client thread");270 assert( __FUNCTION__, (thread_xp == XPTR( local_cxy , this )), "calling thread must be the client thread"); 271 271 272 272 // get command type … … 286 286 287 287 // check chdev is local 288 assert( (dev_cxy == local_cxy), "illegal cluster for a WRITE command");288 assert( __FUNCTION__, (dev_cxy == local_cxy), "illegal cluster for a WRITE command"); 289 289 290 290 // get command arguments … … 293 293 294 294 // check packet length 295 assert( (length <= 2040), "packet length too large");295 assert( __FUNCTION__, (length <= 2040), "packet length too large"); 296 296 297 297 // get chbuf descriptor pointer … … 377 377 378 378 // check chdev is local 379 assert( (dev_cxy == local_cxy), "illegal cluster for a READ command");379 assert( __FUNCTION__, (dev_cxy == local_cxy), "illegal cluster for a READ command"); 380 380 381 381 // get target buffer … … 604 604 default: 605 605 { 606 assert( false, "Unknown command <%x>\n", type );606 assert( __FUNCTION__, false, "Unknown command <%x>\n", type ); 607 607 } 608 608 } -
trunk/hal/tsar_mips32/drivers/soclib_pic.c
r635 r679 58 58 soclib_pic_cluster_t * ext_ptr = LOCAL_CLUSTER->pic_extend; 59 59 60 assert( (ext_ptr->first_free_wti < ext_ptr->wti_nr) ,60 assert( __FUNCTION__, (ext_ptr->first_free_wti < ext_ptr->wti_nr) , 61 61 "no free WTI found : too much external IRQs\n"); 62 62 … … 147 147 if( index < LOCAL_CLUSTER->cores_nr ) // it is an IPI 148 148 { 149 assert( (index == core->lid) , "illegal IPI index" );149 assert( __FUNCTION__, (index == core->lid) , "illegal IPI index" ); 150 150 151 151 #if DEBUG_HAL_IRQS … … 230 230 index = pti_status - 1; 231 231 232 assert( (index == core->lid) , "unconsistent PTI index\n");232 assert( __FUNCTION__, (index == core->lid) , "unconsistent PTI index\n"); 233 233 234 234 #if DEBUG_HAL_IRQS … … 319 319 } 320 320 321 assert( (cluster_ext_ptr != NULL) , "cannot allocate memory for cluster extension");321 assert( __FUNCTION__, (cluster_ext_ptr != NULL) , "cannot allocate memory for cluster extension"); 322 322 323 323 // get XCU characteristics from the XCU config register … … 381 381 382 382 if( (func == DEV_FUNC_IOC && impl == IMPL_IOC_BDV) || (func == DEV_FUNC_NIC) || 383 (func == DEV_FUNC_TXT && impl == IMPL_TXT_TTY) || (func == DEV_FUNC_IOB) ) 383 (func == DEV_FUNC_TXT && impl == IMPL_TXT_TTY) || (func == DEV_FUNC_IOB) ) // external IRQ => WTI 384 384 { 385 385 // get external IRQ index 386 uint32_t hwi_id ;386 uint32_t hwi_id = 0; 387 387 if ( func == DEV_FUNC_IOC ) hwi_id = iopic_input.ioc[channel]; 388 388 else if( func == DEV_FUNC_TXT && is_rx ) hwi_id = iopic_input.txt_rx[channel]; … … 391 391 else if( (func == DEV_FUNC_NIC) && !is_rx ) hwi_id = iopic_input.nic_tx[channel]; 392 392 else if( func == DEV_FUNC_IOB ) hwi_id = iopic_input.iob; 393 else assert( false , "illegal device functionnal type\n");393 else assert( __FUNCTION__, false , "illegal device functionnal type\n"); 394 394 395 395 // get a WTI mailbox from local XCU descriptor … … 453 453 else 454 454 { 455 assert( false , "illegal device functionnal type\n" );455 assert( __FUNCTION__, false , "illegal device functionnal type\n" ); 456 456 } 457 457 } // end soclib_pic_bind_irq(); … … 488 488 else 489 489 { 490 assert( false , "illegal IRQ type\n" );490 assert( __FUNCTION__, false , "illegal IRQ type\n" ); 491 491 } 492 492 } // end soclib_pic_enable_irq() … … 523 523 else 524 524 { 525 assert( false , "illegal IRQ type\n" );525 assert( __FUNCTION__, false , "illegal IRQ type\n" ); 526 526 } 527 527 } // end soclib_pic_enable_irq() -
trunk/hal/tsar_mips32/drivers/soclib_sdc.c
r619 r679 36 36 static void _sdc_enable(sdcard_dev_t *sdcard) 37 37 { 38 spi_ss_assert( sdcard->spi, sdcard->slave_id);38 spi_ss_assert( __FUNCTION__,sdcard->spi, sdcard->slave_id); 39 39 } 40 40 … … 44 44 static void _sdc_disable(sdcard_dev_t *sdcard) 45 45 { 46 spi_ss_deassert( sdcard->spi, sdcard->slave_id);46 spi_ss_deassert( __FUNCTION__,sdcard->spi, sdcard->slave_id); 47 47 } 48 48 … … 375 375 if (++iter >= SDCARD_RESET_ITER_MAX) 376 376 { 377 assert( false, __FUNCTION__, "\n[SDC ERROR] During SD card reset / card response = %x \n", sdcard_rsp);377 assert( __FUNCTION__, false, __FUNCTION__, "\n[SDC ERROR] During SD card reset / card response = %x \n", sdcard_rsp); 378 378 } 379 379 } … … 383 383 if (sdcard_rsp) 384 384 { 385 assert( false, __FUNCTION__, "[SDC ERROR] During SD card block size initialization\n");385 assert( __FUNCTION__, false, __FUNCTION__, "[SDC ERROR] During SD card block size initialization\n"); 386 386 } 387 387 … … 465 465 else // write access 466 466 { 467 assert( false, __FUNCTION__, "[SDC ERROR] function _sdc_write() not iplemented yet\n");467 assert( __FUNCTION__, false, __FUNCTION__, "[SDC ERROR] function _sdc_write() not iplemented yet\n"); 468 468 } 469 469 } // _end sdc_access() … … 474 474 void __attribute__ ((noinline)) soclib_sdc_isr( chdev_t * chdev ) 475 475 { 476 assert( false, __FUNCTION__, "\n[GIET ERROR] _sdc_isr() not implemented\n");476 assert( __FUNCTION__, false, __FUNCTION__, "\n[GIET ERROR] _sdc_isr() not implemented\n"); 477 477 } 478 478 -
trunk/hal/tsar_mips32/drivers/soclib_spi.c
r619 r679 197 197 198 198 /////////////////////////////////////////////////////////////////////////////// 199 // spi_ss_assert( )199 // spi_ss_assert( __FUNCTION__,) 200 200 // This function enables a SPI slave 201 201 // - spi : initialized pointer to the SPI controller 202 202 // - index : slave index 203 203 /////////////////////////////////////////////////////////////////////////////// 204 void spi_ss_assert( struct spi_dev * spi, int index)204 void spi_ss_assert( __FUNCTION__,struct spi_dev * spi, int index) 205 205 { 206 206 unsigned int spi_ss = ioread32(&spi->ss); … … 210 210 211 211 /////////////////////////////////////////////////////////////////////////////// 212 // spi_ss_deassert( )212 // spi_ss_deassert( __FUNCTION__,) 213 213 // This function disables a SPI slave 214 214 // - spi : initialized pointer to the SPI controller 215 215 // - index : slave index 216 216 /////////////////////////////////////////////////////////////////////////////// 217 void spi_ss_deassert( struct spi_dev * spi, int index)217 void spi_ss_deassert( __FUNCTION__,struct spi_dev * spi, int index) 218 218 { 219 219 unsigned int spi_ss = ioread32(&spi->ss); -
trunk/hal/tsar_mips32/drivers/soclib_tty.c
r658 r679 243 243 else 244 244 { 245 assert( false , "illegal TXT command\n" );245 assert( __FUNCTION__, false , "illegal TXT command\n" ); 246 246 } 247 247 … … 338 338 339 339 // check process exist 340 assert( (owner_xp != XPTR_NULL) ,340 assert( __FUNCTION__, (owner_xp != XPTR_NULL) , 341 341 "TXT owner process not found\n" ); 342 342 … … 347 347 348 348 // TXT owner cannot be the INIT process 349 assert( (owner_pid != 1) , "INIT process cannot be the TXT owner" );349 assert( __FUNCTION__, (owner_pid != 1) , "INIT process cannot be the TXT owner" ); 350 350 351 351 // get parent process descriptor pointers … … 390 390 391 391 // check process exist 392 assert( (owner_xp != XPTR_NULL) , "TXT owner process not found\n" );392 assert( __FUNCTION__, (owner_xp != XPTR_NULL) , "TXT owner process not found\n" ); 393 393 394 394 // get relevant infos on TXT owner process … … 398 398 399 399 // TXT owner cannot be the INIT process 400 assert( (owner_pid != 1) , "INIT process cannot be the TXT owner" );400 assert( __FUNCTION__, (owner_pid != 1) , "INIT process cannot be the TXT owner" ); 401 401 402 402 #if DEBUG_HAL_TXT_RX -
trunk/hal/x86_64/drivers/pic_apic.c
r492 r679 80 80 irq_id = iopic_input.txt[channel]; 81 81 else 82 assert( false, "unsupported device\n");82 assert( __FUNCTION__,false, "unsupported device\n"); 83 83 84 84 /* get the ISR pointer */ … … 109 109 irq_id = iopic_input.txt[channel]; 110 110 else 111 assert( false, "unsupported device\n");111 assert( __FUNCTION__,false, "unsupported device\n"); 112 112 113 113 /* enable the line */ … … 128 128 irq_id = iopic_input.txt[channel]; 129 129 else 130 assert( false, "unsupported device\n");130 assert( __FUNCTION__,false, "unsupported device\n"); 131 131 132 132 /* disable the line */
Note: See TracChangeset
for help on using the changeset viewer.