Changeset 68 for trunk/kernel/kern
- Timestamp:
- Jun 27, 2017, 10:24:13 AM (8 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/core.c
r23 r68 3 3 * 4 4 * Author Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Mohamed Lamine Karaoui (2015) 6 * Alain Greiner (2016) 5 * Alain Greiner (2016,2017) 7 6 * 8 7 * Copyright (c) UPMC Sorbonne Universites … … 53 52 core->rpc_threads = 0; 54 53 55 rpc_fifo_init( &core->rpc_fifo );56 57 54 list_root_init( &core->rpc_free_list ); 58 55 -
trunk/kernel/kern/core.h
r19 r68 3 3 * 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Mohamed Lamine Karaoui (2015) 6 * Alain Greiner (2016) 5 * Alain Greiner (2016,2017) 7 6 * 8 7 * Copyright (c) UPMC Sorbonne Universites … … 62 61 uint32_t rpc_threads; /*! total number of RPC threads for this core */ 63 62 list_entry_t rpc_free_list; /*! root of the list of free RPC threads */ 64 rpc_fifo_t rpc_fifo; /*! embedded private RPC fifo (one per core) */65 63 66 64 scheduler_t scheduler; /*! embedded private scheduler */ … … 69 67 struct chdev_s * pti_vector[CONFIG_MAX_PTIS_PER_ICU]; /*! on source device */ 70 68 struct chdev_s * wti_vector[CONFIG_MAX_WTIS_PER_ICU]; /*! on source device */ 71 72 // sysfs_entry_t node;73 69 } 74 70 core_t; -
trunk/kernel/kern/kernel_init.c
r50 r68 32 32 #include <core.h> 33 33 #include <list.h> 34 #include <xlist.h> 34 35 #include <thread.h> 35 36 #include <scheduler.h> … … 54 55 #include <soclib_tty.h> 55 56 #include <devfs.h> 57 #include <mapper.h> 56 58 57 59 … … 659 661 if( core_lid == 0 ) local_cxy = info->cxy; 660 662 663 // each core get pointer on its private idle thread descriptor 664 thread = (thread_t *)( idle_threads + (core_lid * CONFIG_THREAD_DESC_SIZE) ); 665 666 // each core register this thread pointer in hardware register 667 hal_set_current_thread( thread ); 668 661 669 // CP0 in I/O cluster initialises TXT0 chdev descriptor 662 670 if( (core_lid == 0) && (core_cxy == info->io_cxy) ) txt0_device_init( info ); … … 755 763 __FUNCTION__ , core_cxy , core_lid , hal_time_stamp() ); 756 764 757 // all cores initialize the private idle thread descriptor758 thread = (thread_t *)( idle_threads + (core_lid * CONFIG_THREAD_DESC_SIZE) );759 765 760 766 error = thread_kernel_init( thread, … … 763 769 NULL, 764 770 core_lid ); 765 766 771 if( error ) 767 772 { … … 775 780 core->scheduler.idle = thread; 776 781 777 // register idle thread pointer in core register778 hal_set_current_thread( thread );779 780 782 // activate the idle thread 781 783 thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL ); … … 816 818 { 817 819 print_banner( (info->x_size * info->y_size) , info->cores_nr ); 820 821 kinit_dmsg("\n\n*** memory fooprint of main kernet objects ***\n" 822 " - thread descriptor : %d bytes\n" 823 " - process descriptor : %d bytes\n" 824 " - cluster manager : %d bytes\n" 825 " - chdev descriptor : %d bytes\n" 826 " - core descriptor : %d bytes\n" 827 " - scheduler : %d bytes\n" 828 " - rpc fifo : %d bytes\n" 829 " - page descriptor : %d bytes\n" 830 " - mapper root : %d bytes\n" 831 " - ppm manager : %d bytes\n" 832 " - kcm manager : %d bytes\n" 833 " - khm manager : %d bytes\n" 834 " - vmm manager : %d bytes\n" 835 " - gpt root : %d bytes\n" 836 " - list item : %d bytes\n" 837 " - xlist item : %d bytes\n" 838 " - spinlock : %d bytes\n" 839 " - remote spinlock : %d bytes\n" 840 " - rwlock : %d bytes\n" 841 " - remote rwlock : %d bytes\n", 842 sizeof( thread_t ), 843 sizeof( process_t ), 844 sizeof( cluster_t ), 845 sizeof( chdev_t ), 846 sizeof( core_t ), 847 sizeof( scheduler_t ), 848 sizeof( rpc_fifo_t ), 849 sizeof( page_t ), 850 sizeof( mapper_t ), 851 sizeof( ppm_t ), 852 sizeof( kcm_t ), 853 sizeof( khm_t ), 854 sizeof( vmm_t ), 855 sizeof( gpt_t ), 856 sizeof( list_entry_t ), 857 sizeof( xlist_entry_t ), 858 sizeof( spinlock_t ), 859 sizeof( remote_spinlock_t ), 860 sizeof( rwlock_t ), 861 sizeof( remote_rwlock_t )); 818 862 } 819 863 -
trunk/kernel/kern/rpc.c
r23 r68 1249 1249 reg_t sr_save; 1250 1250 1251 printk("\n@@@ coucou 0\n");1252 1253 1251 // get client CPU and cluster coordinates 1254 1252 cxy_t client_cxy = local_cxy; … … 1267 1265 { 1268 1266 error = remote_fifo_put_item( XPTR( server_cxy , &rf->fifo ), 1269 (void *)&xp, 1270 sizeof(xptr_t), 1267 (uint64_t *)&xp, 1271 1268 &first ); 1272 1269 … … 1280 1277 while( error ); 1281 1278 1282 printk("\n@@@ coucou 1\n");1283 1284 1279 rpc_dmsg("\n[INFO] %s on core %d in cluster %x sent RPC %p to cluster %x\n", 1285 1280 __FUNCTION__ , client_lid , client_cxy , rpc , server_cxy ); … … 1302 1297 } 1303 1298 1304 printk("\n@@@ coucou 2\n");1305 1306 1299 // activate preemption to allow incoming RPC and avoid deadlock 1307 1300 if( this->type == THREAD_RPC ) hal_enable_irq( &sr_save ); … … 1312 1305 if( rpc->response == 0 ) break; 1313 1306 } 1314 1315 printk("\n@@@ coucou 3\n");1316 1307 1317 1308 // restore preemption … … 1356 1347 { 1357 1348 error = local_fifo_get_item( &rpc_fifo->fifo, 1358 &xp, 1359 sizeof(xptr_t) ); 1349 (uint64_t *)&xp ); 1360 1350 1361 1351 if ( error == 0 ) // One RPC request successfully extracted from RPC_FIFO -
trunk/kernel/kern/thread.c
r60 r68 745 745 void thread_idle_func() 746 746 { 747 748 #if CONFIG_IDLE_DEBUG 747 749 lid_t lid = CURRENT_CORE->lid; 750 #endif 748 751 749 752 while( 1 )
Note: See TracChangeset
for help on using the changeset viewer.