aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-04-01 19:15:20 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-16 07:56:23 -0400
commit73fffc037e2383a0ed126d57bdcda9b369769ae8 (patch)
tree9099954565aac8e2ea1b0e040662d6ca14844027 /arch
parentb696fdc259f0d94348a9327bed352fac44d4883d (diff)
sparc64: Get rid of real_setup_per_cpu_areas().
Now that we defer the cpu_data() initializations to the end of per-cpu setup, we can get rid of this local hack we had to setup the per-cpu areas eary. This is a necessary step in order to support HAVE_DYNAMIC_PER_CPU_AREA since the per-cpu setup must run when page structs are available. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/percpu_64.h4
-rw-r--r--arch/sparc/kernel/smp_64.c11
-rw-r--r--arch/sparc/mm/init_64.c7
3 files changed, 5 insertions, 17 deletions
diff --git a/arch/sparc/include/asm/percpu_64.h b/arch/sparc/include/asm/percpu_64.h
index c0ab102d11f6..007aafb4ae97 100644
--- a/arch/sparc/include/asm/percpu_64.h
+++ b/arch/sparc/include/asm/percpu_64.h
@@ -9,8 +9,6 @@ register unsigned long __local_per_cpu_offset asm("g5");
9 9
10#include <asm/trap_block.h> 10#include <asm/trap_block.h>
11 11
12extern void real_setup_per_cpu_areas(void);
13
14#define __per_cpu_offset(__cpu) \ 12#define __per_cpu_offset(__cpu) \
15 (trap_block[(__cpu)].__per_cpu_base) 13 (trap_block[(__cpu)].__per_cpu_base)
16#define per_cpu_offset(x) (__per_cpu_offset(x)) 14#define per_cpu_offset(x) (__per_cpu_offset(x))
@@ -19,8 +17,6 @@ extern void real_setup_per_cpu_areas(void);
19 17
20#else /* ! SMP */ 18#else /* ! SMP */
21 19
22#define real_setup_per_cpu_areas() do { } while (0)
23
24#endif /* SMP */ 20#endif /* SMP */
25 21
26#include <asm-generic/percpu.h> 22#include <asm-generic/percpu.h>
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 045fbb554a9c..5302344e3cb4 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -20,7 +20,7 @@
20#include <linux/cache.h> 20#include <linux/cache.h>
21#include <linux/jiffies.h> 21#include <linux/jiffies.h>
22#include <linux/profile.h> 22#include <linux/profile.h>
23#include <linux/lmb.h> 23#include <linux/bootmem.h>
24#include <linux/cpu.h> 24#include <linux/cpu.h>
25 25
26#include <asm/head.h> 26#include <asm/head.h>
@@ -1371,9 +1371,9 @@ void smp_send_stop(void)
1371{ 1371{
1372} 1372}
1373 1373
1374void __init real_setup_per_cpu_areas(void) 1374void __init setup_per_cpu_areas(void)
1375{ 1375{
1376 unsigned long base, shift, paddr, goal, size, i; 1376 unsigned long base, shift, goal, size, i;
1377 char *ptr; 1377 char *ptr;
1378 1378
1379 /* Copy section for each CPU (we discard the original) */ 1379 /* Copy section for each CPU (we discard the original) */
@@ -1383,13 +1383,12 @@ void __init real_setup_per_cpu_areas(void)
1383 for (size = PAGE_SIZE; size < goal; size <<= 1UL) 1383 for (size = PAGE_SIZE; size < goal; size <<= 1UL)
1384 shift++; 1384 shift++;
1385 1385
1386 paddr = lmb_alloc(size * NR_CPUS, PAGE_SIZE); 1386 ptr = __alloc_bootmem(size * NR_CPUS, PAGE_SIZE, 0);
1387 if (!paddr) { 1387 if (!ptr) {
1388 prom_printf("Cannot allocate per-cpu memory.\n"); 1388 prom_printf("Cannot allocate per-cpu memory.\n");
1389 prom_halt(); 1389 prom_halt();
1390 } 1390 }
1391 1391
1392 ptr = __va(paddr);
1393 base = ptr - __per_cpu_start; 1392 base = ptr - __per_cpu_start;
1394 1393
1395 for (i = 0; i < NR_CPUS; i++, ptr += size) { 1394 for (i = 0; i < NR_CPUS; i++, ptr += size) {
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 785f0a24fcbf..b5a5932def77 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -1679,11 +1679,6 @@ pgd_t swapper_pg_dir[2048];
1679static void sun4u_pgprot_init(void); 1679static void sun4u_pgprot_init(void);
1680static void sun4v_pgprot_init(void); 1680static void sun4v_pgprot_init(void);
1681 1681
1682/* Dummy function */
1683void __init setup_per_cpu_areas(void)
1684{
1685}
1686
1687void __init paging_init(void) 1682void __init paging_init(void)
1688{ 1683{
1689 unsigned long end_pfn, shift, phys_base; 1684 unsigned long end_pfn, shift, phys_base;
@@ -1807,8 +1802,6 @@ void __init paging_init(void)
1807 mdesc_populate_present_mask(CPU_MASK_ALL_PTR); 1802 mdesc_populate_present_mask(CPU_MASK_ALL_PTR);
1808 } 1803 }
1809 1804
1810 real_setup_per_cpu_areas();
1811
1812 /* Once the OF device tree and MDESC have been setup, we know 1805 /* Once the OF device tree and MDESC have been setup, we know
1813 * the list of possible cpus. Therefore we can allocate the 1806 * the list of possible cpus. Therefore we can allocate the
1814 * IRQ stacks. 1807 * IRQ stacks.