Changeset 625 for trunk/hal/tsar_mips32/core/hal_gpt.c
- Timestamp:
- Apr 10, 2019, 10:09:39 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/core/hal_gpt.c
r624 r625 823 823 /////////////////////////////////////////// 824 824 error_t hal_gpt_pte_copy( gpt_t * dst_gpt, 825 vpn_t dst_vpn, 825 826 xptr_t src_gpt_xp, 826 vpn_t vpn,827 vpn_t src_vpn, 827 828 bool_t cow, 828 829 ppn_t * ppn, 829 830 bool_t * mapped ) 830 831 { 831 uint32_t ix1; // index in PT1 832 uint32_t ix2; // index in PT2 832 uint32_t src_ix1; // index in SRC PT1 833 uint32_t src_ix2; // index in SRC PT2 834 835 uint32_t dst_ix1; // index in DST PT1 836 uint32_t dst_ix2; // index in DST PT2 833 837 834 838 cxy_t src_cxy; // SRC GPT cluster … … 862 866 thread_t * this = CURRENT_THREAD; 863 867 if( DEBUG_HAL_GPT_COPY < cycle ) 864 printk("\n[%s] : thread[%x,%x] enter / vpn %x /src_cxy %x / dst_cxy %x / cycle %d\n",865 __FUNCTION__, this->process->pid, this->trdid, vpn,src_cxy, local_cxy, cycle );868 printk("\n[%s] : thread[%x,%x] enter / src_cxy %x / dst_cxy %x / cycle %d\n", 869 __FUNCTION__, this->process->pid, this->trdid, src_cxy, local_cxy, cycle ); 866 870 #endif 867 871 … … 878 882 assert( (dst_pt1 != NULL) , "dst_pt1 does not exist\n"); 879 883 880 ix1 = TSAR_MMU_IX1_FROM_VPN( vpn ); 881 ix2 = TSAR_MMU_IX2_FROM_VPN( vpn ); 884 // compute SRC indexes 885 src_ix1 = TSAR_MMU_IX1_FROM_VPN( src_vpn ); 886 src_ix2 = TSAR_MMU_IX2_FROM_VPN( src_vpn ); 887 888 // compute DST indexes 889 dst_ix1 = TSAR_MMU_IX1_FROM_VPN( dst_vpn ); 890 dst_ix2 = TSAR_MMU_IX2_FROM_VPN( dst_vpn ); 882 891 883 892 // get src_pte1 884 src_pte1 = hal_remote_l32( XPTR( src_cxy , &src_pt1[ ix1] ) );893 src_pte1 = hal_remote_l32( XPTR( src_cxy , &src_pt1[src_ix1] ) ); 885 894 886 895 // do nothing if src_pte1 not MAPPED or not SMALL … … 888 897 { 889 898 // get dst_pt1 entry 890 dst_pte1 = dst_pt1[ ix1];899 dst_pte1 = dst_pt1[dst_ix1]; 891 900 892 901 // map dst_pte1 if required … … 915 924 916 925 // register it in DST_GPT 917 dst_pt1[ ix1] = dst_pte1;926 dst_pt1[dst_ix1] = dst_pte1; 918 927 } 919 928 … … 927 936 928 937 // get attr and ppn from SRC_PT2 929 src_pte2_attr = hal_remote_l32( XPTR( src_cxy , &src_pt2[2 * ix2] ) );930 src_pte2_ppn = hal_remote_l32( XPTR( src_cxy , &src_pt2[2 * ix2 + 1] ) );938 src_pte2_attr = hal_remote_l32( XPTR( src_cxy , &src_pt2[2 * src_ix2] ) ); 939 src_pte2_ppn = hal_remote_l32( XPTR( src_cxy , &src_pt2[2 * src_ix2 + 1] ) ); 931 940 932 941 // do nothing if src_pte2 not MAPPED … … 934 943 { 935 944 // set PPN in DST PTE2 936 dst_pt2[2 *ix2+1] = src_pte2_ppn;945 dst_pt2[2 * dst_ix2 + 1] = src_pte2_ppn; 937 946 938 947 // set attributes in DST PTE2 939 948 if( cow && (src_pte2_attr & TSAR_MMU_WRITABLE) ) 940 949 { 941 dst_pt2[2 *ix2] = (src_pte2_attr | TSAR_MMU_COW) & (~TSAR_MMU_WRITABLE);950 dst_pt2[2 * dst_ix2] = (src_pte2_attr | TSAR_MMU_COW) & (~TSAR_MMU_WRITABLE); 942 951 } 943 952 else 944 953 { 945 dst_pt2[2 *ix2] = src_pte2_attr;954 dst_pt2[2 * dst_ix2] = src_pte2_attr; 946 955 } 947 956 … … 953 962 cycle = (uint32_t)hal_get_cycles; 954 963 if( DEBUG_HAL_GPT_COPY < cycle ) 955 printk("\n[%s] : thread[%x,%x] exit / copy done for vpn %x / cycle %d\n",956 __FUNCTION__, this->process->pid, this->trdid, vpn, cycle );964 printk("\n[%s] : thread[%x,%x] exit / copy done for src_vpn %x / dst_vpn %x / cycle %d\n", 965 __FUNCTION__, this->process->pid, this->trdid, src_vpn, dst_vpn, cycle ); 957 966 #endif 958 967 … … 970 979 cycle = (uint32_t)hal_get_cycles; 971 980 if( DEBUG_HAL_GPT_COPY < cycle ) 972 printk("\n[%s] : thread[%x,%x] exit / nothing done for vpn %x/ cycle %d\n",973 __FUNCTION__, this->process->pid, this->trdid, vpn,cycle );981 printk("\n[%s] : thread[%x,%x] exit / nothing done / cycle %d\n", 982 __FUNCTION__, this->process->pid, this->trdid, cycle ); 974 983 #endif 975 984
Note: See TracChangeset
for help on using the changeset viewer.