aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-03-31 20:15:40 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-16 07:56:08 -0400
commit557fe0e8842e919aeacedeb5f35444c78232b3c8 (patch)
treeb4fa66fe8a6fde3433fb618eb59f90f46860cfb7 /arch
parent03347e2592078a90df818670fddf97a33eec70fb (diff)
sparc64: Reclaim trap_block[]->hdesc
This really isn't necessary at all, a local variable suits the job just fine. This frees up 8 bytes in the trap_block[] that we can use later to store the per-cpu base addresses. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/cpudata_64.h2
-rw-r--r--arch/sparc/kernel/smp_64.c14
2 files changed, 7 insertions, 9 deletions
diff --git a/arch/sparc/include/asm/cpudata_64.h b/arch/sparc/include/asm/cpudata_64.h
index a11b89ee9ef8..c58d87b3314f 100644
--- a/arch/sparc/include/asm/cpudata_64.h
+++ b/arch/sparc/include/asm/cpudata_64.h
@@ -80,7 +80,7 @@ struct trap_per_cpu {
80 unsigned int dev_mondo_qmask; 80 unsigned int dev_mondo_qmask;
81 unsigned int resum_qmask; 81 unsigned int resum_qmask;
82 unsigned int nonresum_qmask; 82 unsigned int nonresum_qmask;
83 void *hdesc; 83 unsigned long __unused;
84} __attribute__((aligned(64))); 84} __attribute__((aligned(64)));
85extern struct trap_per_cpu trap_block[NR_CPUS]; 85extern struct trap_per_cpu trap_block[NR_CPUS];
86extern void init_cur_cpu_trap(struct thread_info *); 86extern void init_cur_cpu_trap(struct thread_info *);
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index f7642e5a94db..4226d0ebaea5 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -278,7 +278,7 @@ static unsigned long kimage_addr_to_ra(void *p)
278 return kern_base + (val - KERNBASE); 278 return kern_base + (val - KERNBASE);
279} 279}
280 280
281static void __cpuinit ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg) 281static void __cpuinit ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg, void **descrp)
282{ 282{
283 extern unsigned long sparc64_ttable_tl0; 283 extern unsigned long sparc64_ttable_tl0;
284 extern unsigned long kern_locked_tte_data; 284 extern unsigned long kern_locked_tte_data;
@@ -298,12 +298,12 @@ static void __cpuinit ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread
298 "hvtramp_descr.\n"); 298 "hvtramp_descr.\n");
299 return; 299 return;
300 } 300 }
301 *descrp = hdesc;
301 302
302 hdesc->cpu = cpu; 303 hdesc->cpu = cpu;
303 hdesc->num_mappings = num_kernel_image_mappings; 304 hdesc->num_mappings = num_kernel_image_mappings;
304 305
305 tb = &trap_block[cpu]; 306 tb = &trap_block[cpu];
306 tb->hdesc = hdesc;
307 307
308 hdesc->fault_info_va = (unsigned long) &tb->fault_info; 308 hdesc->fault_info_va = (unsigned long) &tb->fault_info;
309 hdesc->fault_info_pa = kimage_addr_to_ra(&tb->fault_info); 309 hdesc->fault_info_pa = kimage_addr_to_ra(&tb->fault_info);
@@ -341,12 +341,12 @@ static struct thread_info *cpu_new_thread = NULL;
341 341
342static int __cpuinit smp_boot_one_cpu(unsigned int cpu) 342static int __cpuinit smp_boot_one_cpu(unsigned int cpu)
343{ 343{
344 struct trap_per_cpu *tb = &trap_block[cpu];
345 unsigned long entry = 344 unsigned long entry =
346 (unsigned long)(&sparc64_cpu_startup); 345 (unsigned long)(&sparc64_cpu_startup);
347 unsigned long cookie = 346 unsigned long cookie =
348 (unsigned long)(&cpu_new_thread); 347 (unsigned long)(&cpu_new_thread);
349 struct task_struct *p; 348 struct task_struct *p;
349 void *descr = NULL;
350 int timeout, ret; 350 int timeout, ret;
351 351
352 p = fork_idle(cpu); 352 p = fork_idle(cpu);
@@ -359,7 +359,8 @@ static int __cpuinit smp_boot_one_cpu(unsigned int cpu)
359#if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU) 359#if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU)
360 if (ldom_domaining_enabled) 360 if (ldom_domaining_enabled)
361 ldom_startcpu_cpuid(cpu, 361 ldom_startcpu_cpuid(cpu,
362 (unsigned long) cpu_new_thread); 362 (unsigned long) cpu_new_thread,
363 &descr);
363 else 364 else
364#endif 365#endif
365 prom_startcpu_cpuid(cpu, entry, cookie); 366 prom_startcpu_cpuid(cpu, entry, cookie);
@@ -383,10 +384,7 @@ static int __cpuinit smp_boot_one_cpu(unsigned int cpu)
383 } 384 }
384 cpu_new_thread = NULL; 385 cpu_new_thread = NULL;
385 386
386 if (tb->hdesc) { 387 kfree(descr);
387 kfree(tb->hdesc);
388 tb->hdesc = NULL;
389 }
390 388
391 return ret; 389 return ret;
392} 390}