Changeset 32817cc in mainline
- Timestamp:
- 2012-01-25T22:59:35Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4dee0cb
- Parents:
- 7943c43
- Location:
- kernel
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/arm32.c
r7943c43 r32817cc 58 58 size_t i; 59 59 for (i = 0; i < init.cnt; i++) { 60 init.tasks[i]. addr = (uintptr_t) bootinfo->tasks[i].addr;60 init.tasks[i].paddr = KA2PA(bootinfo->tasks[i].addr); 61 61 init.tasks[i].size = bootinfo->tasks[i].size; 62 62 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, -
kernel/arch/ia64/src/ia64.c
r7943c43 r32817cc 69 69 void arch_pre_main(void) 70 70 { 71 init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); 71 init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, 72 CONFIG_INIT_TASKS); 72 73 size_t i; 74 73 75 for (i = 0; i < init.cnt; i++) { 74 init.tasks[i].addr = 75 ((unsigned long) bootinfo->taskmap.tasks[i].addr) | 76 VRN_MASK; 76 init.tasks[i].paddr = 77 (uintptr_t) bootinfo->taskmap.tasks[i].addr; 77 78 init.tasks[i].size = bootinfo->taskmap.tasks[i].size; 78 79 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, -
kernel/arch/mips32/src/mips32.c
r7943c43 r32817cc 78 78 size_t i; 79 79 for (i = 0; i < init.cnt; i++) { 80 init.tasks[i]. addr = (uintptr_t) bootinfo->tasks[i].addr;80 init.tasks[i].paddr = KA2PA(bootinfo->tasks[i].addr); 81 81 init.tasks[i].size = bootinfo->tasks[i].size; 82 82 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, -
kernel/arch/mips32/src/mm/frame.c
r7943c43 r32817cc 123 123 for (i = 0; i < init.cnt; i++) 124 124 if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE, 125 KA2PA(init.tasks[i].addr), init.tasks[i].size)) {125 init.tasks[i].paddr, init.tasks[i].size)) { 126 126 safe = false; 127 127 break; -
kernel/arch/ppc32/src/ppc32.c
r7943c43 r32817cc 71 71 size_t i; 72 72 for (i = 0; i < init.cnt; i++) { 73 init.tasks[i]. addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr;73 init.tasks[i].paddr = KA2PA(bootinfo->taskmap.tasks[i].addr); 74 74 init.tasks[i].size = bootinfo->taskmap.tasks[i].size; 75 75 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, -
kernel/arch/sparc64/src/sun4u/sparc64.c
r7943c43 r32817cc 62 62 size_t i; 63 63 for (i = 0; i < init.cnt; i++) { 64 init.tasks[i]. addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr;64 init.tasks[i].paddr = KA2PA(bootinfo->taskmap.tasks[i].addr); 65 65 init.tasks[i].size = bootinfo->taskmap.tasks[i].size; 66 66 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, -
kernel/arch/sparc64/src/sun4v/sparc64.c
r7943c43 r32817cc 64 64 size_t i; 65 65 for (i = 0; i < init.cnt; i++) { 66 init.tasks[i]. addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr;66 init.tasks[i].paddr = KA2PA(bootinfo->taskmap.tasks[i].addr); 67 67 init.tasks[i].size = bootinfo->taskmap.tasks[i].size; 68 68 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, -
kernel/genarch/src/multiboot/multiboot.c
r7943c43 r32817cc 77 77 break; 78 78 79 init.tasks[init.cnt]. addr = PA2KA(mods[i].start);79 init.tasks[init.cnt].paddr = mods[i].start; 80 80 init.tasks[init.cnt].size = mods[i].end - mods[i].start; 81 81 -
kernel/genarch/src/multiboot/multiboot2.c
r7943c43 r32817cc 45 45 { 46 46 if (init.cnt < CONFIG_INIT_TASKS) { 47 init.tasks[init.cnt]. addr = PA2KA(module->start);47 init.tasks[init.cnt].paddr = module->start; 48 48 init.tasks[init.cnt].size = module->end - module->start; 49 49 multiboot_extract_command(init.tasks[init.cnt].name, -
kernel/generic/include/config.h
r7943c43 r32817cc 53 53 54 54 typedef struct { 55 uintptr_t addr;55 uintptr_t paddr; 56 56 size_t size; 57 57 char name[CONFIG_TASK_NAME_BUFLEN]; -
kernel/generic/src/lib/rd.c
r7943c43 r32817cc 54 54 void init_rd(void *data, size_t size) 55 55 { 56 uintptr_t base = KA2PA((uintptr_t) data);56 uintptr_t base = (uintptr_t) data; 57 57 ASSERT((base % FRAME_SIZE) == 0); 58 58 -
kernel/generic/src/main/kinit.c
r7943c43 r32817cc 57 57 #include <mm/as.h> 58 58 #include <mm/frame.h> 59 #include <mm/km.h> 59 60 #include <print.h> 60 61 #include <memstr.h> … … 68 69 #include <str.h> 69 70 #include <sysinfo/stats.h> 71 #include <align.h> 70 72 71 73 #ifdef CONFIG_SMP … … 178 180 179 181 for (i = 0; i < init.cnt; i++) { 180 if (init.tasks[i]. addr % FRAME_SIZE) {182 if (init.tasks[i].paddr % FRAME_SIZE) { 181 183 printf("init[%zu]: Address is not frame aligned\n", i); 182 184 programs[i].task = NULL; … … 199 201 str_cpy(namebuf + INIT_PREFIX_LEN, 200 202 TASK_NAME_BUFLEN - INIT_PREFIX_LEN, name); 201 202 int rc = program_create_from_image((void *) init.tasks[i].addr, 203 namebuf, &programs[i]); 203 204 /* 205 * Create virtual memory mappings for init task images. 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); 220 221 int rc = program_create_from_image((void *) page, namebuf, 222 &programs[i]); 204 223 205 224 if (rc == 0) { … … 224 243 * Assume the last task is the RAM disk. 225 244 */ 226 init_rd((void *) init.tasks[i].addr, init.tasks[i].size);245 init_rd((void *) frame, init.tasks[i].size); 227 246 } else 228 247 printf("init[%zu]: Init binary load failed (error %d)\n", i, rc); -
kernel/generic/src/main/main.c
r7943c43 r32817cc 151 151 size_t i; 152 152 for (i = 0; i < init.cnt; i++) { 153 if (PA_OVERLAPS(config.stack_base, config.stack_size, 154 init.tasks[i].addr, init.tasks[i].size)) 155 config.stack_base = ALIGN_UP(init.tasks[i].addr + 156 init.tasks[i].size, config.stack_size); 153 if (overlaps(KA2PA(config.stack_base), config.stack_size, 154 init.tasks[i].paddr, init.tasks[i].size)) { 155 /* 156 * The init task overlaps with the memory behind the 157 * kernel image so it must be in low memory and we can 158 * use PA2KA on the init task's physical address. 159 */ 160 config.stack_base = ALIGN_UP( 161 PA2KA(init.tasks[i].paddr) + init.tasks[i].size, 162 config.stack_size); 163 } 157 164 } 158 165 -
kernel/generic/src/mm/backend_elf.c
r7943c43 r32817cc 318 318 dirty = true; 319 319 } else { 320 frame = KA2PA(base + i * FRAME_SIZE); 320 pte_t *pte = page_mapping_find(AS_KERNEL, 321 base + i * FRAME_SIZE, true); 322 323 ASSERT(pte); 324 ASSERT(PTE_PRESENT(pte)); 325 326 frame = PTE_GET_FRAME(pte); 321 327 } 322 328 } else if (upage >= start_anon) { -
kernel/generic/src/mm/frame.c
r7943c43 r32817cc 924 924 for (i = 0; i < init.cnt; i++) 925 925 if (overlaps(addr, PFN2ADDR(confcount), 926 KA2PA(init.tasks[i].addr),926 init.tasks[i].paddr, 927 927 init.tasks[i].size)) { 928 928 overlap = true; … … 1251 1251 size_t i; 1252 1252 for (i = 0; i < init.cnt; i++) { 1253 pfn_t pfn = ADDR2PFN( KA2PA(init.tasks[i].addr));1253 pfn_t pfn = ADDR2PFN(init.tasks[i].paddr); 1254 1254 frame_mark_unavailable(pfn, 1255 1255 SIZE2FRAMES(init.tasks[i].size));
Note:
See TracChangeset
for help on using the changeset viewer.