Skip to content

Commit

Permalink
Merge branch 'arch-timers' into for-linus
Browse files Browse the repository at this point in the history
Conflicts:
	arch/arm/include/asm/timex.h
	arch/arm/lib/delay.c
  • Loading branch information
Russell King committed Oct 4, 2012
2 parents ba4a63f + 56942fe commit ceaa1a1
Show file tree
Hide file tree
Showing 5 changed files with 316 additions and 125 deletions.
8 changes: 7 additions & 1 deletion arch/arm/include/asm/arch_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#define __ASMARM_ARCH_TIMER_H

#include <asm/errno.h>
#include <linux/clocksource.h>

#ifdef CONFIG_ARM_ARCH_TIMER
#define ARCH_HAS_READ_CURRENT_TIMER
int arch_timer_of_register(void);
int arch_timer_sched_clock_init(void);
struct timecounter *arch_timer_get_timecounter(void);
#else
static inline int arch_timer_of_register(void)
{
Expand All @@ -17,6 +18,11 @@ static inline int arch_timer_sched_clock_init(void)
{
return -ENXIO;
}

static inline struct timecounter *arch_timer_get_timecounter(void)
{
return NULL;
}
#endif

#endif
9 changes: 9 additions & 0 deletions arch/arm/include/asm/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

#ifndef __ASSEMBLY__

struct delay_timer {
unsigned long (*read_current_timer)(void);
unsigned long freq;
};

extern struct arm_delay_ops {
void (*delay)(unsigned long);
void (*const_udelay)(unsigned long);
Expand Down Expand Up @@ -56,6 +61,10 @@ extern void __loop_delay(unsigned long loops);
extern void __loop_udelay(unsigned long usecs);
extern void __loop_const_udelay(unsigned long);

/* Delay-loop timer registration. */
#define ARCH_HAS_READ_CURRENT_TIMER
extern void register_current_timer_delay(const struct delay_timer *timer);

#endif /* __ASSEMBLY__ */

#endif /* defined(_ARM_DELAY_H) */
Expand Down
6 changes: 1 addition & 5 deletions arch/arm/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@
#ifndef _ASMARM_TIMEX_H
#define _ASMARM_TIMEX_H

#include <asm/arch_timer.h>
#include <mach/timex.h>

#ifdef ARCH_HAS_READ_CURRENT_TIMER
typedef unsigned long cycles_t;
#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; })
#endif

#include <asm-generic/timex.h>

#endif
Loading

0 comments on commit ceaa1a1

Please sign in to comment.