aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2005-07-10 18:45:11 -0400
committerDavid S. Miller <davem@davemloft.net>2005-07-10 18:45:11 -0400
commitd369ddd2fc00fc3f46e9052d1017cbf407e3cdf7 (patch)
treee7c91ce6639064462cb831dd0c48b9b93cad68d4
parent9126dfde9e5efd76f9d4246819bdc7ea66de3af0 (diff)
[SPARC64]: Add __read_mostly support.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc64/kernel/smp.c10
-rw-r--r--arch/sparc64/kernel/time.c24
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S2
-rw-r--r--include/linux/cache.h2
4 files changed, 17 insertions, 21 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index e5b9c7a27789..441fc2e52ce6 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -45,8 +45,8 @@ extern void calibrate_delay(void);
45/* Please don't make this stuff initdata!!! --DaveM */ 45/* Please don't make this stuff initdata!!! --DaveM */
46static unsigned char boot_cpu_id; 46static unsigned char boot_cpu_id;
47 47
48cpumask_t cpu_online_map = CPU_MASK_NONE; 48cpumask_t cpu_online_map = CPU_MASK_NONE __read_mostly;
49cpumask_t phys_cpu_present_map = CPU_MASK_NONE; 49cpumask_t phys_cpu_present_map = CPU_MASK_NONE __read_mostly;
50static cpumask_t smp_commenced_mask; 50static cpumask_t smp_commenced_mask;
51static cpumask_t cpu_callout_map; 51static cpumask_t cpu_callout_map;
52 52
@@ -155,7 +155,7 @@ void cpu_panic(void)
155 panic("SMP bolixed\n"); 155 panic("SMP bolixed\n");
156} 156}
157 157
158static unsigned long current_tick_offset; 158static unsigned long current_tick_offset __read_mostly;
159 159
160/* This tick register synchronization scheme is taken entirely from 160/* This tick register synchronization scheme is taken entirely from
161 * the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit. 161 * the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit.
@@ -1193,8 +1193,8 @@ void smp_send_stop(void)
1193{ 1193{
1194} 1194}
1195 1195
1196unsigned long __per_cpu_base; 1196unsigned long __per_cpu_base __read_mostly;
1197unsigned long __per_cpu_shift; 1197unsigned long __per_cpu_shift __read_mostly;
1198 1198
1199EXPORT_SYMBOL(__per_cpu_base); 1199EXPORT_SYMBOL(__per_cpu_base);
1200EXPORT_SYMBOL(__per_cpu_shift); 1200EXPORT_SYMBOL(__per_cpu_shift);
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index b40db389f90b..362b9c26871b 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -73,7 +73,7 @@ static __initdata struct sparc64_tick_ops dummy_tick_ops = {
73 .get_tick = dummy_get_tick, 73 .get_tick = dummy_get_tick,
74}; 74};
75 75
76struct sparc64_tick_ops *tick_ops = &dummy_tick_ops; 76struct sparc64_tick_ops *tick_ops __read_mostly = &dummy_tick_ops;
77 77
78#define TICK_PRIV_BIT (1UL << 63) 78#define TICK_PRIV_BIT (1UL << 63)
79 79
@@ -195,7 +195,7 @@ static unsigned long tick_add_tick(unsigned long adj, unsigned long offset)
195 return new_tick; 195 return new_tick;
196} 196}
197 197
198static struct sparc64_tick_ops tick_operations = { 198static struct sparc64_tick_ops tick_operations __read_mostly = {
199 .init_tick = tick_init_tick, 199 .init_tick = tick_init_tick,
200 .get_tick = tick_get_tick, 200 .get_tick = tick_get_tick,
201 .get_compare = tick_get_compare, 201 .get_compare = tick_get_compare,
@@ -276,7 +276,7 @@ static unsigned long stick_add_compare(unsigned long adj)
276 return new_compare; 276 return new_compare;
277} 277}
278 278
279static struct sparc64_tick_ops stick_operations = { 279static struct sparc64_tick_ops stick_operations __read_mostly = {
280 .init_tick = stick_init_tick, 280 .init_tick = stick_init_tick,
281 .get_tick = stick_get_tick, 281 .get_tick = stick_get_tick,
282 .get_compare = stick_get_compare, 282 .get_compare = stick_get_compare,
@@ -422,7 +422,7 @@ static unsigned long hbtick_add_compare(unsigned long adj)
422 return val; 422 return val;
423} 423}
424 424
425static struct sparc64_tick_ops hbtick_operations = { 425static struct sparc64_tick_ops hbtick_operations __read_mostly = {
426 .init_tick = hbtick_init_tick, 426 .init_tick = hbtick_init_tick,
427 .get_tick = hbtick_get_tick, 427 .get_tick = hbtick_get_tick,
428 .get_compare = hbtick_get_compare, 428 .get_compare = hbtick_get_compare,
@@ -437,10 +437,9 @@ static struct sparc64_tick_ops hbtick_operations = {
437 * NOTE: On SUN5 systems the ticker interrupt comes in using 2 437 * NOTE: On SUN5 systems the ticker interrupt comes in using 2
438 * interrupts, one at level14 and one with softint bit 0. 438 * interrupts, one at level14 and one with softint bit 0.
439 */ 439 */
440unsigned long timer_tick_offset; 440unsigned long timer_tick_offset __read_mostly;
441unsigned long timer_tick_compare;
442 441
443static unsigned long timer_ticks_per_nsec_quotient; 442static unsigned long timer_ticks_per_nsec_quotient __read_mostly;
444 443
445#define TICK_SIZE (tick_nsec / 1000) 444#define TICK_SIZE (tick_nsec / 1000)
446 445
@@ -464,7 +463,7 @@ static inline void timer_check_rtc(void)
464 463
465static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) 464static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
466{ 465{
467 unsigned long ticks, pstate; 466 unsigned long ticks, compare, pstate;
468 467
469 write_seqlock(&xtime_lock); 468 write_seqlock(&xtime_lock);
470 469
@@ -483,14 +482,14 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
483 : "=r" (pstate) 482 : "=r" (pstate)
484 : "i" (PSTATE_IE)); 483 : "i" (PSTATE_IE));
485 484
486 timer_tick_compare = tick_ops->add_compare(timer_tick_offset); 485 compare = tick_ops->add_compare(timer_tick_offset);
487 ticks = tick_ops->get_tick(); 486 ticks = tick_ops->get_tick();
488 487
489 /* Restore PSTATE_IE. */ 488 /* Restore PSTATE_IE. */
490 __asm__ __volatile__("wrpr %0, 0x0, %%pstate" 489 __asm__ __volatile__("wrpr %0, 0x0, %%pstate"
491 : /* no outputs */ 490 : /* no outputs */
492 : "r" (pstate)); 491 : "r" (pstate));
493 } while (time_after_eq(ticks, timer_tick_compare)); 492 } while (time_after_eq(ticks, compare));
494 493
495 timer_check_rtc(); 494 timer_check_rtc();
496 495
@@ -506,11 +505,6 @@ void timer_tick_interrupt(struct pt_regs *regs)
506 505
507 do_timer(regs); 506 do_timer(regs);
508 507
509 /*
510 * Only keep timer_tick_offset uptodate, but don't set TICK_CMPR.
511 */
512 timer_tick_compare = tick_ops->get_compare() + timer_tick_offset;
513
514 timer_check_rtc(); 508 timer_check_rtc();
515 509
516 write_sequnlock(&xtime_lock); 510 write_sequnlock(&xtime_lock);
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S
index 382fd6798bb9..950423da8a6a 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -32,6 +32,8 @@ SECTIONS
32 .data1 : { *(.data1) } 32 .data1 : { *(.data1) }
33 . = ALIGN(64); 33 . = ALIGN(64);
34 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 34 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
35 . = ALIGN(64);
36 .data.read_mostly : { *(.data.read_mostly) }
35 _edata = .; 37 _edata = .;
36 PROVIDE (edata = .); 38 PROVIDE (edata = .);
37 .fixup : { *(.fixup) } 39 .fixup : { *(.fixup) }
diff --git a/include/linux/cache.h b/include/linux/cache.h
index 2b66a36d85f0..f6b5a46c5f82 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,7 +13,7 @@
13#define SMP_CACHE_BYTES L1_CACHE_BYTES 13#define SMP_CACHE_BYTES L1_CACHE_BYTES
14#endif 14#endif
15 15
16#ifdef CONFIG_X86 16#if defined(CONFIG_X86) || defined(CONFIG_SPARC64)
17#define __read_mostly __attribute__((__section__(".data.read_mostly"))) 17#define __read_mostly __attribute__((__section__(".data.read_mostly")))
18#else 18#else
19#define __read_mostly 19#define __read_mostly