aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/lparcfg.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2010-08-12 16:18:15 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-09-02 00:07:31 -0400
commit8154c5d22d91cd16bd9985b0638c8957e4688d0e (patch)
tree3f86ef67c9242a585f08a1220d3113718b438869 /arch/powerpc/kernel/lparcfg.c
parente1f0ece113fe028593b6869fe191a991322c5d85 (diff)
powerpc: Abstract indexing of lppaca structs
Currently we have the lppaca structs as a simple array of NR_CPUS entries, taking up space in the data section of the kernel image. In future we would like to allocate them dynamically, so this abstracts out the accesses to the array, making it easier to change how we locate the lppaca for a given cpu in future. Specifically, lppaca[cpu] changes to lppaca_of(cpu). Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/lparcfg.c')
-rw-r--r--arch/powerpc/kernel/lparcfg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 50362b6ef6e9..8d9e3b9cda64 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -56,7 +56,7 @@ static unsigned long get_purr(void)
56 56
57 for_each_possible_cpu(cpu) { 57 for_each_possible_cpu(cpu) {
58 if (firmware_has_feature(FW_FEATURE_ISERIES)) 58 if (firmware_has_feature(FW_FEATURE_ISERIES))
59 sum_purr += lppaca[cpu].emulated_time_base; 59 sum_purr += lppaca_of(cpu).emulated_time_base;
60 else { 60 else {
61 struct cpu_usage *cu; 61 struct cpu_usage *cu;
62 62
@@ -263,7 +263,7 @@ static void parse_ppp_data(struct seq_file *m)
263 ppp_data.active_system_procs); 263 ppp_data.active_system_procs);
264 264
265 /* pool related entries are apropriate for shared configs */ 265 /* pool related entries are apropriate for shared configs */
266 if (lppaca[0].shared_proc) { 266 if (lppaca_of(0).shared_proc) {
267 unsigned long pool_idle_time, pool_procs; 267 unsigned long pool_idle_time, pool_procs;
268 268
269 seq_printf(m, "pool=%d\n", ppp_data.pool_num); 269 seq_printf(m, "pool=%d\n", ppp_data.pool_num);
@@ -460,8 +460,8 @@ static void pseries_cmo_data(struct seq_file *m)
460 return; 460 return;
461 461
462 for_each_possible_cpu(cpu) { 462 for_each_possible_cpu(cpu) {
463 cmo_faults += lppaca[cpu].cmo_faults; 463 cmo_faults += lppaca_of(cpu).cmo_faults;
464 cmo_fault_time += lppaca[cpu].cmo_fault_time; 464 cmo_fault_time += lppaca_of(cpu).cmo_fault_time;
465 } 465 }
466 466
467 seq_printf(m, "cmo_faults=%lu\n", cmo_faults); 467 seq_printf(m, "cmo_faults=%lu\n", cmo_faults);
@@ -479,8 +479,8 @@ static void splpar_dispatch_data(struct seq_file *m)
479 unsigned long dispatch_dispersions = 0; 479 unsigned long dispatch_dispersions = 0;
480 480
481 for_each_possible_cpu(cpu) { 481 for_each_possible_cpu(cpu) {
482 dispatches += lppaca[cpu].yield_count; 482 dispatches += lppaca_of(cpu).yield_count;
483 dispatch_dispersions += lppaca[cpu].dispersion_count; 483 dispatch_dispersions += lppaca_of(cpu).dispersion_count;
484 } 484 }
485 485
486 seq_printf(m, "dispatches=%lu\n", dispatches); 486 seq_printf(m, "dispatches=%lu\n", dispatches);
@@ -545,7 +545,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
545 seq_printf(m, "partition_potential_processors=%d\n", 545 seq_printf(m, "partition_potential_processors=%d\n",
546 partition_potential_processors); 546 partition_potential_processors);
547 547
548 seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc); 548 seq_printf(m, "shared_processor_mode=%d\n", lppaca_of(0).shared_proc);
549 549
550 seq_printf(m, "slb_size=%d\n", mmu_slb_size); 550 seq_printf(m, "slb_size=%d\n", mmu_slb_size);
551 551