Changeset 296 for trunk/kernel/kern/rpc.c
- Timestamp:
- Jul 31, 2017, 1:59:52 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/rpc.c
r279 r296 99 99 uint32_t * ppn ) // out 100 100 { 101 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");102 103 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);101 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 102 103 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 104 104 105 105 // initialise RPC descriptor header … … 118 118 *ppn = (uint32_t)rpc.args[1]; 119 119 120 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);120 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 121 121 } 122 122 … … 127 127 error_t error; // output 128 128 uint32_t ppn; // output 129 130 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 129 131 130 132 // get client cluster identifier and pointer on RPC descriptor … … 143 145 hal_remote_sw( XPTR( cxy , &desc->args[0] ) , error ); 144 146 hal_remote_sw( XPTR( cxy , &desc->args[1] ) , ppn ); 147 148 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 145 149 } 146 150 … … 155 159 pid_t * pid ) // out 156 160 { 157 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");158 159 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);161 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 162 163 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 160 164 161 165 // initialise RPC descriptor header … … 174 178 *error = (error_t)rpc.args[2]; 175 179 176 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);180 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 177 181 } 178 182 … … 183 187 error_t error; // output : error status 184 188 pid_t pid; // output : process identifier 189 190 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 185 191 186 192 // get client cluster identifier and pointer on RPC descriptor … … 198 204 hal_remote_sw( XPTR( client_cxy , &desc->args[0] ) , (uint64_t)error ); 199 205 hal_remote_sw( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)pid ); 206 207 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 200 208 } 201 209 … … 210 218 error_t * error ) // out 211 219 { 212 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");213 214 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);220 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 221 222 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 215 223 216 224 // initialise RPC descriptor header … … 228 236 *error = (error_t)rpc.args[1]; 229 237 230 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);238 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 231 239 } 232 240 … … 237 245 exec_info_t info; // local copy of exec_info structure 238 246 error_t error; // local error error status 247 248 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 239 249 240 250 // get client cluster identifier and pointer on RPC descriptor … … 255 265 // set output argument into client RPC descriptor 256 266 hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 267 268 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 257 269 } 258 270 … … 265 277 void rpc_process_kill_client( process_t * process ) 266 278 { 279 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 280 267 281 // only reference cluster can send this RPC 268 282 assert( (GET_CXY( process->ref_xp ) == local_cxy) , __FUNCTION__ , 269 283 "caller must be reference process cluster\n"); 270 271 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__ );272 284 273 285 // get local process index in reference cluster … … 297 309 } 298 310 299 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);311 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 300 312 } 301 313 … … 305 317 pid_t pid; 306 318 process_t * process; 319 320 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 307 321 308 322 // get client cluster identifier and pointer on RPC descriptor … … 325 339 process_kill( process ); 326 340 } 341 342 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 327 343 } 328 344 … … 341 357 error_t * error ) // out 342 358 { 343 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");344 345 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);359 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 360 361 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 346 362 347 363 // initialise RPC descriptor header … … 363 379 *error = (error_t)rpc.args[5]; 364 380 365 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);381 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 366 382 } 367 383 … … 378 394 void * start_arg; 379 395 error_t error; 396 397 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 380 398 381 399 // get client cluster identifier and pointer on RPC descriptor … … 409 427 hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 410 428 hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp ); 429 430 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 411 431 } 412 432 … … 423 443 error_t * error ) // out 424 444 { 425 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");426 427 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);445 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 446 447 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 428 448 429 449 // initialise RPC descriptor header … … 444 464 *error = (error_t)rpc.args[4]; 445 465 446 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);466 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 447 467 } 448 468 … … 455 475 error_t error; 456 476 477 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 478 457 479 // get client cluster identifier and pointer on RPC descriptor 458 480 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 474 496 hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 475 497 hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp ); 498 499 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 476 500 } 477 501 … … 485 509 uint32_t sig_id ) // in 486 510 { 487 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");488 489 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);511 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 512 513 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 490 514 491 515 // initialise RPC descriptor header … … 501 525 rpc_send_sync( cxy , &rpc ); 502 526 503 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);527 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 504 528 } 505 529 … … 509 533 process_t * process; // local pointer on process descriptor 510 534 uint32_t sig_id; // signal index 535 536 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 511 537 512 538 // get client cluster identifier and pointer on RPC descriptor … … 520 546 // call local kernel function 521 547 signal_rise( process , sig_id ); 548 549 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 522 550 } 523 551 … … 539 567 error_t * error ) // out 540 568 { 541 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");542 543 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);569 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 570 571 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 544 572 545 573 // initialise RPC descriptor header … … 565 593 *error = (error_t)rpc.args[9]; 566 594 567 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);595 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 568 596 } 569 597 … … 582 610 error_t error; 583 611 612 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 613 584 614 // get client cluster identifier and pointer on RPC descriptor 585 615 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 610 640 hal_remote_swd( XPTR( client_cxy , &desc->args[8] ) , (uint64_t)inode_xp ); 611 641 hal_remote_swd( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error ); 642 643 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 612 644 } 613 645 … … 620 652 struct vfs_inode_s * inode ) 621 653 { 622 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");623 624 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);654 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 655 656 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 625 657 626 658 // initialise RPC descriptor header … … 635 667 rpc_send_sync( cxy , &rpc ); 636 668 637 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);669 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 638 670 } 639 671 … … 642 674 { 643 675 vfs_inode_t * inode; 676 677 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 644 678 645 679 // get client cluster identifier and pointer on RPC descriptor … … 652 686 // call local kernel function 653 687 vfs_inode_destroy( inode ); 688 689 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 654 690 } 655 691 … … 666 702 error_t * error ) // out 667 703 { 668 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");669 670 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);704 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 705 706 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 671 707 672 708 // initialise RPC descriptor header … … 687 723 *error = (error_t)rpc.args[4]; 688 724 689 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);725 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 690 726 } 691 727 … … 701 737 char name_copy[CONFIG_VFS_MAX_NAME_LENGTH]; 702 738 739 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 740 703 741 // get client cluster identifier and pointer on RPC descriptor 704 742 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 709 747 name = (char *)(intptr_t) hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) ); 710 748 parent = (vfs_inode_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) ); 711 749 712 750 // makes a local copy of name 713 751 hal_remote_strcpy( XPTR( local_cxy , name_copy ), … … 719 757 parent, 720 758 &dentry_xp ); 721 722 759 // set output arguments 723 760 hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)dentry_xp ); 724 761 hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error ); 762 763 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 725 764 } 726 765 … … 728 767 // [13] Marshaling functions attached to RPC_VFS_DENTRY_DESTROY 729 768 ///////////////////////////////////////////////////////////////////////////////////////// 769 730 770 731 771 /////////////////////////////////////////////////////// … … 733 773 vfs_dentry_t * dentry ) 734 774 { 735 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");736 737 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);775 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 776 777 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 738 778 739 779 // initialise RPC descriptor header … … 748 788 rpc_send_sync( cxy , &rpc ); 749 789 750 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);790 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 751 791 } 752 792 … … 755 795 { 756 796 vfs_dentry_t * dentry; 797 798 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 757 799 758 800 // get client cluster identifier and pointer on RPC descriptor … … 765 807 // call local kernel function 766 808 vfs_dentry_destroy( dentry ); 809 810 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 767 811 } 768 812 … … 779 823 error_t * error ) // out 780 824 { 781 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");782 783 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);825 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 826 827 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 784 828 785 829 // initialise RPC descriptor header … … 799 843 *error = (error_t)rpc.args[3]; 800 844 801 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);845 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 802 846 } 803 847 … … 809 853 xptr_t file_xp; 810 854 error_t error; 855 856 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 811 857 812 858 // get client cluster identifier and pointer on RPC descriptor … … 826 872 hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)file_xp ); 827 873 hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error ); 874 875 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 828 876 } 829 877 … … 836 884 vfs_file_t * file ) 837 885 { 838 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");839 840 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);886 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 887 888 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 841 889 842 890 // initialise RPC descriptor header … … 851 899 rpc_send_sync( cxy , &rpc ); 852 900 853 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);901 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 854 902 } 855 903 … … 858 906 { 859 907 vfs_file_t * file; 908 909 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 860 910 861 911 // get client cluster identifier and pointer on RPC descriptor … … 868 918 // call local kernel function 869 919 vfs_file_destroy( file ); 920 921 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 870 922 } 871 923 … … 881 933 error_t * error ) // out 882 934 { 883 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");884 885 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);935 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 936 937 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 886 938 887 939 // initialise RPC descriptor header … … 901 953 *error = (error_t)rpc.args[3]; 902 954 903 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);955 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 904 956 } 905 957 … … 914 966 char name_copy[CONFIG_VFS_MAX_NAME_LENGTH]; 915 967 968 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 969 916 970 // get client cluster identifier and pointer on RPC descriptor 917 971 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 932 986 // set output argument 933 987 hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error ); 988 989 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 934 990 } 935 991 … … 943 999 error_t * error ) // out 944 1000 { 945 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");946 947 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);1001 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1002 1003 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 948 1004 949 1005 // initialise RPC descriptor header … … 961 1017 *error = (error_t)rpc.args[1]; 962 1018 963 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);1019 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 964 1020 } 965 1021 … … 970 1026 vfs_inode_t * inode; 971 1027 1028 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1029 972 1030 // get client cluster identifier and pointer on RPC descriptor 973 1031 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 982 1040 // set output argument 983 1041 hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error ); 1042 1043 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 984 1044 } 985 1045 … … 996 1056 error_t * error ) // out 997 1057 { 998 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");999 1000 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);1058 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1059 1060 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1001 1061 1002 1062 // initialise RPC descriptor header … … 1017 1077 *error = (error_t)rpc.args[4]; 1018 1078 1019 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);1079 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1020 1080 } 1021 1081 … … 1029 1089 error_t error; 1030 1090 1091 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1092 1031 1093 // get client cluster identifier and pointer on RPC descriptor 1032 1094 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 1044 1106 hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)cluster ); 1045 1107 hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error ); 1108 1109 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1046 1110 } 1047 1111 … … 1056 1120 xptr_t * vseg_xp ) // out 1057 1121 { 1058 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");1059 1060 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);1122 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1123 1124 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1061 1125 1062 1126 // initialise RPC descriptor header … … 1075 1139 *vseg_xp = rpc.args[2]; 1076 1140 1077 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);1141 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1078 1142 } 1079 1143 … … 1085 1149 vseg_t * vseg_ptr; 1086 1150 xptr_t vseg_xp; 1151 1152 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1087 1153 1088 1154 // get client cluster identifier and pointer on RPC descriptor … … 1101 1167 else vseg_xp = XPTR( local_cxy , vseg_ptr ); 1102 1168 hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp ); 1169 1170 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1103 1171 } 1104 1172 … … 1116 1184 error_t * error ) // out 1117 1185 { 1118 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");1119 1120 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);1186 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1187 1188 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1121 1189 1122 1190 // initialise RPC descriptor header … … 1137 1205 *error = (error_t)rpc.args[4]; 1138 1206 1139 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);1207 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1140 1208 } 1141 1209 … … 1148 1216 ppn_t ppn; 1149 1217 error_t error; 1218 1219 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1150 1220 1151 1221 // get client cluster identifier and pointer on RPC descriptor … … 1164 1234 hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)ppn ); 1165 1235 hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error ); 1236 1237 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1166 1238 } 1167 1239 … … 1175 1247 xptr_t * buf_xp ) // out 1176 1248 { 1177 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");1178 1179 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);1249 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1250 1251 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1180 1252 1181 1253 // initialise RPC descriptor header … … 1193 1265 *buf_xp = (xptr_t)rpc.args[1]; 1194 1266 1195 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);1267 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1196 1268 } 1197 1269 … … 1199 1271 void rpc_kcm_alloc_server( xptr_t xp ) 1200 1272 { 1273 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1274 1201 1275 // get client cluster identifier and pointer on RPC descriptor 1202 1276 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 1215 1289 xptr_t buf_xp = XPTR( local_cxy , buf_ptr ); 1216 1290 hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp ); 1291 1292 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1217 1293 } 1218 1294 … … 1226 1302 uint32_t kmem_type ) // in 1227 1303 { 1228 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");1229 1230 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);1304 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1305 1306 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1231 1307 1232 1308 // initialise RPC descriptor header … … 1242 1318 rpc_send_sync( cxy , &rpc ); 1243 1319 1244 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);1320 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1245 1321 } 1246 1322 … … 1248 1324 void rpc_kcm_free_server( xptr_t xp ) 1249 1325 { 1326 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1327 1250 1328 // get client cluster identifier and pointer on RPC descriptor 1251 1329 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 1261 1339 req.ptr = buf; 1262 1340 kmem_free( &req ); 1341 1342 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1263 1343 } 1264 1344 … … 1277 1357 error_t * error ) // out 1278 1358 { 1279 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");1280 1281 rpc_dmsg("\n[INFO] %s : enter\n", __FUNCTION__);1359 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1360 1361 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1282 1362 1283 1363 // initialise RPC descriptor header … … 1300 1380 *error = (error_t)rpc.args[6]; 1301 1381 1302 rpc_dmsg("\n[INFO] %s : completed \n", __FUNCTION__);1382 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1303 1383 } 1304 1384 … … 1314 1394 error_t error; 1315 1395 1396 rpc_dmsg("\n[INFO] %s : enter at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1397 1316 1398 // get client cluster identifier and pointer on RPC descriptor 1317 1399 cxy_t client_cxy = (cxy_t)GET_CXY( xp ); … … 1336 1418 // set output argument to client RPC descriptor 1337 1419 hal_remote_swd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error ); 1420 1421 rpc_dmsg("\n[INFO] %s : completed at cycle %d\n", __FUNCTION__ , hal_time_stamp() ); 1338 1422 } 1339 1423 … … 1353 1437 thread_t * this = CURRENT_THREAD; 1354 1438 1355 rpc_dmsg("\n[INFO] %s : enter / client_cxy = %x / server_cxy = %x \n",1356 __FUNCTION__ , local_cxy , server_cxy);1439 rpc_dmsg("\n[INFO] %s : enter / client_cxy = %x / server_cxy = %x / cycle %d\n", 1440 __FUNCTION__ , local_cxy , server_cxy , hal_time_stamp() ); 1357 1441 1358 1442 // allocate and initialise an extended pointer on the RPC descriptor … … 1374 1458 { 1375 1459 printk("\n[WARNING] %s : cluster %x cannot post RPC to cluster %x\n", 1376 __FUNCTION__ , local_cxy , server_cxy ); 1377 1378 if( thread_can_yield() ) sched_yield(); 1379 } 1380 else 1381 { 1460 __FUNCTION__ , local_cxy , server_cxy ); 1461 1462 if( thread_can_yield() ) sched_yield( NULL ); 1382 1463 } 1383 1464 } 1384 1465 while( error ); 1385 1466 1386 rpc_dmsg("\n[INFO] %s : RPC registered / client_cxy = %x / server_cxy = %x\n",1387 __FUNCTION__ , local_cxy , server_cxy , first);1467 rpc_dmsg("\n[INFO] %s : RPC %l registered / server_cxy = %x / cycle %d\n", 1468 __FUNCTION__ , desc_xp , server_cxy , hal_time_stamp() ); 1388 1469 1389 1470 // send IPI to remote CP0, if this is the first RPC in remote FIFO, … … 1399 1480 1400 1481 rpc_dmsg("\n[INFO] %s : IPI sent / client_cxy = %x / server_cxy = %x\n", 1401 1482 __FUNCTION__, local_cxy , server_cxy ); 1402 1483 } 1403 1484 } … … 1416 1497 if( this->type == THREAD_RPC ) hal_restore_irq( sr_save ); 1417 1498 1418 rpc_dmsg("\n[INFO] %s : completed / client_cxy = %x / server_cxy = %x \n",1419 __FUNCTION__ , local_cxy , server_cxy);1499 rpc_dmsg("\n[INFO] %s : completed / client_cxy = %x / server_cxy = %x / cycle %d\n", 1500 __FUNCTION__ , local_cxy , server_cxy , hal_time_stamp() ); 1420 1501 1421 1502 } // end rpc_send_sync() … … 1447 1528 error_t error; 1448 1529 1449 this = CURRENT_THREAD; 1450 core = this->core; 1451 1452 1530 this = CURRENT_THREAD; 1531 core = this->core; 1532 count = 0; 1533 1534 rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / fifo = %x / cycle %d\n", 1535 __FUNCTION__, this->trdid, local_cxy, core->lid , hal_time_stamp() ); 1536 1453 1537 // handle up to CONFIG_RPC_PENDING_MAX requests before exit 1454 count = 0;1455 1538 do 1456 1539 { 1457 error = local_fifo_get_item( &rpc_fifo->fifo, 1458 (uint64_t *)&xp ); 1540 error = local_fifo_get_item( &rpc_fifo->fifo, (uint64_t *)&xp ); 1459 1541 1460 1542 if ( error == 0 ) // One RPC request successfully extracted from RPC_FIFO 1461 1543 { 1462 rpc_dmsg("\n[INFO] %s : RPC_THREAD %x on core %x in cluster %x handles RPC %d\n",1463 __FUNCTION__ , this->trdid , core->lid , local_cxy , count );1464 1465 1544 // get client cluster identifier and pointer on RPC descriptor 1466 1545 client_cxy = (cxy_t)GET_CXY( xp ); … … 1468 1547 1469 1548 // get rpc index from RPC descriptor 1470 index = hal_remote_lw( XPTR( client_cxy , &desc->index ) ); 1549 index = hal_remote_lw( XPTR( client_cxy , &desc->index ) ); 1550 1551 rpc_dmsg("\n[INFO] %s : thread %x on core [%x,%d] / index = %d / &rpc = %x\n", 1552 __FUNCTION__ , this->trdid , core->lid , local_cxy , index , rpc_server[index] ); 1471 1553 1472 1554 // call the relevant server function … … 1533 1615 if( found ) // activate this idle RPC thread 1534 1616 { 1617 // unblock it 1535 1618 thread->blocked = 0; 1536 1619 1537 rpc_dmsg("\n[INFO] %s : activate RPC thread %x on core %x in cluster %x atcycle %d\n",1538 __FUNCTION__ , thread , core->gid , local_cxy , hal_ get_cycles() );1620 rpc_dmsg("\n[INFO] %s : activate RPC thread %x on core [%x,%d] / cycle %d\n", 1621 __FUNCTION__ , thread , core->gid , local_cxy , hal_time_stamp() ); 1539 1622 } 1540 1623 else // create a new RPC thread 1541 1624 { 1625 // create new thread 1542 1626 error = thread_kernel_create( &thread, 1543 1627 THREAD_RPC, … … 1553 1637 } 1554 1638 1555 rpc_dmsg("\n[INFO] %s : create RPC thread %x on core %x in cluster %x at cycle %d\n",1556 __FUNCTION__ , thread , core->gid , local_cxy , hal_get_cycles() );1639 // unblock new thread 1640 thread->blocked = 0; 1557 1641 1558 1642 // update core descriptor counter 1559 1643 hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , 1 ); 1644 1645 rpc_dmsg("\n[INFO] %s : create RPC thread %x on core [%x,%d] / cycle %d\n", 1646 __FUNCTION__ , thread->trdid, local_cxy, core->lid, hal_time_stamp() ); 1560 1647 } 1561 1648 … … 1563 1650 rpc_fifo->owner = thread->trdid; 1564 1651 1565 // current thread deschedules / RPC thread start execution1566 sched_ switch_to( thread );1652 // current thread switch to RPC thread 1653 sched_yield( thread ); 1567 1654 1568 1655 // restore IRQs for the calling thread … … 1581 1668 error_t error; 1582 1669 1670 rpc_dmsg("\n[INFO] %s : enter in cluster %x\n", 1671 __FUNCTION__ , local_cxy ); 1672 1583 1673 // calling thread does nothing if light lock already taken or FIFO empty 1584 1674 if( (rpc_fifo->owner != 0) || (local_fifo_is_empty( &rpc_fifo->fifo )) ) 1585 1675 { 1676 rpc_dmsg("\n[INFO] %s : exit but do nothing in cluster %x\n", 1677 __FUNCTION__ , local_cxy ); 1678 1586 1679 return false; 1587 1680 } … … 1601 1694 } 1602 1695 1696 rpc_dmsg("\n[INFO] %s : exit after activating an RPC thread in cluster %x\n", 1697 __FUNCTION__ , local_cxy ); 1698 1603 1699 return true; 1604 1700 } 1605 1701 else // light lock taken by another thread 1606 1702 { 1703 rpc_dmsg("\n[INFO] %s : exit but do nothing in cluster %x\n", 1704 __FUNCTION__ , local_cxy ); 1705 1607 1706 return false; 1608 1707 } … … 1613 1712 void rpc_thread_func() 1614 1713 { 1615 // makes the callingthread not preemptable1714 // makes the RPC thread not preemptable 1616 1715 hal_disable_irq( NULL ); 1617 1716 … … 1619 1718 rpc_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo; 1620 1719 1621 rpc_dmsg("\n[INFO] RPC thread %x created on core %d in cluster %x atcycle %d\n",1622 this->trdid , this->core->lid , local_cxy , hal_get_cycles() );1720 rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n", 1721 __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() ); 1623 1722 1624 1723 // this infinite loop is not preemptable … … 1629 1728 if( this->trdid != rpc_fifo->owner ) 1630 1729 { 1631 printk("\n[PANIC] in %s : RPC_THREAD %x not owner of RPC_FIFO in cluster %x\n",1632 __FUNCTION__ , this->trdid , local_cxy);1730 printk("\n[PANIC] in %s : thread %x on core[%x,%d] not owner of RPC_FIFO\n", 1731 __FUNCTION__, this->trdid, local_cxy, this->core->lid ); 1633 1732 hal_core_sleep(); 1634 1733 } … … 1644 1743 if( LOCAL_CLUSTER->rpc_threads >= CONFIG_RPC_THREADS_MAX ) 1645 1744 { 1646 rpc_dmsg("\n[INFO] RPC thread %x suicide on core %d in cluster %x atcycle %d\n",1647 this->trdid , this->core->lid , local_cxy , hal_get_cycles() );1745 rpc_dmsg("\n[INFO] thread %x on core[%x,%d] suicide / cycle %d\n", 1746 __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() ); 1648 1747 1649 1748 // update core descriptor counter … … 1655 1754 else 1656 1755 { 1657 rpc_dmsg("\n[INFO] RPC thread %x blocks on core %d in cluster %x atcycle %d\n",1658 this->trdid , this->core->lid , local_cxy , hal_get_cycles() );1659 1660 1661 sched_yield();1662 1663 rpc_dmsg("\n[INFO] RPC thread %x wake up on core %d in cluster %x atcycle %d\n",1664 this->trdid , this->core->lid , local_cxy , hal_get_cycles() );1756 rpc_dmsg("\n[INFO] %s : thread %x on core[%x,%d] blocks / cycle %d\n", 1757 __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() ); 1758 1759 thread_block( this , THREAD_BLOCKED_IDLE ); 1760 sched_yield( NULL ); 1761 1762 rpc_dmsg("\n[INFO] RPC thread %x wake up on core[%x,%d] / cycle %d\n", 1763 __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() ); 1665 1764 } 1666 1765 } // end while
Note: See TracChangeset
for help on using the changeset viewer.