Changeset 492 for trunk/kernel/kern
- Timestamp:
- Aug 22, 2018, 11:55:48 PM (6 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/chdev.c
r485 r492 264 264 265 265 // deschedule 266 assert( thread_can_yield( this ) , __FUNCTION__ ,"illegal sched_yield\n" );266 assert( thread_can_yield( this ) , "illegal sched_yield\n" ); 267 267 sched_yield("blocked on I/O"); 268 268 … … 327 327 328 328 // deschedule 329 assert( thread_can_yield( server ) , __FUNCTION__ ,"illegal sched_yield\n" );329 assert( thread_can_yield( server ) , "illegal sched_yield\n" ); 330 330 sched_yield("I/O queue empty"); 331 331 } … … 408 408 chdev_t * chdev_ptr; 409 409 410 assert( (file_xp != XPTR_NULL) , __FUNCTION__,410 assert( (file_xp != XPTR_NULL) , 411 411 "file_xp == XPTR_NULL\n" ); 412 412 … … 420 420 inode_ptr = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) ); 421 421 422 assert( (inode_type == INODE_TYPE_DEV) , __FUNCTION__ ,422 assert( (inode_type == INODE_TYPE_DEV) , 423 423 "inode type %d is not INODE_TYPE_DEV\n", inode_type ); 424 424 -
trunk/kernel/kern/cluster.c
r485 r492 450 450 451 451 // check lpid 452 assert( (lpid < CONFIG_MAX_PROCESS_PER_CLUSTER), __FUNCTION__ ,452 assert( (lpid < CONFIG_MAX_PROCESS_PER_CLUSTER), 453 453 "illegal LPID = %d" , lpid ); 454 454 455 455 // check owner cluster 456 assert( (owner_cxy == local_cxy) , __FUNCTION__ ,456 assert( (owner_cxy == local_cxy) , 457 457 "local_cluster %x != owner_cluster %x" , local_cxy , owner_cxy ); 458 458 … … 650 650 651 651 assert( (cluster_is_undefined( cxy ) == false), 652 __FUNCTION__,"illegal cluster index" );652 "illegal cluster index" ); 653 653 654 654 // get extended pointer on root and lock for local process list in cluster -
trunk/kernel/kern/do_syscall.c
r488 r492 36 36 static int sys_undefined() 37 37 { 38 assert( false , __FUNCTION__ ,"undefined system call" );38 assert( false , "undefined system call" ); 39 39 return 0; 40 40 } … … 176 176 int error = 0; 177 177 178 assert( (this == CURRENT_THREAD), __FUNCTION__,178 assert( (this == CURRENT_THREAD), 179 179 "wrong <this> argument\n" ); 180 180 … … 200 200 201 201 // check kernel stack overflow 202 assert( (CURRENT_THREAD->signature == THREAD_SIGNATURE), __FUNCTION__,202 assert( (CURRENT_THREAD->signature == THREAD_SIGNATURE), 203 203 "kernel stack overflow after for thread %x in cluster %x\n", CURRENT_THREAD, local_cxy ); 204 204 -
trunk/kernel/kern/dqdt.c
r485 r492 102 102 uint32_t y_width ) 103 103 { 104 assert( ((x_size <= 32) && (y_size <= 32)) , __FUNCTION__ ,"illegal mesh size\n");104 assert( ((x_size <= 32) && (y_size <= 32)) , "illegal mesh size\n"); 105 105 106 106 dqdt_node_t * node; -
trunk/kernel/kern/kernel_init.c
r490 r492 231 231 if (func == DEV_FUNC_TXT ) 232 232 { 233 assert( (channels > 0) , __FUNCTION__ ,"number of TXT channels cannot be 0\n");233 assert( (channels > 0) , "number of TXT channels cannot be 0\n"); 234 234 235 235 // initializes TXT_TX[0] chdev … … 298 298 if( func == DEV_FUNC_MMC ) 299 299 { 300 assert( (channels == 1) , __FUNCTION__ , 301 "MMC device must be single channel\n" ); 300 assert( (channels == 1) , "MMC device must be single channel\n" ); 302 301 303 302 // create chdev in local cluster … … 308 307 base ); 309 308 310 assert( (chdev_ptr != NULL) , __FUNCTION__ ,309 assert( (chdev_ptr != NULL) , 311 310 "cannot allocate memory for MMC chdev\n" ); 312 311 … … 344 343 base ); 345 344 346 assert( (chdev_ptr != NULL) , __FUNCTION__ , 347 "cannot allocate memory for DMA chdev" ); 345 assert( (chdev_ptr != NULL) , "cannot allocate memory for DMA chdev" ); 348 346 349 347 // make DMA specific initialisation … … 420 418 421 419 // check PIC device initialized 422 assert( (chdev_dir.pic != XPTR_NULL ) , __FUNCTION__ ,420 assert( (chdev_dir.pic != XPTR_NULL ) , 423 421 "PIC device must be initialized before other devices\n" ); 424 422 … … 428 426 (func == DEV_FUNC_TXT) || 429 427 (func == DEV_FUNC_NIC) || 430 (func == DEV_FUNC_FBF) ) , __FUNCTION__ ,428 (func == DEV_FUNC_FBF) ) , 431 429 "undefined external peripheral type\n" ); 432 430 … … 456 454 base ); 457 455 458 assert( (chdev != NULL), __FUNCTION__ ,456 assert( (chdev != NULL), 459 457 "cannot allocate external device" ); 460 458 … … 544 542 } 545 543 546 assert( found , __FUNCTION__ ,"PIC device not found\n" );544 assert( found , "PIC device not found\n" ); 547 545 548 546 // allocate and initialize the PIC chdev in cluster 0 … … 553 551 base ); 554 552 555 assert( (chdev != NULL), __FUNCTION__ ,"no memory for PIC chdev\n" );553 assert( (chdev != NULL), "no memory for PIC chdev\n" ); 556 554 557 555 // make PIC device type specific initialisation … … 607 605 else if((func == DEV_FUNC_TXT) && (is_rx == 0)) ptr = &iopic_input.txt_tx[channel]; 608 606 else if((func == DEV_FUNC_TXT) && (is_rx != 0)) ptr = &iopic_input.txt_rx[channel]; 609 else if((func == DEV_FUNC_NIC) && (is_rx == 0)) ptr = &iopic_input.nic_tx[channel]; 610 else if((func == DEV_FUNC_NIC) && (is_rx != 0)) ptr = &iopic_input.nic_rx[channel]; 611 else if( func == DEV_FUNC_IOB ) ptr = &iopic_input.iob; 612 else assert( false , __FUNCTION__ ,"illegal source device for IOPIC input" );607 else if((func == DEV_FUNC_NIC) && (is_rx == 0)) ptr = &iopic_input.nic_tx[channel]; 608 else if((func == DEV_FUNC_NIC) && (is_rx != 0)) ptr = &iopic_input.nic_rx[channel]; 609 else if( func == DEV_FUNC_IOB ) ptr = &iopic_input.iob; 610 else assert( false , "illegal source device for IOPIC input" ); 613 611 614 612 // set one entry in all "iopic_input" structures … … 697 695 if ( func == DEV_FUNC_MMC ) lapic_input.mmc = id; 698 696 else if( func == DEV_FUNC_DMA ) lapic_input.dma[channel] = id; 699 else assert( false , __FUNCTION__ ,"illegal source device for LAPIC input" );697 else assert( false , "illegal source device for LAPIC input" ); 700 698 } 701 699 } … … 818 816 if( error ) 819 817 { 820 assert( false , __FUNCTION__ ,818 assert( false , 821 819 "illegal core identifiers gid = %x / cxy = %x / lid = %d", 822 820 core_lid , core_cxy , core_lid ); … … 830 828 if( error ) 831 829 { 832 assert( false , __FUNCTION__ ,830 assert( false , 833 831 "cannot initialise cluster %x", local_cxy ); 834 832 } … … 950 948 fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc(); 951 949 952 assert( (fatfs_ctx != NULL) , __FUNCTION__ ,950 assert( (fatfs_ctx != NULL) , 953 951 "cannot create FATFS context in cluster 0\n" ); 954 952 … … 973 971 &vfs_root_inode_xp ); // return 974 972 975 assert( (error == 0) , __FUNCTION__ ,973 assert( (error == 0) , 976 974 "cannot create VFS root inode\n" ); 977 975 … … 987 985 vfs_ctx_t * vfs_ctx = &fs_context[FS_TYPE_FATFS]; 988 986 assert( (((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster == 8), 989 __FUNCTION__ ,"illegal value for FATFS context in cluster %x\n", local_cxy );987 "illegal value for FATFS context in cluster %x\n", local_cxy ); 990 988 } 991 989 else 992 990 { 993 assert( false , __FUNCTION__ ,991 assert( false , 994 992 "root FS must be FATFS" ); 995 993 } … … 1028 1026 fatfs_ctx_t * local_fatfs_ctx = fatfs_ctx_alloc(); 1029 1027 1030 assert( (local_fatfs_ctx != NULL) , __FUNCTION__ ,1028 assert( (local_fatfs_ctx != NULL) , 1031 1029 "cannot create FATFS context in cluster %x\n", local_cxy ); 1032 1030 … … 1050 1048 // 7. check initialisation 1051 1049 assert( (((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster == 8), 1052 __FUNCTION__ ,"illegal value for FATFS context in cluster %x\n", local_cxy );1050 "illegal value for FATFS context in cluster %x\n", local_cxy ); 1053 1051 } 1054 1052 … … 1089 1087 devfs_ctx_t * devfs_ctx = devfs_ctx_alloc(); 1090 1088 1091 assert( (devfs_ctx != NULL) , __FUNCTION__ ,1089 assert( (devfs_ctx != NULL) , 1092 1090 "cannot create DEVFS context in cluster IO\n"); 1093 1091 -
trunk/kernel/kern/process.c
r485 r492 132 132 // initialize vmm as empty 133 133 error = vmm_init( process ); 134 assert( (error == 0) , __FUNCTION__ ,"cannot initialize VMM\n" );134 assert( (error == 0) , "cannot initialize VMM\n" ); 135 135 136 136 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) … … 175 175 &stdin_id ); 176 176 177 assert( (error == 0) , __FUNCTION__ ,"cannot open stdin pseudo file" );178 assert( (stdin_id == 0) , __FUNCTION__ ,"stdin index must be 0" );177 assert( (error == 0) , "cannot open stdin pseudo file" ); 178 assert( (stdin_id == 0) , "stdin index must be 0" ); 179 179 180 180 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) … … 193 193 &stdout_id ); 194 194 195 assert( (error == 0) , __FUNCTION__ ,"cannot open stdout pseudo file" );196 assert( (stdout_id == 1) , __FUNCTION__ ,"stdout index must be 1" );195 assert( (error == 0) , "cannot open stdout pseudo file" ); 196 assert( (stdout_id == 1) , "stdout index must be 1" ); 197 197 198 198 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) … … 211 211 &stderr_id ); 212 212 213 assert( (error == 0) , __FUNCTION__ ,"cannot open stderr pseudo file" );214 assert( (stderr_id == 2) , __FUNCTION__ ,"stderr index must be 2" );213 assert( (error == 0) , "cannot open stderr pseudo file" ); 214 assert( (stderr_id == 2) , "stderr index must be 2" ); 215 215 216 216 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) … … 330 330 // reset local process vmm 331 331 error = vmm_init( local_process ); 332 assert( (error == 0) , __FUNCTION__ ,"cannot initialize VMM\n");332 assert( (error == 0) , "cannot initialize VMM\n"); 333 333 334 334 // reset process file descriptors array … … 393 393 pid_t pid = process->pid; 394 394 395 assert( (process->th_nr == 0) , __FUNCTION__ ,395 assert( (process->th_nr == 0) , 396 396 "process %x in cluster %x has still active threads", pid , local_cxy ); 397 397 … … 511 511 assert( ((type == DELETE_ALL_THREADS ) || 512 512 (type == BLOCK_ALL_THREADS ) || 513 (type == UNBLOCK_ALL_THREADS )), __FUNCTION__ ,"illegal action type" );513 (type == UNBLOCK_ALL_THREADS )), "illegal action type" ); 514 514 515 515 … … 843 843 xptr_t ref_xp = cluster_get_reference_process_from_pid( pid ); 844 844 845 assert( (ref_xp != XPTR_NULL) , __FUNCTION__ ,"illegal pid\n" );845 assert( (ref_xp != XPTR_NULL) , "illegal pid\n" ); 846 846 847 847 // allocate memory for local process descriptor … … 1046 1046 1047 1047 1048 assert( (process != NULL) , __FUNCTION__ ,"process argument is NULL" );1049 1050 assert( (thread != NULL) , __FUNCTION__ ,"thread argument is NULL" );1048 assert( (process != NULL) , "process argument is NULL" ); 1049 1050 assert( (thread != NULL) , "thread argument is NULL" ); 1051 1051 1052 1052 // take lock protecting th_tbl, depending on thread type: … … 1089 1089 uint32_t count; // number of threads in local process descriptor 1090 1090 1091 assert( (thread != NULL) , __FUNCTION__ ,"thread argument is NULL" );1091 assert( (thread != NULL) , "thread argument is NULL" ); 1092 1092 1093 1093 process_t * process = thread->process; … … 1101 1101 count = process->th_nr; 1102 1102 1103 assert( (count > 0) , __FUNCTION__ ,"process th_nr cannot be 0\n" );1103 assert( (count > 0) , "process th_nr cannot be 0\n" ); 1104 1104 1105 1105 // remove thread from th_tbl[] … … 1140 1140 ref_xp = hal_remote_lwd( XPTR( parent_process_cxy , &parent_process_ptr->ref_xp ) ); 1141 1141 1142 assert( (parent_process_xp == ref_xp ) , __FUNCTION__ ,1142 assert( (parent_process_xp == ref_xp ) , 1143 1143 "parent process must be the reference process\n" ); 1144 1144 … … 1243 1243 1244 1244 // check main thread LTID 1245 assert( (LTID_FROM_TRDID(thread->trdid) == 0) , __FUNCTION__ ,1245 assert( (LTID_FROM_TRDID(thread->trdid) == 0) , 1246 1246 "main thread must have LTID == 0\n" ); 1247 1247 … … 1421 1421 } 1422 1422 1423 assert( false, __FUNCTION__,"we should not execute this code");1423 assert( false, "we should not execute this code"); 1424 1424 1425 1425 return 0; … … 1491 1491 process = process_alloc(); 1492 1492 1493 assert( (process != NULL), __FUNCTION__,1493 assert( (process != NULL), 1494 1494 "no memory for process descriptor in cluster %x\n", local_cxy ); 1495 1495 … … 1497 1497 error = cluster_pid_alloc( process , &pid ); 1498 1498 1499 assert( (error == 0), __FUNCTION__,1499 assert( (error == 0), 1500 1500 "cannot allocate PID in cluster %x\n", local_cxy ); 1501 1501 1502 assert( (pid == 1) , __FUNCTION__,1502 assert( (pid == 1) , 1503 1503 "process INIT must be first process in cluster 0\n" ); 1504 1504 … … 1518 1518 &file_id ); 1519 1519 1520 assert( (error == 0), __FUNCTION__,1520 assert( (error == 0), 1521 1521 "failed to open file <%s>\n", CONFIG_PROCESS_INIT_PATH ); 1522 1522 … … 1525 1525 error = elf_load_process( file_xp , process ); 1526 1526 1527 assert( (error == 0), __FUNCTION__,1527 assert( (error == 0), 1528 1528 "cannot access .elf file <%s>\n", CONFIG_PROCESS_INIT_PATH ); 1529 1529 … … 1553 1553 &thread ); 1554 1554 1555 assert( (error == 0), __FUNCTION__,1555 assert( (error == 0), 1556 1556 "cannot create main thread for <%s>\n", CONFIG_PROCESS_INIT_PATH ); 1557 1557 1558 assert( (thread->trdid == 0), __FUNCTION__,1558 assert( (thread->trdid == 0), 1559 1559 "main thread must have index 0 for <%s>\n", CONFIG_PROCESS_INIT_PATH ); 1560 1560 … … 1631 1631 txt_file_xp = hal_remote_lwd( XPTR( owner_cxy , &owner_ptr->fd_array.array[0] ) ); 1632 1632 1633 assert( (txt_file_xp != XPTR_NULL) , __FUNCTION__ ,1633 assert( (txt_file_xp != XPTR_NULL) , 1634 1634 "process must be attached to one TXT terminal\n" ); 1635 1635 … … 1695 1695 } 1696 1696 1697 assert( false , __FUNCTION__ ,"no free TXT terminal found" );1697 assert( false , "no free TXT terminal found" ); 1698 1698 1699 1699 return -1; … … 1712 1712 1713 1713 // check process is in owner cluster 1714 assert( (CXY_FROM_PID( process->pid ) == local_cxy) , __FUNCTION__ ,1714 assert( (CXY_FROM_PID( process->pid ) == local_cxy) , 1715 1715 "process descriptor not in owner cluster" ); 1716 1716 1717 1717 // check terminal index 1718 1718 assert( (txt_id < LOCAL_CLUSTER->nb_txt_channels) , 1719 __FUNCTION__ ,"illegal TXT terminal index" );1719 "illegal TXT terminal index" ); 1720 1720 1721 1721 // get pointers on TXT_RX[txt_id] chdev … … 1761 1761 // check process descriptor in owner cluster 1762 1762 process_pid = hal_remote_lw( XPTR( process_cxy , &process_ptr->pid ) ); 1763 assert( (CXY_FROM_PID( process_pid ) == process_cxy ) , __FUNCTION__ ,1763 assert( (CXY_FROM_PID( process_pid ) == process_cxy ) , 1764 1764 "process descriptor not in owner cluster" ); 1765 1765 … … 1811 1811 1812 1812 // check owner cluster 1813 assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,1813 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 1814 1814 "process descriptor not in owner cluster\n" ); 1815 1815 … … 1864 1864 1865 1865 // check owner cluster 1866 assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,1866 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 1867 1867 "process descriptor not in owner cluster\n" ); 1868 1868 … … 1922 1922 1923 1923 // PANIC if KSH not found 1924 assert( false , __FUNCTION__ , "KSH process not found for TXT %d" );1924 assert( false , "KSH process not found for TXT %d" ); 1925 1925 1926 1926 return; … … 1995 1995 // check owner cluster 1996 1996 pid_t process_pid = hal_remote_lw( XPTR( process_cxy , &process_ptr->pid ) ); 1997 assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,1997 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 1998 1998 "process descriptor not in owner cluster\n" ); 1999 1999 … … 2041 2041 2042 2042 assert( (txt_id < LOCAL_CLUSTER->nb_txt_channels) , 2043 __FUNCTION__ ,"illegal TXT terminal index" );2043 "illegal TXT terminal index" ); 2044 2044 2045 2045 // get pointers on TXT0 chdev -
trunk/kernel/kern/rpc.c
r485 r492 85 85 void __attribute__((noinline)) rpc_undefined() 86 86 { 87 assert( false , __FUNCTION__ ,"called in cluster %x", local_cxy );87 assert( false , "called in cluster %x", local_cxy ); 88 88 } 89 89 … … 204 204 205 205 // check response available 206 assert( (rpc->responses == 0) , __FUNCTION__,"illegal RPC response\n" );206 assert( (rpc->responses == 0) , "illegal RPC response\n" ); 207 207 } 208 208 else // non blocking RPC … … 280 280 core->lid ); 281 281 282 assert( (error == 0), __FUNCTION__ ,282 assert( (error == 0), 283 283 "no memory to allocate a new RPC thread in cluster %x", local_cxy ); 284 284 … … 459 459 460 460 // RPC thread deschedules 461 assert( thread_can_yield( server_ptr ) , __FUNCTION__,"illegal sched_yield\n" );461 assert( thread_can_yield( server_ptr ) , "illegal sched_yield\n" ); 462 462 sched_yield("RPC fifo empty"); 463 463 } … … 484 484 #endif 485 485 486 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");486 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 487 487 488 488 // initialise RPC descriptor header … … 555 555 #endif 556 556 557 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");557 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 558 558 559 559 // initialise RPC descriptor header … … 631 631 #endif 632 632 633 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");633 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 634 634 635 635 // initialise RPC descriptor header … … 723 723 error_t * error ) // out 724 724 { 725 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");725 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 726 726 727 727 // initialise RPC descriptor header … … 803 803 error_t * error ) // out 804 804 { 805 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");805 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 806 806 807 807 // initialise RPC descriptor header … … 879 879 880 880 // check some RPC arguments 881 assert( (rpc->blocking == false) , __FUNCTION__ ,"must be non-blocking\n");882 assert( (rpc->index == RPC_PROCESS_SIGACTION ) , __FUNCTION__ ,"bad RPC index\n" );881 assert( (rpc->blocking == false) , "must be non-blocking\n"); 882 assert( (rpc->index == RPC_PROCESS_SIGACTION ) , "bad RPC index\n" ); 883 883 884 884 // register RPC request in remote RPC fifo and return … … 987 987 #endif 988 988 989 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");989 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 990 990 991 991 // initialise RPC descriptor header … … 1094 1094 #endif 1095 1095 1096 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1096 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1097 1097 1098 1098 // initialise RPC descriptor header … … 1172 1172 #endif 1173 1173 1174 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1174 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1175 1175 1176 1176 // initialise RPC descriptor header … … 1263 1263 #endif 1264 1264 1265 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1265 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1266 1266 1267 1267 // initialise RPC descriptor header … … 1341 1341 #endif 1342 1342 1343 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1343 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1344 1344 1345 1345 // initialise RPC descriptor header … … 1423 1423 #endif 1424 1424 1425 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1425 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1426 1426 1427 1427 // initialise RPC descriptor header … … 1486 1486 error_t * error ) // out 1487 1487 { 1488 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1488 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1489 1489 1490 1490 // initialise RPC descriptor header … … 1547 1547 error_t * error ) // out 1548 1548 { 1549 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1549 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1550 1550 1551 1551 // initialise RPC descriptor header … … 1599 1599 error_t * error ) // out 1600 1600 { 1601 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1601 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1602 1602 1603 1603 // initialise RPC descriptor header … … 1666 1666 #endif 1667 1667 1668 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1668 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1669 1669 1670 1670 // initialise RPC descriptor header … … 1754 1754 #endif 1755 1755 1756 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1756 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1757 1757 1758 1758 // initialise RPC descriptor header … … 1834 1834 xptr_t * buf_xp ) // out 1835 1835 { 1836 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1836 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1837 1837 1838 1838 // initialise RPC descriptor header … … 1884 1884 uint32_t kmem_type ) // in 1885 1885 { 1886 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1886 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1887 1887 1888 1888 // initialise RPC descriptor header … … 1934 1934 error_t * error ) // out 1935 1935 { 1936 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");1936 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1937 1937 1938 1938 // initialise RPC descriptor header … … 2018 2018 page_t ** page ) // out 2019 2019 { 2020 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");2020 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 2021 2021 2022 2022 // initialise RPC descriptor header … … 2073 2073 struct vseg_s ** vseg ) 2074 2074 { 2075 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");2075 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 2076 2076 2077 2077 // initialise RPC descriptor header … … 2143 2143 process_t * process ) 2144 2144 { 2145 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");2145 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 2146 2146 2147 2147 // initialise RPC descriptor header … … 2185 2185 bool_t detailed ) 2186 2186 { 2187 assert( (cxy != local_cxy) , __FUNCTION__ ,"target cluster is not remote\n");2187 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 2188 2188 2189 2189 // initialise RPC descriptor header -
trunk/kernel/kern/scheduler.c
r470 r492 124 124 while( done == false ) 125 125 { 126 assert( (count < sched->k_threads_nr), __FUNCTION__,"bad kernel threads list" );126 assert( (count < sched->k_threads_nr), "bad kernel threads list" ); 127 127 128 128 // get next entry in kernel list … … 159 159 while( done == false ) 160 160 { 161 assert( (count < sched->u_threads_nr), __FUNCTION__,"bad user threads list" );161 assert( (count < sched->u_threads_nr), "bad user threads list" ); 162 162 163 163 // get next entry in user list … … 228 228 // check thread blocked 229 229 assert( (thread->blocked & THREAD_BLOCKED_GLOBAL) , 230 __FUNCTION__ ,"thread not blocked" );230 "thread not blocked" ); 231 231 232 232 // decrement response counter … … 249 249 uint32_t threads_nr = sched->u_threads_nr; 250 250 251 assert( (threads_nr != 0) , __FUNCTION__ ,"u_threads_nr cannot be 0\n" );251 assert( (threads_nr != 0) , "u_threads_nr cannot be 0\n" ); 252 252 253 253 sched->u_threads_nr = threads_nr - 1; … … 327 327 328 328 // check next thread kernel_stack overflow 329 assert( (next->signature == THREAD_SIGNATURE), __FUNCTION__ ,329 assert( (next->signature == THREAD_SIGNATURE), 330 330 "kernel stack overflow for thread %x on core[%x,%d] \n", next, local_cxy, core->lid ); 331 331 332 332 // check next thread attached to same core as the calling thread 333 assert( (next->core == current->core), __FUNCTION__ ,333 assert( (next->core == current->core), 334 334 "next core %x != current core %x\n", next->core, current->core ); 335 335 336 336 // check next thread not blocked when type != IDLE 337 assert( ((next->blocked == 0) || (next->type == THREAD_IDLE)) , __FUNCTION__ ,337 assert( ((next->blocked == 0) || (next->type == THREAD_IDLE)) , 338 338 "next thread %x (%s) is blocked on core[%x,%d]\n", 339 339 next->trdid , thread_type_str(next->type) , local_cxy , core->lid ); … … 396 396 uint32_t save_sr; 397 397 398 assert( (lid < LOCAL_CLUSTER->cores_nr), __FUNCTION__,"illegal core index %d\n", lid);398 assert( (lid < LOCAL_CLUSTER->cores_nr), "illegal core index %d\n", lid); 399 399 400 400 core_t * core = &LOCAL_CLUSTER->core_tbl[lid]; … … 456 456 // check cxy 457 457 bool_t undefined = cluster_is_undefined( cxy ); 458 assert( (undefined == false), __FUNCTION__,"illegal cluster %x\n", cxy );458 assert( (undefined == false), "illegal cluster %x\n", cxy ); 459 459 460 460 // check lid 461 461 uint32_t cores = hal_remote_lw( XPTR( cxy , &LOCAL_CLUSTER->cores_nr ) ); 462 assert( (lid < cores), __FUNCTION__,"illegal core index %d\n", lid);462 assert( (lid < cores), "illegal core index %d\n", lid); 463 463 464 464 // get local pointer on target scheduler -
trunk/kernel/kern/thread.c
r485 r492 238 238 vseg_t * vseg; // stack vseg 239 239 240 assert( (attr != NULL) , __FUNCTION__,"pthread attributes must be defined" );240 assert( (attr != NULL) , "pthread attributes must be defined" ); 241 241 242 242 #if DEBUG_THREAD_USER_CREATE … … 594 594 #endif 595 595 596 assert( (thread->type == THREAD_USER ) , __FUNCTION__,"bad type" );597 assert( (thread->signature == THREAD_SIGNATURE) , __FUNCTION__,"bad signature" );598 assert( (thread->local_locks == 0) , __FUNCTION__,"bad local locks" );599 assert( (thread->remote_locks == 0) , __FUNCTION__,"bad remote locks" );596 assert( (thread->type == THREAD_USER ) , "bad type" ); 597 assert( (thread->signature == THREAD_SIGNATURE) , "bad signature" ); 598 assert( (thread->local_locks == 0) , "bad local locks" ); 599 assert( (thread->remote_locks == 0) , "bad remote locks" ); 600 600 601 601 // re-initialize various thread descriptor fields … … 662 662 hal_cpu_context_exec( thread ); 663 663 664 assert( false, __FUNCTION__,"we should execute this code");664 assert( false, "we should execute this code"); 665 665 666 666 return 0; … … 679 679 680 680 assert( ( (type == THREAD_IDLE) || (type == THREAD_RPC) || (type == THREAD_DEV) ) , 681 __FUNCTION__ ,"illegal thread type" );681 "illegal thread type" ); 682 682 683 683 assert( (core_lid < LOCAL_CLUSTER->cores_nr) , 684 __FUNCTION__ ,"illegal core_lid" );684 "illegal core_lid" ); 685 685 686 686 #if DEBUG_THREAD_KERNEL_CREATE … … 740 740 lid_t core_lid ) 741 741 { 742 assert( (type == THREAD_IDLE) , __FUNCTION__ ,"illegal thread type" );743 assert( (core_lid < LOCAL_CLUSTER->cores_nr) , __FUNCTION__ ,"illegal core index" );742 assert( (type == THREAD_IDLE) , "illegal thread type" ); 743 assert( (core_lid < LOCAL_CLUSTER->cores_nr) , "illegal core index" ); 744 744 745 745 // initialize thread descriptor … … 752 752 0 , 0 ); // no user stack for a kernel thread 753 753 754 assert( (error == 0), __FUNCTION__,"cannot create thread idle" );754 assert( (error == 0), "cannot create thread idle" ); 755 755 756 756 // allocate & initialize CPU context if success 757 757 error = hal_cpu_context_alloc( thread ); 758 758 759 assert( (error == 0), __FUNCTION__,"cannot allocate CPU context" );759 assert( (error == 0), "cannot allocate CPU context" ); 760 760 761 761 hal_cpu_context_init( thread ); … … 782 782 #endif 783 783 784 assert( (thread->local_locks == 0) , __FUNCTION__ ,784 assert( (thread->local_locks == 0) , 785 785 "local lock not released for thread %x in process %x", thread->trdid, process->pid ); 786 786 787 assert( (thread->remote_locks == 0) , __FUNCTION__ ,787 assert( (thread->remote_locks == 0) , 788 788 "remote lock not released for thread %x in process %x", thread->trdid, process->pid ); 789 789 … … 867 867 868 868 // check signal pending in scheduler 869 assert( sched->req_ack_pending , __FUNCTION__ ,"no pending signal" );869 assert( sched->req_ack_pending , "no pending signal" ); 870 870 871 871 // enter critical section … … 1005 1005 // must be deleted by the parent process sys_wait() function 1006 1006 owner_cxy = CXY_FROM_PID( pid ); 1007 assert( ((owner_cxy != target_cxy) || (target_ltid != 0)), __FUNCTION__,1007 assert( ((owner_cxy != target_cxy) || (target_ltid != 0)), 1008 1008 "tharget thread cannot be the main thread\n" ); 1009 1009
Note: See TracChangeset
for help on using the changeset viewer.