powerpc: Dynamically allocate pacas
[linux-2.6-block.git] / arch / powerpc / kernel / prom.c
index 43c78d74ddcb92ff04d7cf69cacd35f012fcc3f2..05131d634e7395c6ba4d9599a4f7b68734fe174d 100644 (file)
@@ -43,6 +43,7 @@
 #include <asm/smp.h>
 #include <asm/system.h>
 #include <asm/mmu.h>
+#include <asm/paca.h>
 #include <asm/pgtable.h>
 #include <asm/pci.h>
 #include <asm/iommu.h>
@@ -67,11 +68,6 @@ int __initdata iommu_force_on;
 unsigned long tce_alloc_start, tce_alloc_end;
 #endif
 
-extern rwlock_t devtree_lock;  /* temporary while merging */
-
-/* export that to outside world */
-struct device_node *of_chosen;
-
 static int __init early_parse_mem(char *p)
 {
        if (!p)
@@ -510,6 +506,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
        memstart_addr = min((u64)memstart_addr, base);
 }
 
+u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
+{
+       return lmb_alloc(size, align);
+}
+
 #ifdef CONFIG_BLK_DEV_INITRD
 void __init early_init_dt_setup_initrd_arch(unsigned long start,
                unsigned long end)
@@ -721,6 +722,8 @@ void __init early_init_devtree(void *params)
         * FIXME .. and the initrd too? */
        move_device_tree();
 
+       allocate_pacas();
+
        DBG("Scanning CPUs ...\n");
 
        /* Retreive CPU related informations from the flat tree