Skip to content

Commit 846034f

Browse files
Andrew Boienashif
authored andcommitted
drivers: loapic_timer: simplify TSC read
We have an inline function for this in x86's arch.h that works for both 64 and 32-bit. Signed-off-by: Andrew Boie <[email protected]>
1 parent d1f5012 commit 846034f

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

drivers/timer/loapic_timer.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,7 @@ void timer_int_handler(void *unused /* parameter is not used */
202202
)
203203
{
204204
#ifdef CONFIG_EXECUTION_BENCHMARKING
205-
__asm__ __volatile__ (
206-
"pushl %eax\n\t"
207-
"pushl %edx\n\t"
208-
"rdtsc\n\t"
209-
"mov %eax, arch_timing_tick_start\n\t"
210-
"mov %edx, arch_timing_tick_start+4\n\t"
211-
"pop %edx\n\t"
212-
"pop %eax\n\t");
205+
arch_timing_tick_start = z_tsc_read();
213206
#endif
214207
ARG_UNUSED(unused);
215208

@@ -289,14 +282,7 @@ void timer_int_handler(void *unused /* parameter is not used */
289282
#endif /*CONFIG_TICKLESS_IDLE*/
290283
#endif
291284
#ifdef CONFIG_EXECUTION_BENCHMARKING
292-
__asm__ __volatile__ (
293-
"pushl %eax\n\t"
294-
"pushl %edx\n\t"
295-
"rdtsc\n\t"
296-
"mov %eax, arch_timing_tick_end\n\t"
297-
"mov %edx, arch_timing_tick_end+4\n\t"
298-
"pop %edx\n\t"
299-
"pop %eax\n\t");
285+
arch_timing_tick_end = z_tsc_read();
300286
#endif /* CONFIG_EXECUTION_BENCHMARKING */
301287
}
302288

0 commit comments

Comments
 (0)