Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91968
b: refs/heads/master
c: b970945
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Apr 24, 2008
1 parent 703b5cc commit e65cd05
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9422273ba7d139537720c8c47514925d9a621e0d
refs/heads/master: b97094560b991af5c62391014e72bfa4c3a3701f
11 changes: 8 additions & 3 deletions trunk/arch/sparc64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/cache.h>
#include <linux/jiffies.h>
#include <linux/profile.h>
#include <linux/bootmem.h>
#include <linux/lmb.h>

#include <asm/head.h>
#include <asm/ptrace.h>
Expand Down Expand Up @@ -1431,7 +1431,7 @@ EXPORT_SYMBOL(__per_cpu_shift);

void __init real_setup_per_cpu_areas(void)
{
unsigned long goal, size, i;
unsigned long paddr, goal, size, i;
char *ptr;

/* Copy section for each CPU (we discard the original) */
Expand All @@ -1441,8 +1441,13 @@ void __init real_setup_per_cpu_areas(void)
for (size = PAGE_SIZE; size < goal; size <<= 1UL)
__per_cpu_shift++;

ptr = alloc_bootmem_pages(size * NR_CPUS);
paddr = lmb_alloc(size * NR_CPUS, PAGE_SIZE);
if (!paddr) {
prom_printf("Cannot allocate per-cpu memory.\n");
prom_halt();
}

ptr = __va(paddr);
__per_cpu_base = ptr - __per_cpu_start;

for (i = 0; i < NR_CPUS; i++, ptr += size)
Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/sparc64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,12 @@ void __init paging_init(void)
if (tlb_type == hypervisor)
sun4v_ktsb_register();

/* We must setup the per-cpu areas before we pull in the
* PROM and the MDESC. The code there fills in cpu and
* other information into per-cpu data structures.
*/
real_setup_per_cpu_areas();

/* Setup bootmem... */
pages_avail = 0;
last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base);
Expand All @@ -1216,8 +1222,6 @@ void __init paging_init(void)

kernel_physical_mapping_init();

real_setup_per_cpu_areas();

prom_build_devicetree();

if (tlb_type == hypervisor)
Expand Down

0 comments on commit e65cd05

Please sign in to comment.