Changeset 103 for trunk/kernel
- Timestamp:
- Jun 29, 2017, 6:22:27 PM (7 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r101 r103 641 641 // To comply with the multi-kernels paradigm, it accesses only local cluster memory, using 642 642 // only information contained in the local boot_info_t structure, set by the bootloader. 643 // Only CP0 in cluster 0 print the log messages. 643 644 /////////////////////////////////////////////////////////////////////////////////////////// 644 645 // @ info : pointer on the local boot-info structure. … … 654 655 error_t error; 655 656 656 // all cores get core identifiers657 // all cores get and check core identifiers 657 658 error = get_core_identifiers( info, 658 659 &core_lid, … … 668 669 // each core registers this thread pointer in hardware register 669 670 hal_set_current_thread( thread ); 670 671 #ifdef __HAL_x86_64__672 return;673 #endif674 671 675 672 // CP0 in I/O cluster initialises TXT0 chdev descriptor … … 683 680 ///////////////////////////////////////////////////////////////////////////////// 684 681 685 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 0 at cycle %d\n", 686 __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() ); 682 if( (core_lid == 0) && (local_cxy == info->io_cxy) ) 683 { 684 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 0 at cycle %d\n", 685 __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() ); 686 } 687 687 688 688 // all cores check core identifiers 689 689 if( error ) 690 690 { 691 printk("\n[PANIC] in %s : illegal core identifiers"691 nolock_printk("\n[PANIC] in %s : illegal core identifiers" 692 692 " gid = %x / cxy = %x / lid = %d\n", 693 693 __FUNCTION__ , core_lid , core_cxy , core_lid ); … … 702 702 if( error ) 703 703 { 704 printk("\n[PANIC] in %s : cannot initialise cluster manager in cluster %x",704 nolock_printk("\n[PANIC] in %s : cannot initialise cluster manager in cluster %x", 705 705 __FUNCTION__ , local_cxy ); 706 706 hal_core_sleep(); … … 715 715 ///////////////////////////////////////////////////////////////////////////////// 716 716 717 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 1 at cycle %d\n", 718 __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() ); 717 if( (core_lid == 0) && (local_cxy == info->io_cxy) ) 718 { 719 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 1 at cycle %d\n", 720 __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() ); 721 } 719 722 720 723 // all cores get pointer on local cluster manager and on core descriptor … … 744 747 if( wti_id != lid ) 745 748 { 746 printk("\n[PANIC] in %s : WTI index for IPI = %d / core_lid = %d",747 __FUNCTION__ , wti_id , lid );749 nolock_printk("\n[PANIC] in %s : WTI index for IPI = %d / core_lid = %d", 750 __FUNCTION__ , wti_id , lid ); 748 751 hal_core_sleep(); 749 752 } … … 766 769 ///////////////////////////////////////////////////////////////////////////////// 767 770 768 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 2 at cycle %d\n", 769 __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() ); 770 771 if( (core_lid == 0) && (local_cxy == info->io_cxy) ) 772 { 773 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 2 at cycle %d\n", 774 __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() ); 775 } 771 776 772 777 error = thread_kernel_init( thread, … … 777 782 if( error ) 778 783 { 779 printk("\n[PANIC] in %s : core[%x][%d] cannot initialize idle thread\n",780 __FUNCTION__ , local_cxy , core_lid );784 nolock_printk("\n[PANIC] in %s : core[%x][%d] cannot initialize idle thread\n", 785 __FUNCTION__ , local_cxy , core_lid ); 781 786 hal_core_sleep(); 782 787 } 783 else 784 { 785 // register idle thread in scheduler 786 core->scheduler.idle = thread; 787 788 // activate the idle thread 789 thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL ); 790 788 789 // register idle thread in scheduler 790 core->scheduler.idle = thread; 791 792 // activate the idle thread 793 thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL ); 794 795 if( (core_lid == 0) && (local_cxy == info->io_cxy) ) 796 { 791 797 kinit_dmsg("\n[INFO] %s : core[%x][%d] created idle thread %x at cycle %d\n", 792 798 __FUNCTION__ , core_cxy , core_lid , thread , hal_get_cycles()); … … 805 811 else 806 812 { 807 printk("\n[PANIC] in %s : root FS must be FATFS\n", __FUNCTION__ );813 nolock_printk("\n[PANIC] in %s : root FS must be FATFS\n", __FUNCTION__ ); 808 814 hal_core_sleep(); 809 815 } … … 811 817 if( root_inode_xp == XPTR_NULL ) 812 818 { 813 printk("\n[PANIC] in %s : core[%x][%d] cannot initialize file system\n",819 nolock_printk("\n[PANIC] in %s : core[%x][%d] cannot initialize file system\n", 814 820 __FUNCTION__ , local_cxy , core_lid ); 815 821 hal_core_sleep(); … … 882 888 ///////////////////////////////////////////////////////////////////////////////// 883 889 884 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 3 at cycle %d\n", 885 __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() ); 890 if( (core_lid == 0) && (local_cxy == info->io_cxy) ) 891 { 892 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 3 at cycle %d\n", 893 __FUNCTION__ , core_cxy , core_lid , hal_get_cycles() ); 894 } 886 895 887 896 // each core activates its private PTI IRQ … … 895 904 dev_icu_get_masks( core_lid , &hwi_mask , &wti_mask , &pti_mask ); 896 905 897 thread_dmsg("\n[INFO] %s : core[%x][%d] activates schedulerat cycle %d\n"906 thread_dmsg("\n[INFO] %s : core[%x][%d] complete kernel init at cycle %d\n" 898 907 " hwi_mask = %x / wti_mask = %x / pti_mask = %x\n", 899 908 __FUNCTION__ , local_cxy , core_lid , hal_get_cycles() , -
trunk/kernel/kern/printk.c
r23 r103 375 375 remote_spinlock_lock_busy( txt0_lock_xp , &save_sr ); 376 376 377 // call kernel_printf in busy waiting mode377 // call kernel_printf on TXT0, in busy waiting mode 378 378 va_start( args , format ); 379 379 kernel_printf( 0 , 1 , format , &args ); … … 384 384 } 385 385 386 ////////////////////////////////////// 387 void user_printk( char * format , ...)386 //////////////////////////////////////// 387 void nolock_printk( char * format , ...) 388 388 { 389 389 va_list args; 390 390 391 // get calling thread TXT channel TODO 392 uint32_t channel = 0; 393 394 // call kernel_printf in descheduling mode 391 // call kernel_printf on TXT0, in busy waiting mode 395 392 va_start( args , format ); 396 kernel_printf( channel, 0, format , &args );393 kernel_printf( 0 , 1 , format , &args ); 397 394 va_end( args ); 398 395 } -
trunk/kernel/kern/printk.h
r50 r103 67 67 * This function displays a formated string on the kernel terminal TXT0, 68 68 * using a busy waiting policy: It calls directly the relevant TXT driver, 69 * after taking the TXT0 chdevlock for exclusive access to the TXT0 terminal.69 * after taking the lock for exclusive access to the TXT0 terminal. 70 70 ********************************************************************************** 71 71 * @ format : formated string. 72 72 *********************************************************************************/ 73 void 73 void printk( char* format, ... ); 74 74 75 75 /********************************************************************************** 76 * Display a formated string on the calling thread private terminal, using a 77 * descheduling policy: it register the request in the selected TXT chdev waiting 78 * queue and deschedule. IT is reactivated by the IRQ signaling completion. 79 * Not fully implemented yet ( use TXT0 in deschedling mode ). 76 * This function displays a formated string on the kernel terminal TXT0, 77 * using a busy waiting policy: It calls directly the relevant TXT driver, 78 * without taking the the lock protecting exclusive access to TXT0 terminal. 80 79 ********************************************************************************** 81 80 * @ format : formated string. 82 81 *********************************************************************************/ 83 void user_printk( char* format, ... );82 void nolock_printk( char* format, ... ); 84 83 85 84 /********************************************************************************** … … 203 202 204 203 #if CONFIG_KINIT_DEBUG 205 #define kinit_dmsg(...) printk(__VA_ARGS__)204 #define kinit_dmsg(...) nolock_printk(__VA_ARGS__) 206 205 #else 207 206 #define kinit_dmsg(...)
Note: See TracChangeset
for help on using the changeset viewer.