mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-16 00:00:06 +01:00
remove system call times & move tick counter to the section mboot
This commit is contained in:
parent
89b943398e
commit
f5ea0e2d69
2 changed files with 1 additions and 28 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue