Changeset 221c9ec in mainline for kernel/generic/src/main/kinit.c
- Timestamp:
- 2012-01-27T23:01:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9970a5a, babb57e
- Parents:
- 1ccd0aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
r1ccd0aa r221c9ec 205 205 * Create virtual memory mappings for init task images. 206 206 */ 207 size_t size = ALIGN_UP(init.tasks[i].size, PAGE_SIZE); 208 size_t offs; 209 uintptr_t page = km_page_alloc(size, PAGE_SIZE); 210 uintptr_t frame = init.tasks[i].paddr; 211 212 page_table_lock(AS_KERNEL, true); 213 for (offs = 0; offs < size; offs += PAGE_SIZE) { 214 page_mapping_insert(AS_KERNEL, page + offs, 215 frame + offs, 216 PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE | 217 PAGE_PRESENT); 218 } 219 page_table_unlock(AS_KERNEL, true); 207 uintptr_t page = km_map(init.tasks[i].paddr, 208 init.tasks[i].size, 209 PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE); 210 ASSERT(page); 220 211 221 212 int rc = program_create_from_image((void *) page, namebuf, … … 243 234 * Assume the last task is the RAM disk. 244 235 */ 245 init_rd((void *) frame, init.tasks[i].size);236 init_rd((void *) init.tasks[i].paddr, init.tasks[i].size); 246 237 } else 247 238 printf("init[%zu]: Init binary load failed (error %d)\n", i, rc);
Note:
See TracChangeset
for help on using the changeset viewer.