.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/arch/ia64/kernel/time.c |
---|
3 | 4 | * |
---|
.. | .. |
---|
24 | 25 | #include <linux/platform_device.h> |
---|
25 | 26 | #include <linux/sched/cputime.h> |
---|
26 | 27 | |
---|
27 | | -#include <asm/machvec.h> |
---|
28 | 28 | #include <asm/delay.h> |
---|
29 | 29 | #include <asm/hw_irq.h> |
---|
30 | 30 | #include <asm/ptrace.h> |
---|
.. | .. |
---|
32 | 32 | #include <asm/sections.h> |
---|
33 | 33 | |
---|
34 | 34 | #include "fsyscall_gtod_data.h" |
---|
| 35 | +#include "irq.h" |
---|
35 | 36 | |
---|
36 | 37 | static u64 itc_get_cycles(struct clocksource *cs); |
---|
37 | 38 | |
---|
.. | .. |
---|
132 | 133 | return delta_stime; |
---|
133 | 134 | } |
---|
134 | 135 | |
---|
135 | | -void vtime_account_system(struct task_struct *tsk) |
---|
| 136 | +void vtime_account_kernel(struct task_struct *tsk) |
---|
136 | 137 | { |
---|
137 | 138 | struct thread_info *ti = task_thread_info(tsk); |
---|
138 | 139 | __u64 stime = vtime_delta(tsk); |
---|
139 | 140 | |
---|
140 | | - if ((tsk->flags & PF_VCPU) && !irq_count()) |
---|
| 141 | + if (tsk->flags & PF_VCPU) |
---|
141 | 142 | ti->gtime += stime; |
---|
142 | | - else if (hardirq_count()) |
---|
143 | | - ti->hardirq_time += stime; |
---|
144 | | - else if (in_serving_softirq()) |
---|
145 | | - ti->softirq_time += stime; |
---|
146 | 143 | else |
---|
147 | 144 | ti->stime += stime; |
---|
148 | 145 | } |
---|
149 | | -EXPORT_SYMBOL_GPL(vtime_account_system); |
---|
| 146 | +EXPORT_SYMBOL_GPL(vtime_account_kernel); |
---|
150 | 147 | |
---|
151 | 148 | void vtime_account_idle(struct task_struct *tsk) |
---|
152 | 149 | { |
---|
153 | 150 | struct thread_info *ti = task_thread_info(tsk); |
---|
154 | 151 | |
---|
155 | 152 | ti->idle_time += vtime_delta(tsk); |
---|
| 153 | +} |
---|
| 154 | + |
---|
| 155 | +void vtime_account_softirq(struct task_struct *tsk) |
---|
| 156 | +{ |
---|
| 157 | + struct thread_info *ti = task_thread_info(tsk); |
---|
| 158 | + |
---|
| 159 | + ti->softirq_time += vtime_delta(tsk); |
---|
| 160 | +} |
---|
| 161 | + |
---|
| 162 | +void vtime_account_hardirq(struct task_struct *tsk) |
---|
| 163 | +{ |
---|
| 164 | + struct thread_info *ti = task_thread_info(tsk); |
---|
| 165 | + |
---|
| 166 | + ti->hardirq_time += vtime_delta(tsk); |
---|
156 | 167 | } |
---|
157 | 168 | |
---|
158 | 169 | #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ |
---|
.. | .. |
---|
165 | 176 | if (cpu_is_offline(smp_processor_id())) { |
---|
166 | 177 | return IRQ_HANDLED; |
---|
167 | 178 | } |
---|
168 | | - |
---|
169 | | - platform_timer_interrupt(irq, dev_id); |
---|
170 | 179 | |
---|
171 | 180 | new_itm = local_cpu_data->itm_next; |
---|
172 | 181 | |
---|
.. | .. |
---|
382 | 391 | return now; |
---|
383 | 392 | } |
---|
384 | 393 | |
---|
385 | | - |
---|
386 | | -static struct irqaction timer_irqaction = { |
---|
387 | | - .handler = timer_interrupt, |
---|
388 | | - .flags = IRQF_IRQPOLL, |
---|
389 | | - .name = "timer" |
---|
390 | | -}; |
---|
391 | | - |
---|
392 | 394 | void read_persistent_clock64(struct timespec64 *ts) |
---|
393 | 395 | { |
---|
394 | 396 | efi_gettimeofday(ts); |
---|
.. | .. |
---|
397 | 399 | void __init |
---|
398 | 400 | time_init (void) |
---|
399 | 401 | { |
---|
400 | | - register_percpu_irq(IA64_TIMER_VECTOR, &timer_irqaction); |
---|
| 402 | + register_percpu_irq(IA64_TIMER_VECTOR, timer_interrupt, IRQF_IRQPOLL, |
---|
| 403 | + "timer"); |
---|
401 | 404 | ia64_init_itm(); |
---|
402 | 405 | } |
---|
403 | 406 | |
---|