Changeset 246 for soft/giet_vm/sys/vm_handler.c
- Timestamp:
- Jul 9, 2013, 3:54:53 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/vm_handler.c
r238 r246 38 38 39 39 // get ptba and update PT2 40 if ((pt->pt1[ix1] & PTE_V) == 0) { 40 if ((pt->pt1[ix1] & PTE_V) == 0) 41 { 41 42 _puts("\n[GIET ERROR] in iommu_add_pte2 function\n"); 42 43 _puts("the IOMMU PT1 entry is not mapped / ix1 = "); … … 66 67 67 68 // get ptba and inval PTE2 68 if ((pt->pt1[ix1] & PTE_V) == 0) { 69 if ((pt->pt1[ix1] & PTE_V) == 0) 70 { 69 71 _puts("\n[GIET ERROR] in iommu_inval_pte2 function\n"); 70 72 _puts("the IOMMU PT1 entry is not mapped / ix1 = "); … … 85 87 // Returns 0 if success, 1 if PTE1 or PTE2 unmapped 86 88 ////////////////////////////////////////////////////////////////////////////// 87 unsigned int _v2p_translate( page_table_t*pt,88 unsigned intvpn,89 unsigned int* ppn,90 unsigned int* flags)89 unsigned int _v2p_translate(page_table_t * pt, 90 unsigned int vpn, 91 unsigned int * ppn, 92 unsigned int * flags) 91 93 { 92 paddr_t 93 paddr_t 94 paddr_t ptba; 95 paddr_t pte2; 94 96 95 register unsigned int 96 register unsigned int 97 register unsigned int 98 register unsigned int 97 register unsigned int pte2_msb; 98 register unsigned int pte2_lsb; 99 register unsigned int flags_value; 100 register unsigned int ppn_value; 99 101 100 102 unsigned int ix1 = vpn >> 9; … … 102 104 103 105 // check PTE1 mapping 104 if ((pt->pt1[ix1] & PTE_V) == 0) return 1; 106 if ((pt->pt1[ix1] & PTE_V) == 0) 107 { 108 return 1; 109 } 105 110 else 106 111 { 107 112 // get physical addresses of pte2 108 ptba = (paddr_t) (pt->pt1[ix1] & 0x0FFFFFFF) << 12;109 pte2 = ptba + 8 *ix2;110 pte2_lsb = (unsigned int) pte2;111 pte2_msb = (unsigned int) (pte2 >> 32);113 ptba = (paddr_t) (pt->pt1[ix1] & 0x0FFFFFFF) << 12; 114 pte2 = ptba + 8 * ix2; 115 pte2_lsb = (unsigned int) pte2; 116 pte2_msb = (unsigned int) (pte2 >> 32); 112 117 113 118 // gets ppn_value and flags_value, after temporary DTLB desactivation … … 135 140 136 141 // check PTE2 mapping 137 if ((flags_value & PTE_V) == 0) return 1; 142 if ((flags_value & PTE_V) == 0) { 143 return 1; 144 } 138 145 139 146 // set return values
Note: See TracChangeset
for help on using the changeset viewer.