forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/ia64/kernel/time.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/ia64/kernel/time.c
34 *
....@@ -24,7 +25,6 @@
2425 #include <linux/platform_device.h>
2526 #include <linux/sched/cputime.h>
2627
27
-#include <asm/machvec.h>
2828 #include <asm/delay.h>
2929 #include <asm/hw_irq.h>
3030 #include <asm/ptrace.h>
....@@ -32,6 +32,7 @@
3232 #include <asm/sections.h>
3333
3434 #include "fsyscall_gtod_data.h"
35
+#include "irq.h"
3536
3637 static u64 itc_get_cycles(struct clocksource *cs);
3738
....@@ -132,27 +133,37 @@
132133 return delta_stime;
133134 }
134135
135
-void vtime_account_system(struct task_struct *tsk)
136
+void vtime_account_kernel(struct task_struct *tsk)
136137 {
137138 struct thread_info *ti = task_thread_info(tsk);
138139 __u64 stime = vtime_delta(tsk);
139140
140
- if ((tsk->flags & PF_VCPU) && !irq_count())
141
+ if (tsk->flags & PF_VCPU)
141142 ti->gtime += stime;
142
- else if (hardirq_count())
143
- ti->hardirq_time += stime;
144
- else if (in_serving_softirq())
145
- ti->softirq_time += stime;
146143 else
147144 ti->stime += stime;
148145 }
149
-EXPORT_SYMBOL_GPL(vtime_account_system);
146
+EXPORT_SYMBOL_GPL(vtime_account_kernel);
150147
151148 void vtime_account_idle(struct task_struct *tsk)
152149 {
153150 struct thread_info *ti = task_thread_info(tsk);
154151
155152 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);
156167 }
157168
158169 #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
....@@ -165,8 +176,6 @@
165176 if (cpu_is_offline(smp_processor_id())) {
166177 return IRQ_HANDLED;
167178 }
168
-
169
- platform_timer_interrupt(irq, dev_id);
170179
171180 new_itm = local_cpu_data->itm_next;
172181
....@@ -382,13 +391,6 @@
382391 return now;
383392 }
384393
385
-
386
-static struct irqaction timer_irqaction = {
387
- .handler = timer_interrupt,
388
- .flags = IRQF_IRQPOLL,
389
- .name = "timer"
390
-};
391
-
392394 void read_persistent_clock64(struct timespec64 *ts)
393395 {
394396 efi_gettimeofday(ts);
....@@ -397,7 +399,8 @@
397399 void __init
398400 time_init (void)
399401 {
400
- register_percpu_irq(IA64_TIMER_VECTOR, &timer_irqaction);
402
+ register_percpu_irq(IA64_TIMER_VECTOR, timer_interrupt, IRQF_IRQPOLL,
403
+ "timer");
401404 ia64_init_itm();
402405 }
403406