Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/src/main.c

    r7cd15b9 r9d58539  
    5050#define TOP2ADDR(top)  (((void *) PA2KA(BOOT_OFFSET)) + (top))
    5151
    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 
    6452static bootinfo_t bootinfo;
    6553
    6654void bootstrap(void)
    6755{
    68         /* Enable MMU and caches */
    6956        mmu_start();
    7057        version_print();
    7158       
    72         printf("Boot data: %p -> %p\n", &bdata_start, &bdata_end);
    7359        printf("\nMemory statistics\n");
    7460        printf(" %p|%p: bootstrap stack\n", &boot_stack, &boot_stack);
     
    7864            (void *) PA2KA(BOOT_OFFSET), (void *) BOOT_OFFSET);
    7965       
    80         for (size_t i = 0; i < COMPONENTS; i++) {
     66        size_t i;
     67        for (i = 0; i < COMPONENTS; i++)
    8168                printf(" %p|%p: %s image (%u/%u bytes)\n", components[i].start,
    8269                    components[i].start, components[i].name, components[i].inflated,
    8370                    components[i].size);
    84         }
    8571       
    8672        void *dest[COMPONENTS];
     
    8874        size_t cnt = 0;
    8975        bootinfo.cnt = 0;
    90         for (size_t i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) {
     76        for (i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) {
    9177                top = ALIGN_UP(top, PAGE_SIZE);
    9278               
     
    10894        printf("\nInflating components ... ");
    10995       
    110         for (size_t i = cnt; i > 0; i--) {
     96        for (i = cnt; i > 0; i--) {
    11197                void *tail = components[i - 1].start + components[i - 1].size;
    11298                if (tail >= dest[i - 1]) {
     
    120106                int err = inflate(components[i - 1].start, components[i - 1].size,
    121107                    dest[i - 1], components[i - 1].inflated);
     108               
    122109                if (err != EOK) {
    123110                        printf("\n%s: Inflating error %d\n", components[i - 1].name, err);
    124111                        halt();
    125112                }
    126                 /* Make sure data are in the memory, ICache will need them */
    127                 clean_dcache_poc(dest[i - 1], components[i - 1].inflated);
    128113        }
    129114       
    130115        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);
    134116       
    135         printf("Booting the kernel...\n");
     117        printf("Booting the kernel... \n");
    136118        jump_to_kernel((void *) PA2KA(BOOT_OFFSET), &bootinfo);
    137119}
Note: See TracChangeset for help on using the changeset viewer.