Changes in boot/arch/arm32/src/main.c [7cd15b9:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/main.c
r7cd15b9 r9d58539 50 50 #define TOP2ADDR(top) (((void *) PA2KA(BOOT_OFFSET)) + (top)) 51 51 52 extern void *bdata_start;53 extern void *bdata_end;54 55 static inline void clean_dcache_poc(void *address, size_t size)56 {57 const uintptr_t addr = (uintptr_t)address;58 for (uintptr_t a = addr; a < addr + size; a += 4) {59 /* DCCMVAC - clean by address to the point of coherence */60 asm volatile ("mcr p15, 0, %[a], c7, c10, 1\n" :: [a]"r"(a) : );61 }62 }63 64 52 static bootinfo_t bootinfo; 65 53 66 54 void bootstrap(void) 67 55 { 68 /* Enable MMU and caches */69 56 mmu_start(); 70 57 version_print(); 71 58 72 printf("Boot data: %p -> %p\n", &bdata_start, &bdata_end);73 59 printf("\nMemory statistics\n"); 74 60 printf(" %p|%p: bootstrap stack\n", &boot_stack, &boot_stack); … … 78 64 (void *) PA2KA(BOOT_OFFSET), (void *) BOOT_OFFSET); 79 65 80 for (size_t i = 0; i < COMPONENTS; i++) { 66 size_t i; 67 for (i = 0; i < COMPONENTS; i++) 81 68 printf(" %p|%p: %s image (%u/%u bytes)\n", components[i].start, 82 69 components[i].start, components[i].name, components[i].inflated, 83 70 components[i].size); 84 }85 71 86 72 void *dest[COMPONENTS]; … … 88 74 size_t cnt = 0; 89 75 bootinfo.cnt = 0; 90 for ( size_ti = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) {76 for (i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) { 91 77 top = ALIGN_UP(top, PAGE_SIZE); 92 78 … … 108 94 printf("\nInflating components ... "); 109 95 110 for ( size_ti = cnt; i > 0; i--) {96 for (i = cnt; i > 0; i--) { 111 97 void *tail = components[i - 1].start + components[i - 1].size; 112 98 if (tail >= dest[i - 1]) { … … 120 106 int err = inflate(components[i - 1].start, components[i - 1].size, 121 107 dest[i - 1], components[i - 1].inflated); 108 122 109 if (err != EOK) { 123 110 printf("\n%s: Inflating error %d\n", components[i - 1].name, err); 124 111 halt(); 125 112 } 126 /* Make sure data are in the memory, ICache will need them */127 clean_dcache_poc(dest[i - 1], components[i - 1].inflated);128 113 } 129 114 130 115 printf(".\n"); 131 132 /* Flush PT too. We need this if we disable caches later */133 clean_dcache_poc(boot_pt, PTL0_ENTRIES * PTL0_ENTRY_SIZE);134 116 135 printf("Booting the kernel... \n");117 printf("Booting the kernel... \n"); 136 118 jump_to_kernel((void *) PA2KA(BOOT_OFFSET), &bootinfo); 137 119 }
Note:
See TracChangeset
for help on using the changeset viewer.