Changeset a0c12f5 in mainline for kernel/arch/xen32/src/mm/frame.c
- Timestamp:
- 2006-07-25T20:49:39Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 42d3be3
- Parents:
- c59dd1a2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/xen32/src/mm/frame.c
rc59dd1a2 ra0c12f5 53 53 #define L2_PT_SHIFT 0 54 54 55 #define L1_OFFSET_MASK 0x3ff 56 #define L2_OFFSET_MASK 0x3ff 55 #define L1_PT_ENTRIES 1024 56 #define L2_PT_ENTRIES 1024 57 58 #define L1_OFFSET_MASK (L1_PT_ENTRIES - 1) 59 #define L2_OFFSET_MASK (L2_PT_ENTRIES - 1) 57 60 58 61 #define PFN2PTL1_OFFSET(pfn) ((pfn >> L1_PT_SHIFT) & L1_OFFSET_MASK) … … 86 89 /* Create identity mapping */ 87 90 pfn_t phys; 91 count_t count = 0; 88 92 for (phys = start; phys < start + size; phys++) { 89 mmu_update_t updates[ 1];93 mmu_update_t updates[L2_PT_ENTRIES]; 90 94 pfn_t virt = ADDR2PFN(PA2KA(PFN2ADDR(phys))); 91 95 … … 110 114 panic("Unable to find page table reference"); 111 115 112 updates[ 0].ptr = (uintptr_t) &ptl2_base2[ptl2_offset2];113 updates[ 0].val = PFN2ADDR(start_info.mfn_list[start]) | L1_PROT;114 if (xen_mmu_update(updates, 1, NULL, DOMID_SELF) < 0)116 updates[count].ptr = (uintptr_t) &ptl2_base2[ptl2_offset2]; 117 updates[count].val = PFN2ADDR(start_info.mfn_list[start]) | L1_PROT; 118 if (xen_mmu_update(updates, count + 1, NULL, DOMID_SELF) < 0) 115 119 panic("Unable to map new page table"); 120 count = 0; 116 121 117 122 mmu_ext.cmd = MMUEXT_PIN_L1_TABLE; … … 122 127 unsigned long *ptl0 = (unsigned long *) PFN2ADDR(start_info.mfn_list[ADDR2PFN(KA2PA(start_info.pt_base))]); 123 128 124 updates[ 0].ptr = (uintptr_t) &ptl0[ptl1_offset];125 updates[ 0].val = PFN2ADDR(start_info.mfn_list[start]) | L2_PROT;126 if (xen_mmu_update(updates, 1, NULL, DOMID_SELF) < 0)129 updates[count].ptr = (uintptr_t) &ptl0[ptl1_offset]; 130 updates[count].val = PFN2ADDR(start_info.mfn_list[start]) | L2_PROT; 131 if (xen_mmu_update(updates, count + 1, NULL, DOMID_SELF) < 0) 127 132 panic("Unable to update PTE for page table"); 133 count = 0; 128 134 129 135 ptl2_base = (unsigned long *) PTE2ADDR(start_info.pt_base[ptl1_offset]); … … 132 138 } 133 139 134 updates[0].ptr = (uintptr_t) &ptl2_base[ptl2_offset]; 135 updates[0].val = PFN2ADDR(start_info.mfn_list[phys]) | L2_PROT; 136 if (xen_mmu_update(updates, 1, NULL, DOMID_SELF) < 0) 137 panic("Unable to update PTE"); 140 updates[count].ptr = (uintptr_t) &ptl2_base[ptl2_offset]; 141 updates[count].val = PFN2ADDR(start_info.mfn_list[phys]) | L2_PROT; 142 count++; 143 144 if ((count == L2_PT_ENTRIES) || (phys + 1 == start + size)) { 145 if (xen_mmu_update(updates, count, NULL, DOMID_SELF) < 0) 146 panic("Unable to update PTE"); 147 count = 0; 148 } 138 149 } 139 150
Note:
See TracChangeset
for help on using the changeset viewer.