This patch adds Generic time-of-day support for the ARM architecture.
The support is currently added using #ifdef's so that it can support
sub-arches that do not (yet) have a clocksource added. As sub-arches
add clocksource support, they should 'select GENERIC_TIME'
Signed-off-by: Deepak Saxena <dsaxena@mvista.com>
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Kevin Hilman <khilman@mvista.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Europe. There is an ARM Linux project with a web page at
<http://www.arm.linux.org.uk/>.
Europe. There is an ARM Linux project with a web page at
<http://www.arm.linux.org.uk/>.
+config GENERIC_TIME
+ bool
+ default n
+
config MMU
bool
default y
config MMU
bool
default y
+#ifndef CONFIG_GENERIC_TIME
static unsigned long dummy_gettimeoffset(void)
{
return 0;
}
static unsigned long dummy_gettimeoffset(void)
{
return 0;
}
/*
* Scheduler clock - returns current time in nanosec units.
/*
* Scheduler clock - returns current time in nanosec units.
+#ifndef CONFIG_GENERIC_TIME
void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
}
EXPORT_SYMBOL(do_settimeofday);
}
EXPORT_SYMBOL(do_settimeofday);
+#endif /* !CONFIG_GENERIC_TIME */
/**
* save_time_delta - Save the offset between system time and RTC time
/**
* save_time_delta - Save the offset between system time and RTC time
void __init time_init(void)
{
void __init time_init(void)
{
+#ifndef CONFIG_GENERIC_TIME
if (system_timer->offset == NULL)
system_timer->offset = dummy_gettimeoffset;
if (system_timer->offset == NULL)
system_timer->offset = dummy_gettimeoffset;
system_timer->init();
#ifdef CONFIG_NO_IDLE_HZ
system_timer->init();
#ifdef CONFIG_NO_IDLE_HZ
void (*init)(void);
void (*suspend)(void);
void (*resume)(void);
void (*init)(void);
void (*suspend)(void);
void (*resume)(void);
+#ifndef CONFIG_GENERIC_TIME
unsigned long (*offset)(void);
unsigned long (*offset)(void);
#ifdef CONFIG_NO_IDLE_HZ
struct dyn_tick_timer *dyn_tick;
#ifdef CONFIG_NO_IDLE_HZ
struct dyn_tick_timer *dyn_tick;
--- /dev/null
+#ifndef _ASM_ARM_TIMEOFDAY_H
+#define _ASM_ARM_TIMEOFDAY_H
+#include <asm-generic/timeofday.h>
+#endif