#include <asm/trap_block.h>
-extern void real_setup_per_cpu_areas(void);
-
#define __per_cpu_offset(__cpu) \
(trap_block[(__cpu)].__per_cpu_base)
#define per_cpu_offset(x) (__per_cpu_offset(x))
#else /* ! SMP */
-#define real_setup_per_cpu_areas() do { } while (0)
-
#endif /* SMP */
#include <asm-generic/percpu.h>
#include <linux/cache.h>
#include <linux/jiffies.h>
#include <linux/profile.h>
-#include <linux/lmb.h>
+#include <linux/bootmem.h>
#include <linux/cpu.h>
#include <asm/head.h>
{
}
-void __init real_setup_per_cpu_areas(void)
+void __init setup_per_cpu_areas(void)
{
- unsigned long base, shift, paddr, goal, size, i;
+ unsigned long base, shift, goal, size, i;
char *ptr;
/* Copy section for each CPU (we discard the original) */
for (size = PAGE_SIZE; size < goal; size <<= 1UL)
shift++;
- paddr = lmb_alloc(size * NR_CPUS, PAGE_SIZE);
- if (!paddr) {
+ ptr = __alloc_bootmem(size * NR_CPUS, PAGE_SIZE, 0);
+ if (!ptr) {
prom_printf("Cannot allocate per-cpu memory.\n");
prom_halt();
}
- ptr = __va(paddr);
base = ptr - __per_cpu_start;
for (i = 0; i < NR_CPUS; i++, ptr += size) {
static void sun4u_pgprot_init(void);
static void sun4v_pgprot_init(void);
-/* Dummy function */
-void __init setup_per_cpu_areas(void)
-{
-}
-
void __init paging_init(void)
{
unsigned long end_pfn, shift, phys_base;
mdesc_populate_present_mask(CPU_MASK_ALL_PTR);
}
- real_setup_per_cpu_areas();
-
/* Once the OF device tree and MDESC have been setup, we know
* the list of possible cpus. Therefore we can allocate the
* IRQ stacks.