diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/Kconfig | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/atomic_32.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/atomic_64.h | 4 | ||||
-rw-r--r-- | arch/sparc/include/asm/bitops_64.h | 11 | ||||
-rw-r--r-- | arch/sparc/include/asm/cache.h | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 14 | ||||
-rw-r--r-- | arch/sparc/kernel/process_64.c | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/stacktrace.c | 23 | ||||
-rw-r--r-- | arch/sparc/kernel/time_32.c | 18 | ||||
-rw-r--r-- | arch/sparc/kernel/traps_64.c | 14 |
10 files changed, 68 insertions, 23 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 9908d477ccd9..d6781ce687e2 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -75,7 +75,7 @@ config ARCH_USES_GETTIMEOFFSET | |||
75 | 75 | ||
76 | config GENERIC_CMOS_UPDATE | 76 | config GENERIC_CMOS_UPDATE |
77 | bool | 77 | bool |
78 | default y if SPARC64 | 78 | default y |
79 | 79 | ||
80 | config GENERIC_CLOCKEVENTS | 80 | config GENERIC_CLOCKEVENTS |
81 | bool | 81 | bool |
diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h index f0d343c3b956..7ae128b19d3f 100644 --- a/arch/sparc/include/asm/atomic_32.h +++ b/arch/sparc/include/asm/atomic_32.h | |||
@@ -25,7 +25,7 @@ extern int atomic_cmpxchg(atomic_t *, int, int); | |||
25 | extern int atomic_add_unless(atomic_t *, int, int); | 25 | extern int atomic_add_unless(atomic_t *, int, int); |
26 | extern void atomic_set(atomic_t *, int); | 26 | extern void atomic_set(atomic_t *, int); |
27 | 27 | ||
28 | #define atomic_read(v) ((v)->counter) | 28 | #define atomic_read(v) (*(volatile int *)&(v)->counter) |
29 | 29 | ||
30 | #define atomic_add(i, v) ((void)__atomic_add_return( (int)(i), (v))) | 30 | #define atomic_add(i, v) ((void)__atomic_add_return( (int)(i), (v))) |
31 | #define atomic_sub(i, v) ((void)__atomic_add_return(-(int)(i), (v))) | 31 | #define atomic_sub(i, v) ((void)__atomic_add_return(-(int)(i), (v))) |
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h index f2e48009989e..2050ca02c423 100644 --- a/arch/sparc/include/asm/atomic_64.h +++ b/arch/sparc/include/asm/atomic_64.h | |||
@@ -13,8 +13,8 @@ | |||
13 | #define ATOMIC_INIT(i) { (i) } | 13 | #define ATOMIC_INIT(i) { (i) } |
14 | #define ATOMIC64_INIT(i) { (i) } | 14 | #define ATOMIC64_INIT(i) { (i) } |
15 | 15 | ||
16 | #define atomic_read(v) ((v)->counter) | 16 | #define atomic_read(v) (*(volatile int *)&(v)->counter) |
17 | #define atomic64_read(v) ((v)->counter) | 17 | #define atomic64_read(v) (*(volatile long *)&(v)->counter) |
18 | 18 | ||
19 | #define atomic_set(v, i) (((v)->counter) = i) | 19 | #define atomic_set(v, i) (((v)->counter) = i) |
20 | #define atomic64_set(v, i) (((v)->counter) = i) | 20 | #define atomic64_set(v, i) (((v)->counter) = i) |
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h index e72ac9cdfb98..766121a67a24 100644 --- a/arch/sparc/include/asm/bitops_64.h +++ b/arch/sparc/include/asm/bitops_64.h | |||
@@ -44,7 +44,7 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr); | |||
44 | 44 | ||
45 | #ifdef ULTRA_HAS_POPULATION_COUNT | 45 | #ifdef ULTRA_HAS_POPULATION_COUNT |
46 | 46 | ||
47 | static inline unsigned int hweight64(unsigned long w) | 47 | static inline unsigned int __arch_hweight64(unsigned long w) |
48 | { | 48 | { |
49 | unsigned int res; | 49 | unsigned int res; |
50 | 50 | ||
@@ -52,7 +52,7 @@ static inline unsigned int hweight64(unsigned long w) | |||
52 | return res; | 52 | return res; |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline unsigned int hweight32(unsigned int w) | 55 | static inline unsigned int __arch_hweight32(unsigned int w) |
56 | { | 56 | { |
57 | unsigned int res; | 57 | unsigned int res; |
58 | 58 | ||
@@ -60,7 +60,7 @@ static inline unsigned int hweight32(unsigned int w) | |||
60 | return res; | 60 | return res; |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline unsigned int hweight16(unsigned int w) | 63 | static inline unsigned int __arch_hweight16(unsigned int w) |
64 | { | 64 | { |
65 | unsigned int res; | 65 | unsigned int res; |
66 | 66 | ||
@@ -68,7 +68,7 @@ static inline unsigned int hweight16(unsigned int w) | |||
68 | return res; | 68 | return res; |
69 | } | 69 | } |
70 | 70 | ||
71 | static inline unsigned int hweight8(unsigned int w) | 71 | static inline unsigned int __arch_hweight8(unsigned int w) |
72 | { | 72 | { |
73 | unsigned int res; | 73 | unsigned int res; |
74 | 74 | ||
@@ -78,9 +78,10 @@ static inline unsigned int hweight8(unsigned int w) | |||
78 | 78 | ||
79 | #else | 79 | #else |
80 | 80 | ||
81 | #include <asm-generic/bitops/hweight.h> | 81 | #include <asm-generic/bitops/arch_hweight.h> |
82 | 82 | ||
83 | #endif | 83 | #endif |
84 | #include <asm-generic/bitops/const_hweight.h> | ||
84 | #include <asm-generic/bitops/lock.h> | 85 | #include <asm-generic/bitops/lock.h> |
85 | #endif /* __KERNEL__ */ | 86 | #endif /* __KERNEL__ */ |
86 | 87 | ||
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h index 41f85ae4bd4a..78b07009f60a 100644 --- a/arch/sparc/include/asm/cache.h +++ b/arch/sparc/include/asm/cache.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #ifndef _SPARC_CACHE_H | 7 | #ifndef _SPARC_CACHE_H |
8 | #define _SPARC_CACHE_H | 8 | #define _SPARC_CACHE_H |
9 | 9 | ||
10 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) | ||
11 | |||
10 | #define L1_CACHE_SHIFT 5 | 12 | #define L1_CACHE_SHIFT 5 |
11 | #define L1_CACHE_BYTES 32 | 13 | #define L1_CACHE_BYTES 32 |
12 | #define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))) | 14 | #define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))) |
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index e2771939341d..34ce49f80eac 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/perf_event.h> | 15 | #include <linux/perf_event.h> |
16 | #include <linux/kprobes.h> | 16 | #include <linux/kprobes.h> |
17 | #include <linux/ftrace.h> | ||
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
18 | #include <linux/kdebug.h> | 19 | #include <linux/kdebug.h> |
19 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
@@ -1276,6 +1277,9 @@ static void perf_callchain_kernel(struct pt_regs *regs, | |||
1276 | struct perf_callchain_entry *entry) | 1277 | struct perf_callchain_entry *entry) |
1277 | { | 1278 | { |
1278 | unsigned long ksp, fp; | 1279 | unsigned long ksp, fp; |
1280 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
1281 | int graph = 0; | ||
1282 | #endif | ||
1279 | 1283 | ||
1280 | callchain_store(entry, PERF_CONTEXT_KERNEL); | 1284 | callchain_store(entry, PERF_CONTEXT_KERNEL); |
1281 | callchain_store(entry, regs->tpc); | 1285 | callchain_store(entry, regs->tpc); |
@@ -1303,6 +1307,16 @@ static void perf_callchain_kernel(struct pt_regs *regs, | |||
1303 | fp = (unsigned long)sf->fp + STACK_BIAS; | 1307 | fp = (unsigned long)sf->fp + STACK_BIAS; |
1304 | } | 1308 | } |
1305 | callchain_store(entry, pc); | 1309 | callchain_store(entry, pc); |
1310 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
1311 | if ((pc + 8UL) == (unsigned long) &return_to_handler) { | ||
1312 | int index = current->curr_ret_stack; | ||
1313 | if (current->ret_stack && index >= graph) { | ||
1314 | pc = current->ret_stack[index - graph].ret; | ||
1315 | callchain_store(entry, pc); | ||
1316 | graph++; | ||
1317 | } | ||
1318 | } | ||
1319 | #endif | ||
1306 | } while (entry->nr < PERF_MAX_STACK_DEPTH); | 1320 | } while (entry->nr < PERF_MAX_STACK_DEPTH); |
1307 | } | 1321 | } |
1308 | 1322 | ||
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index a5cf3864b31f..dbe81a368b45 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -202,6 +202,7 @@ void show_regs(struct pt_regs *regs) | |||
202 | regs->u_regs[15]); | 202 | regs->u_regs[15]); |
203 | printk("RPC: <%pS>\n", (void *) regs->u_regs[15]); | 203 | printk("RPC: <%pS>\n", (void *) regs->u_regs[15]); |
204 | show_regwindow(regs); | 204 | show_regwindow(regs); |
205 | show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]); | ||
205 | } | 206 | } |
206 | 207 | ||
207 | struct global_reg_snapshot global_reg_snapshot[NR_CPUS]; | 208 | struct global_reg_snapshot global_reg_snapshot[NR_CPUS]; |
diff --git a/arch/sparc/kernel/stacktrace.c b/arch/sparc/kernel/stacktrace.c index acb12f673757..3e0815349630 100644 --- a/arch/sparc/kernel/stacktrace.c +++ b/arch/sparc/kernel/stacktrace.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <linux/sched.h> | 1 | #include <linux/sched.h> |
2 | #include <linux/stacktrace.h> | 2 | #include <linux/stacktrace.h> |
3 | #include <linux/thread_info.h> | 3 | #include <linux/thread_info.h> |
4 | #include <linux/ftrace.h> | ||
4 | #include <linux/module.h> | 5 | #include <linux/module.h> |
5 | #include <asm/ptrace.h> | 6 | #include <asm/ptrace.h> |
6 | #include <asm/stacktrace.h> | 7 | #include <asm/stacktrace.h> |
@@ -12,6 +13,10 @@ static void __save_stack_trace(struct thread_info *tp, | |||
12 | bool skip_sched) | 13 | bool skip_sched) |
13 | { | 14 | { |
14 | unsigned long ksp, fp; | 15 | unsigned long ksp, fp; |
16 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
17 | struct task_struct *t; | ||
18 | int graph = 0; | ||
19 | #endif | ||
15 | 20 | ||
16 | if (tp == current_thread_info()) { | 21 | if (tp == current_thread_info()) { |
17 | stack_trace_flush(); | 22 | stack_trace_flush(); |
@@ -21,6 +26,9 @@ static void __save_stack_trace(struct thread_info *tp, | |||
21 | } | 26 | } |
22 | 27 | ||
23 | fp = ksp + STACK_BIAS; | 28 | fp = ksp + STACK_BIAS; |
29 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
30 | t = tp->task; | ||
31 | #endif | ||
24 | do { | 32 | do { |
25 | struct sparc_stackf *sf; | 33 | struct sparc_stackf *sf; |
26 | struct pt_regs *regs; | 34 | struct pt_regs *regs; |
@@ -44,8 +52,21 @@ static void __save_stack_trace(struct thread_info *tp, | |||
44 | 52 | ||
45 | if (trace->skip > 0) | 53 | if (trace->skip > 0) |
46 | trace->skip--; | 54 | trace->skip--; |
47 | else if (!skip_sched || !in_sched_functions(pc)) | 55 | else if (!skip_sched || !in_sched_functions(pc)) { |
48 | trace->entries[trace->nr_entries++] = pc; | 56 | trace->entries[trace->nr_entries++] = pc; |
57 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
58 | if ((pc + 8UL) == (unsigned long) &return_to_handler) { | ||
59 | int index = t->curr_ret_stack; | ||
60 | if (t->ret_stack && index >= graph) { | ||
61 | pc = t->ret_stack[index - graph].ret; | ||
62 | if (trace->nr_entries < | ||
63 | trace->max_entries) | ||
64 | trace->entries[trace->nr_entries++] = pc; | ||
65 | graph++; | ||
66 | } | ||
67 | } | ||
68 | #endif | ||
69 | } | ||
49 | } while (trace->nr_entries < trace->max_entries); | 70 | } while (trace->nr_entries < trace->max_entries); |
50 | } | 71 | } |
51 | 72 | ||
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 0d4c09b15efc..4453003032b5 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c | |||
@@ -78,6 +78,11 @@ __volatile__ unsigned int *master_l10_counter; | |||
78 | 78 | ||
79 | u32 (*do_arch_gettimeoffset)(void); | 79 | u32 (*do_arch_gettimeoffset)(void); |
80 | 80 | ||
81 | int update_persistent_clock(struct timespec now) | ||
82 | { | ||
83 | return set_rtc_mmss(now.tv_sec); | ||
84 | } | ||
85 | |||
81 | /* | 86 | /* |
82 | * timer_interrupt() needs to keep up the real-time clock, | 87 | * timer_interrupt() needs to keep up the real-time clock, |
83 | * as well as call the "do_timer()" routine every clocktick | 88 | * as well as call the "do_timer()" routine every clocktick |
@@ -87,9 +92,6 @@ u32 (*do_arch_gettimeoffset)(void); | |||
87 | 92 | ||
88 | static irqreturn_t timer_interrupt(int dummy, void *dev_id) | 93 | static irqreturn_t timer_interrupt(int dummy, void *dev_id) |
89 | { | 94 | { |
90 | /* last time the cmos clock got updated */ | ||
91 | static long last_rtc_update; | ||
92 | |||
93 | #ifndef CONFIG_SMP | 95 | #ifndef CONFIG_SMP |
94 | profile_tick(CPU_PROFILING); | 96 | profile_tick(CPU_PROFILING); |
95 | #endif | 97 | #endif |
@@ -101,16 +103,6 @@ static irqreturn_t timer_interrupt(int dummy, void *dev_id) | |||
101 | 103 | ||
102 | do_timer(1); | 104 | do_timer(1); |
103 | 105 | ||
104 | /* Determine when to update the Mostek clock. */ | ||
105 | if (ntp_synced() && | ||
106 | xtime.tv_sec > last_rtc_update + 660 && | ||
107 | (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && | ||
108 | (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { | ||
109 | if (set_rtc_mmss(xtime.tv_sec) == 0) | ||
110 | last_rtc_update = xtime.tv_sec; | ||
111 | else | ||
112 | last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ | ||
113 | } | ||
114 | write_sequnlock(&xtime_lock); | 106 | write_sequnlock(&xtime_lock); |
115 | 107 | ||
116 | #ifndef CONFIG_SMP | 108 | #ifndef CONFIG_SMP |
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index 9da57f032983..42ad2ba85010 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/kdebug.h> | 19 | #include <linux/kdebug.h> |
20 | #include <linux/ftrace.h> | ||
20 | #include <linux/gfp.h> | 21 | #include <linux/gfp.h> |
21 | 22 | ||
22 | #include <asm/smp.h> | 23 | #include <asm/smp.h> |
@@ -2154,6 +2155,9 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2154 | unsigned long fp, thread_base, ksp; | 2155 | unsigned long fp, thread_base, ksp; |
2155 | struct thread_info *tp; | 2156 | struct thread_info *tp; |
2156 | int count = 0; | 2157 | int count = 0; |
2158 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
2159 | int graph = 0; | ||
2160 | #endif | ||
2157 | 2161 | ||
2158 | ksp = (unsigned long) _ksp; | 2162 | ksp = (unsigned long) _ksp; |
2159 | if (!tsk) | 2163 | if (!tsk) |
@@ -2193,6 +2197,16 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2193 | } | 2197 | } |
2194 | 2198 | ||
2195 | printk(" [%016lx] %pS\n", pc, (void *) pc); | 2199 | printk(" [%016lx] %pS\n", pc, (void *) pc); |
2200 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
2201 | if ((pc + 8UL) == (unsigned long) &return_to_handler) { | ||
2202 | int index = tsk->curr_ret_stack; | ||
2203 | if (tsk->ret_stack && index >= graph) { | ||
2204 | pc = tsk->ret_stack[index - graph].ret; | ||
2205 | printk(" [%016lx] %pS\n", pc, (void *) pc); | ||
2206 | graph++; | ||
2207 | } | ||
2208 | } | ||
2209 | #endif | ||
2196 | } while (++count < 16); | 2210 | } while (++count < 16); |
2197 | } | 2211 | } |
2198 | 2212 | ||