T121: kernel: fix BSP KCB creation on x86_32 and armv5
authorMoritz Hoffmann <moritz.hoffmann@inf.ethz.ch>
Wed, 17 Jun 2015 14:06:37 +0000 (16:06 +0200)
committerMoritz Hoffmann <moritz.hoffmann@inf.ethz.ch>
Wed, 17 Jun 2015 14:06:37 +0000 (16:06 +0200)
Signed-off-by: Moritz Hoffmann <moritz.hoffmann@inf.ethz.ch>

kernel/arch/armv5/startup_arch.c
kernel/arch/x86_32/init.c

index a553d80..10d116a 100644 (file)
@@ -25,6 +25,7 @@
 #include <phys_mmap.h>
 #include <barrelfish_kpi/paging_arm_v5.h>
 #include <startup.h>
+#include <kcb.h>
 
 #define CNODE(cte)              (cte)->cap.u.cnode.cnode
 #define UNUSED(x)               (x) = (x)
@@ -577,7 +578,7 @@ void arm_kernel_startup(phys_mmap_t* mmap,
     }
 
     /* allocate initial KCB */
-    kcb_current = (struct kcb *) local_phys_to_mem(bsp_alloc_phys(sizeof(*kcb_current)));
+    kcb_current = (struct kcb *) local_phys_to_mem(alloc_phys(sizeof(*kcb_current)));
     memset(kcb_current, 0, sizeof(*kcb_current));
     assert(kcb_current);
 
index b8e6971..adc6761 100644 (file)
@@ -766,10 +766,6 @@ void arch_init(uint32_t magic, void *pointer)
         break;
     }
 
-    if (kcb_current == NULL) {
-        panic("Did not receive a valid KCB.");
-    }
-
     if(magic != KERNEL_BOOT_MAGIC) {
         // Construct the global structure and store its address to retrive it
         // across relocation