armv5: Added condition when adding free phys regions.
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Fri, 5 Dec 2014 13:09:07 +0000 (14:09 +0100)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Fri, 5 Dec 2014 13:09:07 +0000 (14:09 +0100)
kernel/arch/armv5/init.c
kernel/arch/armv5/startup_arch.c

index 31cc002..2a33d26 100644 (file)
@@ -228,9 +228,11 @@ void arch_init(uint32_t     board_id,
         // Kernel effectively consumes [0...alloc_top]
         // Add region above alloc_top with care to skip exception vector
         // page.
-        phys_mmap_add(&phys_mmap,
-                      alloc_top - KERNEL_OFFSET,
-                      ETABLE_ADDR - KERNEL_OFFSET);
+        if (alloc_top < ETABLE_ADDR) {
+            phys_mmap_add(&phys_mmap,
+                          alloc_top - KERNEL_OFFSET,
+                          ETABLE_ADDR - KERNEL_OFFSET);
+        }
 
         phys_mmap_add(&phys_mmap,
                       ETABLE_ADDR - KERNEL_OFFSET + BASE_PAGE_SIZE,
index 78df015..8a62809 100644 (file)
@@ -519,6 +519,7 @@ spawn_init(const char*      name,
     STARTUP_PROGRESS();
 
     create_modules_from_initrd(bootinfo, initrd_base, initrd_bytes);
+    debug(SUBSYS_STARTUP, "used %d slots in modulecn\n", spawn_state.modulecn_slot);
 
     STARTUP_PROGRESS();
     create_phys_caps(&spawn_state.physaddrcn->cap, bootinfo);