From f5ea0e2d696e02036ced1f5471abadc0e6f08c84 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 31 Jul 2015 22:08:32 +0200 Subject: [PATCH] remove system call times & move tick counter to the section mboot --- hermit/arch/x86/kernel/timer.c | 18 +----------------- hermit/include/hermit/time.h | 11 ----------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/hermit/arch/x86/kernel/timer.c b/hermit/arch/x86/kernel/timer.c index 4534d8946..a69dd76a1 100644 --- a/hermit/arch/x86/kernel/timer.c +++ b/hermit/arch/x86/kernel/timer.c @@ -39,7 +39,7 @@ * This will keep track of how many ticks the system * has been running for */ -static volatile uint64_t timer_ticks = 0; +extern volatile uint64_t timer_ticks; extern uint32_t cpu_freq; extern int32_t boot_processor; @@ -81,22 +81,6 @@ void check_ticks(void) } } -int sys_times(struct tms* buffer, clock_t* clock) -{ - if (BUILTIN_EXPECT(!buffer, 0)) - return -EINVAL; - if (BUILTIN_EXPECT(!clock, 0)) - return -EINVAL; - - check_ticks(); - - memset(buffer, 0x00, sizeof(struct tms)); - *clock = buffer->tms_utime = (clock_t) ((timer_ticks - per_core(current_task)->start_tick) * CLOCKS_PER_SEC / TIMER_FREQ); - - return 0; -} - - uint64_t get_clock_tick(void) { return timer_ticks; diff --git a/hermit/include/hermit/time.h b/hermit/include/hermit/time.h index 1b3e108d5..99e6dd7cd 100644 --- a/hermit/include/hermit/time.h +++ b/hermit/include/hermit/time.h @@ -47,11 +47,6 @@ struct tms { clock_t tms_cstime; }; -#ifndef CLOCKS_PER_SEC -// newlib's default value -#define CLOCKS_PER_SEC 1000 -#endif - /** @brief Initialize Timer interrupts * * This procedure installs IRQ handlers for timer interrupts @@ -66,12 +61,6 @@ int timer_init(void); */ int timer_wait(unsigned int ticks); -/** @brief Determines the time in CLK_TCK's - * - * System call, which returns the value of time in CLK_TCK's - */ -int sys_times(struct tms*, clock_t* clock); - /** @brief Returns the current number of ticks. * @return Current number of ticks */