Changeset 623 for trunk/kernel/kern
- Timestamp:
- Mar 6, 2019, 4:37:15 PM (6 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r619 r623 3 3 * 4 4 * Authors : Mohamed Lamine Karaoui (2015) 5 * Alain Greiner (2016,2017,2018 )5 * Alain Greiner (2016,2017,2018,2019) 6 6 * 7 7 * Copyright (c) Sorbonne Universites … … 113 113 cxy_t local_cxy CONFIG_CACHE_LINE_ALIGNED; 114 114 115 // This variable is used for CP0cores synchronisation in kernel_init()115 // This variable is used for core[0] cores synchronisation in kernel_init() 116 116 __attribute__((section(".kdata"))) 117 117 xbarrier_t global_barrier CONFIG_CACHE_LINE_ALIGNED; … … 126 126 127 127 // kernel_init is the entry point defined in hal/tsar_mips32/kernel.ld 128 // It is used by the bootloader .128 // It is used by the bootloader to tranfer control to kernel. 129 129 extern void kernel_init( boot_info_t * info ); 130 130 … … 466 466 // These chdev descriptors are distributed on all clusters, using a modulo on a global 467 467 // index, identically computed in all clusters. 468 // This function is executed in all clusters by the CP0core, that computes a global index469 // for all external chdevs. Each CP0core creates only the chdevs that must be placed in468 // This function is executed in all clusters by the core[0] core, that computes a global index 469 // for all external chdevs. Each core[0] core creates only the chdevs that must be placed in 470 470 // the local cluster, because the global index matches the local index. 471 471 // The relevant entries in all copies of the devices directory are initialised. … … 626 626 627 627 /////////////////////////////////////////////////////////////////////////////////////////// 628 // This function is called by CP0in cluster 0 to allocate memory and initialize the PIC628 // This function is called by core[0] in cluster 0 to allocate memory and initialize the PIC 629 629 // device, namely the informations attached to the external IOPIC controller, that 630 630 // must be replicated in all clusters (struct iopic_input). … … 791 791 792 792 /////////////////////////////////////////////////////////////////////////////////////////// 793 // This function is called by all CP0s in all cluster to complete the PIC device793 // This function is called by all core[0]s in all cluster to complete the PIC device 794 794 // initialisation, namely the informations attached to the LAPIC controller. 795 795 // This initialisation must be done after the IOPIC initialisation, but before other … … 899 899 /////////////////////////////////////////////////////////////////////////////////////////// 900 900 // This function is the entry point for the kernel initialisation. 901 // It is executed by all cores in all clusters, but only core[0] , called CP0,902 // initializesthe shared resources such as the cluster manager, or the local peripherals.901 // It is executed by all cores in all clusters, but only core[0] initializes 902 // the shared resources such as the cluster manager, or the local peripherals. 903 903 // To comply with the multi-kernels paradigm, it accesses only local cluster memory, using 904 904 // only information contained in the local boot_info_t structure, set by the bootloader. 905 // Only CP0in cluster 0 print the log messages.905 // Only core[0] in cluster 0 print the log messages. 906 906 /////////////////////////////////////////////////////////////////////////////////////////// 907 907 // @ info : pointer on the local boot-info structure. … … 925 925 926 926 ///////////////////////////////////////////////////////////////////////////////// 927 // STEP 0: Each core get its core identifier from boot_info, and makes927 // STEP 1 : Each core get its core identifier from boot_info, and makes 928 928 // a partial initialisation of its private idle thread descriptor. 929 // CP0initializes the "local_cxy" global variable.930 // CP0 in cluster IO initializes the TXT0 chdev to printlog messages.929 // core[0] initializes the "local_cxy" global variable. 930 // core[0] in cluster[0] initializes the TXT0 chdev for log messages. 931 931 ///////////////////////////////////////////////////////////////////////////////// 932 932 … … 936 936 &core_gid ); 937 937 938 // all CP0sinitialize cluster identifier938 // core[0] initialize cluster identifier 939 939 if( core_lid == 0 ) local_cxy = info->cxy; 940 940 … … 956 956 #endif 957 957 958 // all CP0s initializecluster info958 // core[0] initializes cluster info 959 959 if( core_lid == 0 ) cluster_info_init( info ); 960 960 961 // CP0 in cluster 0initialises TXT0 chdev descriptor961 // core[0] in cluster[0] initialises TXT0 chdev descriptor 962 962 if( (core_lid == 0) && (core_cxy == 0) ) txt0_device_init( info ); 963 964 // all cores check identifiers 965 if( error ) 966 { 967 printk("\n[PANIC] in %s : illegal core : gid %x / cxy %x / lid %d", 968 __FUNCTION__, core_lid, core_cxy, core_lid ); 969 hal_core_sleep(); 970 } 963 971 964 972 ///////////////////////////////////////////////////////////////////////////////// … … 970 978 #if DEBUG_KERNEL_INIT 971 979 if( (core_lid == 0) & (local_cxy == 0) ) 972 printk("\n[%s] : exit barrier 0: TXT0 initialized / cycle %d\n",980 printk("\n[%s] : exit barrier 1 : TXT0 initialized / cycle %d\n", 973 981 __FUNCTION__, (uint32_t)hal_get_cycles() ); 974 982 #endif 975 983 976 ///////////////////////////////////////////////////////////////////////////// 977 // STEP 1 : all cores check core identifier. 978 // CP0 initializes the local cluster manager. 979 // This includes the memory allocators. 980 ///////////////////////////////////////////////////////////////////////////// 981 982 // all cores check identifiers 983 if( error ) 984 { 985 printk("\n[PANIC] in %s : illegal core : gid %x / cxy %x / lid %d", 986 __FUNCTION__, core_lid, core_cxy, core_lid ); 987 hal_core_sleep(); 988 } 989 990 // all CP0s initialise DQDT (only CPO in cluster 0 build the quad-tree) 984 ///////////////////////////////////////////////////////////////////////////////// 985 // STEP 2 : core[0] initializes the cluter manager, 986 // including the physical memory allocator. 987 ///////////////////////////////////////////////////////////////////////////////// 988 989 // core[0] initialises DQDT (only core[0] in cluster 0 build the quad-tree) 991 990 if( core_lid == 0 ) dqdt_init(); 992 991 993 // all CP0sinitialize other cluster manager complex structures992 // core[0] initialize other cluster manager complex structures 994 993 if( core_lid == 0 ) 995 994 { … … 1012 1011 #if DEBUG_KERNEL_INIT 1013 1012 if( (core_lid == 0) & (local_cxy == 0) ) 1014 printk("\n[%s] : exit barrier 1 : clusters initialised / cycle %d\n",1013 printk("\n[%s] : exit barrier 2 : cluster manager initialized / cycle %d\n", 1015 1014 __FUNCTION__, (uint32_t)hal_get_cycles() ); 1016 1015 #endif 1017 1016 1018 1017 ///////////////////////////////////////////////////////////////////////////////// 1019 // STEP 2 : CP0 initializes the process_zero descriptor.1020 // CP0 in cluster 0 initializes the IOPIC device.1018 // STEP 3 : core[0] initializes the process_zero descriptor, 1019 // including the kernel VMM (both GPT and VSL) 1021 1020 ///////////////////////////////////////////////////////////////////////////////// 1022 1021 … … 1025 1024 core = &cluster->core_tbl[core_lid]; 1026 1025 1027 // all CP0s initialize the process_zero descriptor 1028 if( core_lid == 0 ) process_zero_create( &process_zero ); 1029 1030 // CP0 in cluster 0 initializes the PIC chdev, 1026 // core[0] initializes the process_zero descriptor, 1027 if( core_lid == 0 ) process_zero_create( &process_zero , info ); 1028 1029 ///////////////////////////////////////////////////////////////////////////////// 1030 if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 1031 (info->x_size * info->y_size) ); 1032 barrier_wait( &local_barrier , info->cores_nr ); 1033 ///////////////////////////////////////////////////////////////////////////////// 1034 1035 #if DEBUG_KERNEL_INIT 1036 if( (core_lid == 0) & (local_cxy == 0) ) 1037 printk("\n[%s] : exit barrier 3 : kernel processs initialized / cycle %d\n", 1038 __FUNCTION__, (uint32_t)hal_get_cycles() ); 1039 #endif 1040 1041 ///////////////////////////////////////////////////////////////////////////////// 1042 // STEP 4 : all cores initialize their private MMU 1043 // core[0] in cluster 0 initializes the IOPIC device. 1044 ///////////////////////////////////////////////////////////////////////////////// 1045 1046 // all cores initialise their MMU 1047 hal_mmu_init( &process_zero.vmm.gpt ); 1048 1049 // core[0] in cluster[0] initializes the PIC chdev, 1031 1050 if( (core_lid == 0) && (local_cxy == 0) ) iopic_init( info ); 1032 1051 … … 1039 1058 #if DEBUG_KERNEL_INIT 1040 1059 if( (core_lid == 0) & (local_cxy == 0) ) 1041 printk("\n[%s] : exit barrier 2 : PIC initialised / cycle %d\n",1060 printk("\n[%s] : exit barrier 4 : MMU and IOPIC initialized / cycle %d\n", 1042 1061 __FUNCTION__, (uint32_t)hal_get_cycles() ); 1043 1062 #endif 1044 1063 1045 1064 //////////////////////////////////////////////////////////////////////////////// 1046 // STEP 3 : CP0initializes the distibuted LAPIC descriptor.1047 // CP0initializes the internal chdev descriptors1048 // CP0initialize the local external chdev descriptors1065 // STEP 5 : core[0] initializes the distibuted LAPIC descriptor. 1066 // core[0] initializes the internal chdev descriptors 1067 // core[0] initialize the local external chdev descriptors 1049 1068 //////////////////////////////////////////////////////////////////////////////// 1050 1069 1051 // all CP0s initialize their local LAPIC extension,1070 // all core[0]s initialize their local LAPIC extension, 1052 1071 if( core_lid == 0 ) lapic_init( info ); 1053 1072 1054 // CP0scan the internal (private) peripherals,1073 // core[0] scan the internal (private) peripherals, 1055 1074 // and allocates memory for the corresponding chdev descriptors. 1056 1075 if( core_lid == 0 ) internal_devices_init( info ); 1057 1076 1058 1077 1059 // All CP0s contribute to initialise external peripheral chdev descriptors.1060 // Each CP0[cxy] scan the set of external (shared) peripherals (but the TXT0),1078 // All core[0]s contribute to initialise external peripheral chdev descriptors. 1079 // Each core[0][cxy] scan the set of external (shared) peripherals (but the TXT0), 1061 1080 // and allocates memory for the chdev descriptors that must be placed 1062 1081 // on the (cxy) cluster according to the global index value. … … 1072 1091 #if DEBUG_KERNEL_INIT 1073 1092 if( (core_lid == 0) & (local_cxy == 0) ) 1074 printk("\n[%s] : exit barrier 3: all chdevs initialised / cycle %d\n",1093 printk("\n[%s] : exit barrier 5 : all chdevs initialised / cycle %d\n", 1075 1094 __FUNCTION__, (uint32_t)hal_get_cycles() ); 1076 1095 #endif … … 1082 1101 1083 1102 ///////////////////////////////////////////////////////////////////////////////// 1084 // STEP 4: All cores enable IPI (Inter Procesor Interrupt),1103 // STEP 6 : All cores enable IPI (Inter Procesor Interrupt), 1085 1104 // Alh cores initialize IDLE thread. 1086 // Only CP0 in cluster 0creates the VFS root inode.1105 // Only core[0] in cluster[0] creates the VFS root inode. 1087 1106 // It access the boot device to initialize the file system context. 1088 1107 ///////////////////////////////////////////////////////////////////////////////// … … 1107 1126 #endif 1108 1127 1109 // CPO in cluster 0creates the VFS root1128 // core[O] in cluster[0] creates the VFS root 1110 1129 if( (core_lid == 0) && (local_cxy == 0 ) ) 1111 1130 { … … 1137 1156 // 4. create VFS root inode in cluster 0 1138 1157 error = vfs_inode_create( FS_TYPE_FATFS, // fs_type 1139 INODE_TYPE_DIR, // inode_type1140 1158 0, // attr 1141 1159 0, // rights … … 1150 1168 } 1151 1169 1152 // 5. update FATFS root inode extension1170 // 5. update FATFS root inode "type" and "extend" fields 1153 1171 cxy_t vfs_root_cxy = GET_CXY( vfs_root_inode_xp ); 1154 1172 vfs_inode_t * vfs_root_ptr = GET_PTR( vfs_root_inode_xp ); 1173 hal_remote_s32( XPTR( vfs_root_cxy , &vfs_root_ptr->extend ), INODE_TYPE_DIR ); 1155 1174 hal_remote_spt( XPTR( vfs_root_cxy , &vfs_root_ptr->extend ), 1156 1175 (void*)(intptr_t)root_dir_cluster ); … … 1189 1208 #if DEBUG_KERNEL_INIT 1190 1209 if( (core_lid == 0) & (local_cxy == 0) ) 1191 printk("\n[%s] : exit barrier 4: VFS root (%x,%x) in cluster 0 / cycle %d\n",1210 printk("\n[%s] : exit barrier 6 : VFS root (%x,%x) in cluster 0 / cycle %d\n", 1192 1211 __FUNCTION__, GET_CXY(process_zero.vfs_root_xp), 1193 1212 GET_PTR(process_zero.vfs_root_xp), (uint32_t)hal_get_cycles() ); … … 1195 1214 1196 1215 ///////////////////////////////////////////////////////////////////////////////// 1197 // STEP 5 : Other CP0s allocate memory for the selected FS context,1198 // and initialise both the local FS context and the local VFS context1199 // from values stored in cluster 0.1216 // STEP 7 : In all other clusters than cluster[0], the core[0] allocates memory 1217 // for the selected FS context, and initialise the local FS context and 1218 // the local VFS context from values stored in cluster 0. 1200 1219 // They get the VFS root inode extended pointer from cluster 0. 1201 1220 ///////////////////////////////////////////////////////////////////////////////// … … 1259 1278 #if DEBUG_KERNEL_INIT 1260 1279 if( (core_lid == 0) & (local_cxy == 1) ) 1261 printk("\n[%s] : exit barrier 5: VFS root (%x,%x) in cluster 1 / cycle %d\n",1280 printk("\n[%s] : exit barrier 7 : VFS root (%x,%x) in cluster 1 / cycle %d\n", 1262 1281 __FUNCTION__, GET_CXY(process_zero.vfs_root_xp), 1263 1282 GET_PTR(process_zero.vfs_root_xp), (uint32_t)hal_get_cycles() ); … … 1265 1284 1266 1285 ///////////////////////////////////////////////////////////////////////////////// 1267 // STEP 6 : CP0 in cluster 0 makes the global DEVFS treeinitialisation:1286 // STEP 8 : core[0] in cluster 0 makes the global DEVFS initialisation: 1268 1287 // It initializes the DEVFS context, and creates the DEVFS 1269 1288 // "dev" and "external" inodes in cluster 0. … … 1309 1328 #if DEBUG_KERNEL_INIT 1310 1329 if( (core_lid == 0) & (local_cxy == 0) ) 1311 printk("\n[%s] : exit barrier 6: DEVFS root initialized in cluster 0 / cycle %d\n",1330 printk("\n[%s] : exit barrier 8 : DEVFS root initialized in cluster 0 / cycle %d\n", 1312 1331 __FUNCTION__, (uint32_t)hal_get_cycles() ); 1313 1332 #endif 1314 1333 1315 1334 ///////////////////////////////////////////////////////////////////////////////// 1316 // STEP 7 : All CP0s complete in parallel the DEVFS treeinitialization.1317 // Each CP0get the "dev" and "external" extended pointers from1335 // STEP 9 : All core[0]s complete in parallel the DEVFS initialization. 1336 // Each core[0] get the "dev" and "external" extended pointers from 1318 1337 // values stored in cluster 0. 1319 // Then each CP0in cluster(i) creates the DEVFS "internal" directory,1338 // Then each core[0] in cluster(i) creates the DEVFS "internal" directory, 1320 1339 // and creates the pseudo-files for all chdevs in cluster (i). 1321 1340 ///////////////////////////////////////////////////////////////////////////////// … … 1346 1365 #if DEBUG_KERNEL_INIT 1347 1366 if( (core_lid == 0) & (local_cxy == 0) ) 1348 printk("\n[%s] : exit barrier 7 : DEVinitialized in cluster 0 / cycle %d\n",1367 printk("\n[%s] : exit barrier 9 : DEVFS initialized in cluster 0 / cycle %d\n", 1349 1368 __FUNCTION__, (uint32_t)hal_get_cycles() ); 1350 1369 #endif 1351 1370 1352 ///////////////////////////////////////////////////////////////////////////////// 1353 // STEP 8 : CP0 in cluster 0 creates the first user process (process_init) 1371 #if( DEBUG_KERNEL_INIT & 1 ) 1372 if( (core_lid == 0) & (local_cxy == 0) ) 1373 vfs_display( vfs_root_inode_xp ); 1374 #endif 1375 1376 ///////////////////////////////////////////////////////////////////////////////// 1377 // STEP 10 : core[0] in cluster 0 creates the first user process (process_init). 1378 // This include the first user process VMM (GPT and VSL) creation. 1379 // Finally, it prints the ALMOS-MKH banner. 1354 1380 ///////////////////////////////////////////////////////////////////////////////// 1355 1381 1356 1382 if( (core_lid == 0) && (local_cxy == 0) ) 1357 1383 { 1358 1359 #if( DEBUG_KERNEL_INIT & 1 )1360 vfs_display( vfs_root_inode_xp );1361 #endif1362 1363 1384 process_init_create(); 1364 1385 } 1365 1366 /////////////////////////////////////////////////////////////////////////////////1367 if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ),1368 (info->x_size * info->y_size) );1369 barrier_wait( &local_barrier , info->cores_nr );1370 /////////////////////////////////////////////////////////////////////////////////1371 1372 #if DEBUG_KERNEL_INIT1373 if( (core_lid == 0) & (local_cxy == 0) )1374 printk("\n[%s] : exit barrier 8 : process init created / cycle %d\n",1375 __FUNCTION__, (uint32_t)hal_get_cycles() );1376 #endif1377 1386 1378 1387 #if (DEBUG_KERNEL_INIT & 1) … … 1381 1390 #endif 1382 1391 1383 /////////////////////////////////////////////////////////////////////////////////1384 // STEP 9 : CP0 in cluster 0 print banner1385 /////////////////////////////////////////////////////////////////////////////////1386 1387 1392 if( (core_lid == 0) && (local_cxy == 0) ) 1388 1393 { 1389 1394 print_banner( (info->x_size * info->y_size) , info->cores_nr ); 1395 } 1390 1396 1391 1397 #if( DEBUG_KERNEL_INIT & 1 ) 1398 if( (core_lid == 0) & (local_cxy == 0) ) 1392 1399 printk("\n\n***** memory fooprint for main kernel objects\n\n" 1393 1400 " - thread descriptor : %d bytes\n" … … 1437 1444 #endif 1438 1445 1439 } 1446 // each core updates the register(s) definig the kernel 1447 // entry points for interrupts, exceptions and syscalls... 1448 hal_set_kentry(); 1440 1449 1441 1450 // each core activates its private TICK IRQ … … 1448 1457 ///////////////////////////////////////////////////////////////////////////////// 1449 1458 1450 #if DEBUG_KERNEL_INIT1459 #if( DEBUG_KERNEL_INIT & 1 ) 1451 1460 thread_t * this = CURRENT_THREAD; 1452 1461 printk("\n[%s] : thread[%x,%x] on core[%x,%d] jumps to thread_idle_func() / cycle %d\n", -
trunk/kernel/kern/printk.c
r583 r623 48 48 49 49 va_list args; // printf arguments 50 uint32_t ps; // writepointer to the string buffer50 uint32_t ps; // pointer to the string buffer 51 51 52 52 ps = 0; … … 57 57 while ( *format != 0 ) 58 58 { 59 60 59 if (*format == '%') // copy argument to string 61 60 { … … 98 97 break; 99 98 } 100 case ('d'): // decimal signed integer 99 case ('b'): // excactly 2 digits hexadecimal integer 100 { 101 int val = va_arg( args, int ); 102 int val_lsb = val & 0xF; 103 int val_msb = (val >> 4) & 0xF; 104 buf[0] = HexaTab[val_msb]; 105 buf[1] = HexaTab[val_lsb]; 106 len = 2; 107 pbuf = buf; 108 break; 109 } 110 case ('d'): // up to 10 digits decimal signed integer 101 111 { 102 112 int val = va_arg( args, int ); … … 108 118 for(i = 0; i < 10; i++) 109 119 { 110 111 120 buf[9 - i] = HexaTab[val % 10]; 112 121 if (!(val /= 10)) break; … … 116 125 break; 117 126 } 118 case ('u'): // decimal unsigned integer127 case ('u'): // up to 10 digits decimal unsigned integer 119 128 { 120 129 uint32_t val = va_arg( args, uint32_t ); … … 128 137 break; 129 138 } 130 case ('x'): // 32 bits hexadecimal131 case ('l'): // 64 bits hexadecimal139 case ('x'): // up to 8 digits hexadecimal 140 case ('l'): // up to 16 digits hexadecimal 132 141 { 133 142 uint32_t imax; … … 157 166 break; 158 167 } 159 case ('X'): // 32 bits hexadecimal on 8 characters168 case ('X'): // exactly 8 digits hexadecimal 160 169 { 161 170 uint32_t val = va_arg( args , uint32_t ); … … 238 247 case ('c'): /* char conversion */ 239 248 { 240 int val = va_arg( *args , int );249 int val = va_arg( *args , int ); 241 250 len = 1; 242 buf[0] = val;251 buf[0] = (char)val; 243 252 pbuf = &buf[0]; 244 253 break; 245 254 } 246 case ('d'): /* 32 bits decimal signed */ 255 case ('b'): // excactly 2 digits hexadecimal 256 { 257 int val = va_arg( *args, int ); 258 int val_lsb = val & 0xF; 259 int val_msb = (val >> 4) & 0xF; 260 buf[0] = HexaTab[val_msb]; 261 buf[1] = HexaTab[val_lsb]; 262 len = 2; 263 pbuf = buf; 264 break; 265 } 266 case ('d'): /* up to 10 digits signed decimal */ 247 267 { 248 268 int val = va_arg( *args , int ); … … 261 281 break; 262 282 } 263 case ('u'): /* 32 bits decimal unsigned*/283 case ('u'): /* up to 10 digits unsigned decimal */ 264 284 { 265 285 uint32_t val = va_arg( *args , uint32_t ); … … 273 293 break; 274 294 } 275 case ('x'): /* 32 bits hexadecimal unsigned*/295 case ('x'): /* up to 8 digits hexadecimal */ 276 296 { 277 297 uint32_t val = va_arg( *args , uint32_t ); … … 286 306 break; 287 307 } 288 case ('X'): /* 32 bits hexadecimal unsigned on 10 char*/308 case ('X'): /* exactly 8 digits hexadecimal */ 289 309 { 290 310 uint32_t val = va_arg( *args , uint32_t ); … … 299 319 break; 300 320 } 301 case ('l'): /* 64 bits hexadecimal unsigned*/302 { 303 u nsigned long long val = va_arg( *args , unsigned long long);321 case ('l'): /* up to 16 digits hexadecimal */ 322 { 323 uint64_t val = va_arg( *args , uint64_t ); 304 324 dev_txt_sync_write( "0x" , 2 ); 305 325 for(i = 0; i < 16; i++) … … 312 332 break; 313 333 } 314 case ('L'): /* 64 bits hexadecimal unsigned on 18 char*/315 { 316 u nsigned long long val = va_arg( *args , unsigned long long);334 case ('L'): /* exactly 16 digits hexadecimal */ 335 { 336 uint64_t val = va_arg( *args , uint64_t ); 317 337 dev_txt_sync_write( "0x" , 2 ); 318 338 for(i = 0; i < 16; i++) … … 525 545 } 526 546 547 ///////////////////////////// 548 void putb( char * string, 549 uint8_t * buffer, 550 uint32_t size ) 551 { 552 uint32_t line; 553 uint32_t byte = 0; 554 555 // get pointers on TXT0 chdev 556 xptr_t txt0_xp = chdev_dir.txt_tx[0]; 557 cxy_t txt0_cxy = GET_CXY( txt0_xp ); 558 chdev_t * txt0_ptr = GET_PTR( txt0_xp ); 559 560 // get extended pointer on remote TXT0 chdev lock 561 xptr_t lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock ); 562 563 // get TXT0 lock 564 remote_busylock_acquire( lock_xp ); 565 566 // display string on TTY0 567 nolock_printk("\n***** %s *****\n", string ); 568 569 for ( line = 0 ; line < (size>>4) ; line++ ) 570 { 571 nolock_printk(" %X | %b %b %b %b | %b %b %b %b | %b %b %b %b | %b %b %b %b \n", 572 byte, 573 buffer[byte+ 0],buffer[byte+ 1],buffer[byte+ 2],buffer[byte+ 3], 574 buffer[byte+ 4],buffer[byte+ 5],buffer[byte+ 6],buffer[byte+ 7], 575 buffer[byte+ 8],buffer[byte+ 9],buffer[byte+10],buffer[byte+11], 576 buffer[byte+12],buffer[byte+13],buffer[byte+14],buffer[byte+15] ); 577 578 byte += 16; 579 } 580 581 // release TXT0 lock 582 remote_busylock_release( lock_xp ); 583 } 584 585 527 586 528 587 // Local Variables: -
trunk/kernel/kern/printk.h
r583 r623 24 24 /////////////////////////////////////////////////////////////////////////////////// 25 25 // The printk.c and printk.h files define the functions used by the kernel 26 // to display messages on a text terminal. 27 // Two access modes are supported: 28 // - The printk() function displays kernel messages on the kernel terminal TXT0, 29 // using a busy waiting policy: It calls directly the relevant TXT driver, 30 // after taking the TXT0 busylock for exclusive access to the TXT0 terminal. 31 // - The user_printk() function displays messages on the calling thread private 32 // terminal, using a descheduling policy: it register the request in the selected 33 // TXT chdev waiting queue and deschedule. The calling thread is reactivated by 34 // the IRQ signalling completion. 35 // Both functions use the generic TXT device to call the proper implementation 36 // dependant TXT driver. 37 // Finally these files define a set of conditional trace <***_dmsg> for debug. 26 // to display messages on the kernel terminal TXT0, using a busy waiting policy. 27 // It calls synchronously the TXT0 driver, without descheduling. 38 28 /////////////////////////////////////////////////////////////////////////////////// 39 29 … … 44 34 #include <stdarg.h> 45 35 46 #include <hal_special.h> // hal_get_cycles()36 #include <hal_special.h> 47 37 48 38 /********************************************************************************** 49 39 * This function build a formatted string. 50 40 * The supported formats are defined below : 51 * %c : single character 52 * %d : signed decimal 32 bits integer 53 * %u : unsigned decimal 32 bits integer 54 * %x : hexadecimal 32 bits integer 55 * %l : hexadecimal 64 bits integer 41 * %b : exactly 2 digits hexadecimal integer (8 bits) 42 * %c : single ascii character (8 bits) 43 * %d : up to 10 digits decimal integer (32 bits) 44 * %u : up to 10 digits unsigned decimal (32 bits) 45 * %x : up to 8 digits hexadecimal integer (32 bits) 46 * %X : exactly 8 digits hexadecimal integer (32 bits) 47 * %l : up to 16 digits hexadecimal integer (64 bits) 48 * %L : exactly 16 digits hexadecimal integer (64 bits) 56 49 * %s : NUL terminated character string 57 50 ********************************************************************************** … … 153 146 void putl( uint64_t val ); 154 147 148 /********************************************************************************** 149 * This debug function displays on the kernel TXT0 terminal the content of an 150 * array of bytes defined by <buffer> and <size> arguments (16 bytes per line). 151 * The <string> argument is displayed before the buffer content. 152 * The line format is an address folowed by 16 (hexa) bytes. 153 ********************************************************************************** 154 * @ string : buffer name or identifier. 155 * @ buffer : local pointer on bytes array. 156 * @ size : number of bytes bytes to display. 157 *********************************************************************************/ 158 void putb( char * string, 159 uint8_t * buffer, 160 uint32_t size ); 161 162 155 163 156 164 #endif // _PRINTK_H -
trunk/kernel/kern/process.c
r619 r623 29 29 #include <hal_uspace.h> 30 30 #include <hal_irqmask.h> 31 #include <hal_vmm.h> 31 32 #include <errno.h> 32 33 #include <printk.h> … … 486 487 } 487 488 488 // FIXME decrement the refcount on file pointer by vfs_bin_xp [AG] 489 // FIXME decrement the refcount on file pointer for vfs_bin_xp [AG] 490 489 491 // FIXME close all open files [AG] 492 490 493 // FIXME synchronize dirty files [AG] 491 494 … … 1487 1490 printk("\n[ERROR] in %s : cannot initialise VMM for %s\n", __FUNCTION__ , path ); 1488 1491 vfs_close( file_xp , file_id ); 1489 // FIXME restore old process VMM 1492 // FIXME restore old process VMM [AG] 1490 1493 return -1; 1491 1494 } … … 1505 1508 printk("\n[ERROR] in %s : failed to access <%s>\n", __FUNCTION__ , path ); 1506 1509 vfs_close( file_xp , file_id ); 1507 // FIXME restore old process VMM 1510 // FIXME restore old process VMM [AG] 1508 1511 return -1; 1509 1512 } … … 1535 1538 1536 1539 1537 /////////////////////////////////////////////// 1538 void process_zero_create( process_t * process ) 1540 //////////////////////////////////////////////// 1541 void process_zero_create( process_t * process, 1542 boot_info_t * info ) 1539 1543 { 1540 1544 error_t error; … … 1566 1570 process->parent_xp = XPTR( local_cxy , process ); 1567 1571 process->term_state = 0; 1572 1573 // initialise kernel GPT and VSL, depending on architecture 1574 hal_vmm_kernel_init( info ); 1568 1575 1569 1576 // reset th_tbl[] array and associated fields -
trunk/kernel/kern/process.h
r618 r623 73 73 * is always stored in the same cluster as the inode associated to the file. 74 74 * A free entry in this array contains the XPTR_NULL value. 75 * The array size is defined by athe CONFIG_PROCESS_FILE_MAX_NR parameter.75 * The array size is defined by the CONFIG_PROCESS_FILE_MAX_NR parameter. 76 76 * 77 77 * NOTE: - Only the fd_array[] in the reference process contains a complete list of open … … 79 79 * - the fd_array[] in a process copy is simply a cache containing a subset of the 80 80 * open files to speed the fdid to xptr translation, but the "lock" and "current 81 * fields should not beused.81 * fields are not used. 82 82 * - all modifications made by the process_fd_remove() are done in reference cluster 83 83 * and reported in all process_copies. … … 200 200 201 201 /********************************************************************************************* 202 * This function initialize, in each cluster, the kernel "process_zero", that is the owner203 * ofall kernel threads in a given cluster. It is called by the kernel_init() function.202 * This function initialize, in each cluster, the kernel "process_zero", that contains 203 * all kernel threads in a given cluster. It is called by the kernel_init() function. 204 204 * The process_zero descriptor is allocated as a global variable in file kernel_init.c 205 205 * Both the PID and PPID fields are set to zero, the ref_xp is the local process_zero, 206 206 * and the parent process is set to XPTR_NULL. The th_tbl[] is initialized as empty. 207 ********************************************************************************************* 208 * @ process : [in] pointer on local process descriptor to initialize. 209 ********************************************************************************************/ 210 void process_zero_create( process_t * process ); 207 * The process GPT is initialised as required by the target architecture. 208 * The "kcode" and "kdata" segments are registered in the process VSL. 209 ********************************************************************************************* 210 * @ process : [in] pointer on process descriptor to initialize. 211 * @ info : pointer on local boot_info_t (for kernel segments base and size). 212 ********************************************************************************************/ 213 void process_zero_create( process_t * process, 214 boot_info_t * info ); 211 215 212 216 /********************************************************************************************* … … 428 432 * identified by the <process_xp> argument, register the <file_xp> argument in the 429 433 * allocated slot, and return the slot index in the <fdid> buffer. 430 * It can be called by any thread in any cluster, because it uses portableremote access434 * It can be called by any thread in any cluster, because it uses remote access 431 435 * primitives to access the reference process descriptor. 432 436 * It takes the lock protecting the reference fd_array against concurrent accesses. -
trunk/kernel/kern/rpc.c
r619 r623 2 2 * rpc.c - RPC operations implementation. 3 3 * 4 * Author Alain Greiner (2016,2017,2018 )4 * Author Alain Greiner (2016,2017,2018,2019) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 58 58 &rpc_thread_user_create_server, // 6 59 59 &rpc_thread_kernel_create_server, // 7 60 &rpc_ undefined, // 8 unused slot60 &rpc_vfs_fs_update_dentry_server, // 8 61 61 &rpc_process_sigaction_server, // 9 62 62 … … 67 67 &rpc_vfs_file_create_server, // 14 68 68 &rpc_vfs_file_destroy_server, // 15 69 &rpc_vfs_fs_ get_dentry_server, // 1669 &rpc_vfs_fs_new_dentry_server, // 16 70 70 &rpc_vfs_fs_add_dentry_server, // 17 71 71 &rpc_vfs_fs_remove_dentry_server, // 18 … … 76 76 &rpc_kcm_alloc_server, // 22 77 77 &rpc_kcm_free_server, // 23 78 &rpc_ undefined, // 24 unused slot78 &rpc_mapper_sync_server, // 24 79 79 &rpc_mapper_handle_miss_server, // 25 80 80 &rpc_vmm_delete_vseg_server, // 26 … … 94 94 "THREAD_USER_CREATE", // 6 95 95 "THREAD_KERNEL_CREATE", // 7 96 " undefined",// 896 "VFS_FS_UPDATE_DENTRY", // 8 97 97 "PROCESS_SIGACTION", // 9 98 98 … … 112 112 "KCM_ALLOC", // 22 113 113 "KCM_FREE", // 23 114 " undefined",// 24114 "MAPPER_SYNC", // 24 115 115 "MAPPER_HANDLE_MISS", // 25 116 116 "VMM_DELETE_VSEG", // 26 … … 921 921 922 922 ///////////////////////////////////////////////////////////////////////////////////////// 923 // [7] Marshaling functions attached to RPC_THREAD_KERNEL_CREATE (blocking)923 // [7] Marshaling functions attached to RPC_THREAD_KERNEL_CREATE 924 924 ///////////////////////////////////////////////////////////////////////////////////////// 925 925 … … 1013 1013 1014 1014 ///////////////////////////////////////////////////////////////////////////////////////// 1015 // [8] undefined slot 1016 ///////////////////////////////////////////////////////////////////////////////////////// 1017 1015 // [8] Marshaling functions attached to RPC_VRS_FS_UPDATE_DENTRY 1016 ///////////////////////////////////////////////////////////////////////////////////////// 1017 1018 ///////////////////////////////////////////////////////// 1019 void rpc_vfs_fs_update_dentry_client( cxy_t cxy, 1020 vfs_inode_t * inode, 1021 vfs_dentry_t * dentry, 1022 uint32_t size, 1023 error_t * error ) 1024 { 1025 #if DEBUG_RPC_VFS_FS_UPDATE_DENTRY 1026 thread_t * this = CURRENT_THREAD; 1027 uint32_t cycle = (uint32_t)hal_get_cycles(); 1028 if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY ) 1029 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1030 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1031 #endif 1032 1033 uint32_t responses = 1; 1034 1035 // initialise RPC descriptor header 1036 rpc_desc_t rpc; 1037 rpc.index = RPC_VFS_FS_UPDATE_DENTRY; 1038 rpc.blocking = true; 1039 rpc.rsp = &responses; 1040 1041 // set input arguments in RPC descriptor 1042 rpc.args[0] = (uint64_t)(intptr_t)inode; 1043 rpc.args[1] = (uint64_t)(intptr_t)dentry; 1044 rpc.args[2] = (uint64_t)size; 1045 1046 // register RPC request in remote RPC fifo 1047 rpc_send( cxy , &rpc ); 1048 1049 // get output values from RPC descriptor 1050 *error = (error_t)rpc.args[3]; 1051 1052 #if DEBUG_RPC_VFS_FS_UPDATE_DENTRY 1053 cycle = (uint32_t)hal_get_cycles(); 1054 if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY ) 1055 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1056 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1057 #endif 1058 } 1059 1060 ///////////////////////////////////////////////// 1061 void rpc_vfs_fs_update_dentry_server( xptr_t xp ) 1062 { 1063 #if DEBUG_RPC_VFS_FS_UPDATE_DENTRY 1064 thread_t * this = CURRENT_THREAD; 1065 uint32_t cycle = (uint32_t)hal_get_cycles(); 1066 if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY ) 1067 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1068 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1069 #endif 1070 1071 error_t error; 1072 vfs_inode_t * inode; 1073 vfs_dentry_t * dentry; 1074 uint32_t size; 1075 1076 // get client cluster identifier and pointer on RPC descriptor 1077 cxy_t client_cxy = GET_CXY( xp ); 1078 rpc_desc_t * desc = GET_PTR( xp ); 1079 1080 // get input arguments 1081 inode = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0])); 1082 dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1])); 1083 size = (uint32_t) hal_remote_l64(XPTR(client_cxy , &desc->args[2])); 1084 1085 // call the kernel function 1086 error = vfs_fs_update_dentry( inode , dentry , size ); 1087 1088 // set output argument 1089 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error ); 1090 1091 #if DEBUG_RPC_VFS_FS_UPDATE_DENTRY 1092 cycle = (uint32_t)hal_get_cycles(); 1093 if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY ) 1094 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1095 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1096 #endif 1097 } 1018 1098 1019 1099 ///////////////////////////////////////////////////////////////////////////////////////// … … 1110 1190 void rpc_vfs_inode_create_client( cxy_t cxy, 1111 1191 uint32_t fs_type, // in 1112 uint32_t inode_type, // in1113 1192 uint32_t attr, // in 1114 1193 uint32_t rights, // in … … 1136 1215 // set input arguments in RPC descriptor 1137 1216 rpc.args[0] = (uint64_t)fs_type; 1138 rpc.args[1] = (uint64_t)inode_type; 1139 rpc.args[2] = (uint64_t)attr; 1140 rpc.args[3] = (uint64_t)rights; 1141 rpc.args[4] = (uint64_t)uid; 1142 rpc.args[5] = (uint64_t)gid; 1217 rpc.args[1] = (uint64_t)attr; 1218 rpc.args[2] = (uint64_t)rights; 1219 rpc.args[3] = (uint64_t)uid; 1220 rpc.args[4] = (uint64_t)gid; 1143 1221 1144 1222 // register RPC request in remote RPC fifo … … 1146 1224 1147 1225 // get output values from RPC descriptor 1148 *inode_xp = (xptr_t)rpc.args[ 6];1149 *error = (error_t)rpc.args[ 7];1226 *inode_xp = (xptr_t)rpc.args[5]; 1227 *error = (error_t)rpc.args[6]; 1150 1228 1151 1229 #if DEBUG_RPC_VFS_INODE_CREATE … … 1169 1247 1170 1248 uint32_t fs_type; 1171 uint32_t inode_type;1172 1249 uint32_t attr; 1173 1250 uint32_t rights; … … 1183 1260 // get input arguments from client rpc descriptor 1184 1261 fs_type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1185 inode_type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1186 attr = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 1187 rights = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 1188 uid = (uid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 1189 gid = (gid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) ); 1262 attr = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1263 rights = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 1264 uid = (uid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 1265 gid = (gid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 1190 1266 1191 1267 // call local kernel function 1192 1268 error = vfs_inode_create( fs_type, 1193 inode_type,1194 1269 attr, 1195 1270 rights, … … 1199 1274 1200 1275 // set output arguments 1201 hal_remote_s64( XPTR( client_cxy , &desc->args[ 6] ) , (uint64_t)inode_xp );1202 hal_remote_s64( XPTR( client_cxy , &desc->args[ 7] ) , (uint64_t)error );1276 hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)inode_xp ); 1277 hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error ); 1203 1278 1204 1279 #if DEBUG_RPC_VFS_INODE_CREATE … … 1601 1676 1602 1677 ///////////////////////////////////////////////////////// 1603 void rpc_vfs_fs_ get_dentry_client( cxy_t cxy,1678 void rpc_vfs_fs_new_dentry_client( cxy_t cxy, 1604 1679 vfs_inode_t * parent_inode, // in 1605 1680 char * name, // in … … 1643 1718 1644 1719 ////////////////////////////////////////////// 1645 void rpc_vfs_fs_ get_dentry_server( xptr_t xp )1720 void rpc_vfs_fs_new_dentry_server( xptr_t xp ) 1646 1721 { 1647 1722 #if DEBUG_RPC_VFS_FS_GET_DENTRY … … 1674 1749 1675 1750 // call the kernel function 1676 error = vfs_fs_ get_dentry( parent , name_copy , child_xp );1751 error = vfs_fs_new_dentry( parent , name_copy , child_xp ); 1677 1752 1678 1753 // set output argument … … 2245 2320 2246 2321 ///////////////////////////////////////////////////////////////////////////////////////// 2247 // [24] undefined slot 2248 ///////////////////////////////////////////////////////////////////////////////////////// 2322 // [25] Marshaling functions attached to RPC_MAPPER_SYNC 2323 ///////////////////////////////////////////////////////////////////////////////////////// 2324 2325 /////////////////////////////////////////////////// 2326 void rpc_mapper_sync_client( cxy_t cxy, 2327 struct mapper_s * mapper, 2328 error_t * error ) 2329 { 2330 #if DEBUG_RPC_MAPPER_SYNC 2331 thread_t * this = CURRENT_THREAD; 2332 uint32_t cycle = (uint32_t)hal_get_cycles(); 2333 if( cycle > DEBUG_RPC_MAPPER_SYNC ) 2334 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2335 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2336 #endif 2337 2338 uint32_t responses = 1; 2339 2340 // initialise RPC descriptor header 2341 rpc_desc_t rpc; 2342 rpc.index = RPC_MAPPER_SYNC; 2343 rpc.blocking = true; 2344 rpc.rsp = &responses; 2345 2346 // set input arguments in RPC descriptor 2347 rpc.args[0] = (uint64_t)(intptr_t)mapper; 2348 2349 // register RPC request in remote RPC fifo 2350 rpc_send( cxy , &rpc ); 2351 2352 // get output values from RPC descriptor 2353 *error = (error_t)rpc.args[1]; 2354 2355 #if DEBUG_RPC_MAPPER_SYNC 2356 cycle = (uint32_t)hal_get_cycles(); 2357 if( cycle > DEBUG_RPC_MAPPER_SYNC ) 2358 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2359 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2360 #endif 2361 } 2362 2363 //////////////////////////////////////// 2364 void rpc_mapper_sync_server( xptr_t xp ) 2365 { 2366 #if DEBUG_RPC_MAPPER_SYNC 2367 thread_t * this = CURRENT_THREAD; 2368 uint32_t cycle = (uint32_t)hal_get_cycles(); 2369 if( cycle > DEBUG_RPC_MAPPER_SYNC ) 2370 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2371 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2372 #endif 2373 2374 mapper_t * mapper; 2375 error_t error; 2376 2377 // get client cluster identifier and pointer on RPC descriptor 2378 cxy_t client_cxy = GET_CXY( xp ); 2379 rpc_desc_t * desc = GET_PTR( xp ); 2380 2381 // get arguments from client RPC descriptor 2382 mapper = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 2383 2384 // call local kernel function 2385 error = mapper_sync( mapper ); 2386 2387 // set output argument to client RPC descriptor 2388 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 2389 2390 #if DEBUG_RPC_MAPPER_SYNC 2391 cycle = (uint32_t)hal_get_cycles(); 2392 if( cycle > DEBUG_RPC_MAPPER_SYNC ) 2393 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2394 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2395 #endif 2396 } 2249 2397 2250 2398 ///////////////////////////////////////////////////////////////////////////////////////// -
trunk/kernel/kern/rpc.h
r619 r623 68 68 RPC_THREAD_USER_CREATE = 6, 69 69 RPC_THREAD_KERNEL_CREATE = 7, 70 RPC_ UNDEFINED_8= 8,70 RPC_VFS_FS_UPDATE_DENTRY = 8, 71 71 RPC_PROCESS_SIGACTION = 9, 72 72 … … 86 86 RPC_KCM_ALLOC = 22, 87 87 RPC_KCM_FREE = 23, 88 RPC_ UNDEFINED_24= 24,88 RPC_MAPPER_SYNC = 24, 89 89 RPC_MAPPER_HANDLE_MISS = 25, 90 90 RPC_VMM_DELETE_VSEG = 26, … … 305 305 306 306 /*********************************************************************************** 307 * [8] undefined slot 308 **********************************************************************************/ 309 310 /*********************************************************************************** 311 * [9] The RPC_PROCESS_SIGACTION allows any client thread to request to any cluster 312 * execute a given sigaction, defined by the <action_type> for a given process, 307 * [8] The RPC_VFS_FS_UPDATE_DENTRY allows a client thread to request a remote 308 * cluster to update the <size> field of a directory entry in the mapper of a 309 * remote directory inode, identified by the <inode> local pointer. 310 * The target entry name is identified by the <dentry> local pointer. 311 *********************************************************************************** 312 * @ cxy : server cluster identifier. 313 * @ inode : [in] local pointer on remote directory inode. 314 * @ dentry : [in] local pointer on remote dentry. 315 * @ size : [in] new size value. 316 * @ error : [out] error status (0 if success). 317 **********************************************************************************/ 318 void rpc_vfs_fs_update_dentry_client( cxy_t cxy, 319 struct vfs_inode_s * inode, 320 struct vfs_dentry_s * dentry, 321 uint32_t size, 322 error_t * error ); 323 324 void rpc_vfs_fs_update_dentry_server( xptr_t xp ); 325 326 /*********************************************************************************** 327 * [9] The RPC_PROCESS_SIGACTION allows a client thread to request a remote cluster 328 * to execute a given sigaction, defined by the <action_type> for a given process, 313 329 * identified by the <pid> argument. 314 330 *********************************************************************************** … … 340 356 void rpc_vfs_inode_create_client( cxy_t cxy, 341 357 uint32_t fs_type, 342 uint32_t inode_type,343 358 uint32_t attr, 344 359 uint32_t rights, … … 423 438 424 439 /*********************************************************************************** 425 * [16] The RPC_VFS_FS_GET_DENTRY calls the vfs_fs_ get_dentry()440 * [16] The RPC_VFS_FS_GET_DENTRY calls the vfs_fs_new_dentry() 426 441 * function in a remote cluster containing a parent inode directory to scan the 427 442 * associated mapper, find a directory entry identified by its name, and update … … 434 449 * @ error : [out] error status (0 if success). 435 450 **********************************************************************************/ 436 void rpc_vfs_fs_ get_dentry_client( cxy_t cxy,451 void rpc_vfs_fs_new_dentry_client( cxy_t cxy, 437 452 struct vfs_inode_s * parent_inode, 438 453 char * name, … … 440 455 error_t * error ); 441 456 442 void rpc_vfs_fs_ get_dentry_server( xptr_t xp );457 void rpc_vfs_fs_new_dentry_server( xptr_t xp ); 443 458 444 459 /*********************************************************************************** … … 564 579 565 580 /*********************************************************************************** 566 * [24] undefined slot 567 **********************************************************************************/ 581 * [24] The RPC_MAPPER_SYNC allows a client thread to synchronize on disk 582 * all dirty pages of a remote mapper. 583 *********************************************************************************** 584 * @ cxy : server cluster identifier. 585 * @ mapper : [in] local pointer on mapper in server cluster. 586 * @ error : [out] error status (0 if success). 587 **********************************************************************************/ 588 void rpc_mapper_sync_client( cxy_t cxy, 589 struct mapper_s * mapper, 590 error_t * error ); 591 592 void rpc_mapper_sync_server( xptr_t xp ); 568 593 569 594 /*********************************************************************************** -
trunk/kernel/kern/thread.c
r620 r623 1382 1382 const char * string ) 1383 1383 { 1384 1384 1385 cxy_t thread_cxy = GET_CXY( thread_xp ); 1385 1386 thread_t * thread_ptr = GET_PTR( thread_xp ); 1386 1387 1387 #if ( DEBUG_BUSYLOCK )1388 1389 xptr_t iter_xp;1390 1391 // get relevant info from target t rhead descriptor1388 #if DEBUG_BUSYLOCK 1389 1390 xptr_t iter_xp; 1391 1392 // get relevant info from target thread descriptor 1392 1393 uint32_t locks = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->busylocks ) ); 1393 1394 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) ); … … 1429 1430 remote_busylock_release( txt0_lock_xp ); 1430 1431 1432 #else 1433 1434 printk("\n[ERROR] in %s : set DEBUG_BUSYLOCK in kernel_config.h for %s / thread(%x,%x)\n", 1435 __FUNCTION__, string, thread_cxy, thread_ptr ); 1436 1437 #endif 1438 1431 1439 return; 1432 1440 1433 #endif1434 1435 // display a warning1436 printk("\n[WARNING] set DEBUG_BUSYLOCK in kernel_config.h to display busylocks" );1437 1438 1441 } // end thread_display_busylock() 1439 1442
Note: See TracChangeset
for help on using the changeset viewer.