Changeset d1a184f in mainline for arch/ia32/src/mm/page.c
- Timestamp:
- 2005-06-03T19:37:31Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d47f0e1
- Parents:
- 673104e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/mm/page.c
r673104e rd1a184f 65 65 */ 66 66 for (i = 1; i < frames; i++) { 67 map_page_to_frame(i * PAGE_SIZE, i * PAGE_SIZE, PAGE_CACHEABLE, 0);68 map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, 0);67 map_page_to_frame(i * PAGE_SIZE, i * PAGE_SIZE, PAGE_CACHEABLE, dba); 68 map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, dba); 69 69 } 70 70 … … 95 95 * care of it and allocate the necessary frame. 96 96 * 97 * When the copy parameter is positive, map_page_to_frame will not overwrite98 * the current mapping. It will allocate a new frame and do the mapping on it99 * instead.100 *101 97 * PAGE_CACHEABLE flag: when set, it turns caches for that page on 102 98 * PAGE_NOT_PRESENT flag: when set, it marks the page not present 103 99 * PAGE_USER flag: when set, the page is accessible from userspace 100 * 101 * When the root parameter is non-zero, it is used as the page directory address. 102 * Otherwise, the page directory address is read from CPU. 104 103 */ 105 void map_page_to_frame(__address page, __address frame, int flags, int copy)104 void map_page_to_frame(__address page, __address frame, int flags, __address root) 106 105 { 107 106 struct page_specifier *pd, *pt; … … 109 108 int pde, pte; 110 109 111 // TODO: map_page_to_frame should take dba as a parameter 112 // dba = cpu_read_dba(); 113 dba = bootstrap_dba; 110 if (root) dba = root; 111 else dba = cpu_read_dba(); 114 112 115 113 pde = page >> 22; /* page directory entry */ … … 129 127 pd[pde].uaccessible = 1; 130 128 } 131 if (copy) {132 newpt = frame_alloc(FRAME_KA);133 memcopy(pd[pde].frame_address << 12, newpt, PAGE_SIZE);134 pd[pde].frame_address = KA2PA(newpt) >> 12;135 }136 129 137 130 pt = (struct page_specifier *) (pd[pde].frame_address << 12);
Note:
See TracChangeset
for help on using the changeset viewer.