Changes in kernel/genarch/src/mm/as_pt.c [f18d01b6:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/mm/as_pt.c
rf18d01b6 r9d58539 73 73 pte_t *ptl0_create(unsigned int flags) 74 74 { 75 pte_t *dst_ptl0 = (pte_t *) 76 PA2KA(frame_alloc(PTL0_FRAMES, FRAME_LOWMEM, PTL0_SIZE - 1)); 75 pte_t *dst_ptl0 = (pte_t *) frame_alloc(PTL0_SIZE, 76 FRAME_LOWMEM | FRAME_KA); 77 size_t table_size = FRAME_SIZE << PTL0_SIZE; 77 78 78 79 if (flags & FLAG_AS_KERNEL) 79 memsetb(dst_ptl0, PTL0_SIZE, 0);80 memsetb(dst_ptl0, table_size, 0); 80 81 else { 81 82 /* 82 83 * Copy the kernel address space portion to new PTL0. 84 * 83 85 */ 84 86 … … 93 95 &dst_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)]; 94 96 95 memsetb(dst_ptl0, PTL0_SIZE, 0);97 memsetb(dst_ptl0, table_size, 0); 96 98 memcpy((void *) dst, (void *) src, 97 PTL0_SIZE- (src - (uintptr_t) src_ptl0));99 table_size - (src - (uintptr_t) src_ptl0)); 98 100 99 101 mutex_unlock(&AS_KERNEL->lock); … … 112 114 void ptl0_destroy(pte_t *page_table) 113 115 { 114 frame_free((uintptr_t) page_table , PTL0_FRAMES);116 frame_free((uintptr_t) page_table); 115 117 } 116 118
Note:
See TracChangeset
for help on using the changeset viewer.