Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151168
b: refs/heads/master
c: 0c243ad
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jun 16, 2009
1 parent 4fe9271 commit e3e9edf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 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: 73fffc037e2383a0ed126d57bdcda9b369769ae8
refs/heads/master: 0c243ad81f234672bebb72cf3dd014b9c841781d
22 changes: 6 additions & 16 deletions trunk/arch/sparc/kernel/smp_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1373,27 +1373,17 @@ void smp_send_stop(void)

void __init setup_per_cpu_areas(void)
{
unsigned long base, shift, goal, size, i;
unsigned long size, i, nr_possible_cpus = num_possible_cpus();
char *ptr;

/* Copy section for each CPU (we discard the original) */
goal = PERCPU_ENOUGH_ROOM;
size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
ptr = alloc_bootmem_pages(size * nr_possible_cpus);

shift = PAGE_SHIFT;
for (size = PAGE_SIZE; size < goal; size <<= 1UL)
shift++;

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

base = ptr - __per_cpu_start;

for (i = 0; i < NR_CPUS; i++, ptr += size) {
__per_cpu_offset(i) = base + (i * size);
for_each_possible_cpu(i) {
__per_cpu_offset(i) = ptr - __per_cpu_start;
memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
ptr += size;
}

/* Setup %g5 for the boot cpu. */
Expand Down

0 comments on commit e3e9edf

Please sign in to comment.