You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
clocksource: pass clocksource to read() callback
Pass clocksource pointer to the read() callback for clocksources. This allows us to share the callback between multiple instances. [hugh@veritas.com: fix powerpc build of clocksource pass clocksource mods] [akpm@linux-foundation.org: cleanup] Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: John Stultz <johnstul@us.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
ff14ed5db6
commit
8e19608e8b
@@ -85,7 +85,7 @@ static struct irqaction at91rm9200_timer_irq = {
|
||||
.handler = at91rm9200_timer_interrupt
|
||||
};
|
||||
|
||||
static cycle_t read_clk32k(void)
|
||||
static cycle_t read_clk32k(struct clocksource *cs)
|
||||
{
|
||||
return read_CRTR();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ static u32 pit_cnt; /* access only w/system irq blocked */
|
||||
* Clocksource: just a monotonic counter of MCK/16 cycles.
|
||||
* We don't care whether or not PIT irqs are enabled.
|
||||
*/
|
||||
static cycle_t read_pit_clk(void)
|
||||
static cycle_t read_pit_clk(struct clocksource *cs)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 elapsed;
|
||||
|
||||
@@ -238,7 +238,7 @@ static void __init timer_init(void)
|
||||
/*
|
||||
* clocksource
|
||||
*/
|
||||
static cycle_t read_cycles(void)
|
||||
static cycle_t read_cycles(struct clocksource *cs)
|
||||
{
|
||||
struct timer_s *t = &timers[TID_CLOCKSOURCE];
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ static void __init imx_timer_hardware_init(void)
|
||||
IMX_TCTL(TIMER_BASE) = TCTL_FRR | TCTL_CLK_PCLK1 | TCTL_TEN;
|
||||
}
|
||||
|
||||
cycle_t imx_get_cycles(void)
|
||||
cycle_t imx_get_cycles(struct clocksource *cs)
|
||||
{
|
||||
return IMX_TCN(TIMER_BASE);
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ void __init ixp4xx_sys_init(void)
|
||||
/*
|
||||
* clocksource
|
||||
*/
|
||||
cycle_t ixp4xx_get_cycles(void)
|
||||
cycle_t ixp4xx_get_cycles(struct clocksource *cs)
|
||||
{
|
||||
return *IXP4XX_OSTS;
|
||||
}
|
||||
|
||||
@@ -57,12 +57,12 @@ static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static cycle_t msm_gpt_read(void)
|
||||
static cycle_t msm_gpt_read(struct clocksource *cs)
|
||||
{
|
||||
return readl(MSM_GPT_BASE + TIMER_COUNT_VAL);
|
||||
}
|
||||
|
||||
static cycle_t msm_dgt_read(void)
|
||||
static cycle_t msm_dgt_read(struct clocksource *cs)
|
||||
{
|
||||
return readl(MSM_DGT_BASE + TIMER_COUNT_VAL) >> MSM_DGT_SHIFT;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ static struct irqaction netx_timer_irq = {
|
||||
.handler = netx_timer_interrupt,
|
||||
};
|
||||
|
||||
cycle_t netx_get_cycles(void)
|
||||
cycle_t netx_get_cycles(struct clocksource *cs)
|
||||
{
|
||||
return readl(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE));
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#define TIMER_CLOCKEVENT 1
|
||||
static u32 latch;
|
||||
|
||||
static cycle_t ns9360_clocksource_read(void)
|
||||
static cycle_t ns9360_clocksource_read(struct clocksource *cs)
|
||||
{
|
||||
return __raw_readl(SYS_TR(TIMER_CLOCKSOURCE));
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ static struct irqaction omap_mpu_timer2_irq = {
|
||||
.handler = omap_mpu_timer2_interrupt,
|
||||
};
|
||||
|
||||
static cycle_t mpu_read(void)
|
||||
static cycle_t mpu_read(struct clocksource *cs)
|
||||
{
|
||||
return ~omap_mpu_timer_read(1);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ static inline void __init omap2_gp_clocksource_init(void) {}
|
||||
* clocksource
|
||||
*/
|
||||
static struct omap_dm_timer *gpt_clocksource;
|
||||
static cycle_t clocksource_read_cycles(void)
|
||||
static cycle_t clocksource_read_cycles(struct clocksource *cs)
|
||||
{
|
||||
return (cycle_t)omap_dm_timer_read_counter(gpt_clocksource);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ static struct clock_event_device ckevt_pxa_osmr0 = {
|
||||
.set_mode = pxa_osmr0_set_mode,
|
||||
};
|
||||
|
||||
static cycle_t pxa_read_oscr(void)
|
||||
static cycle_t pxa_read_oscr(struct clocksource *cs)
|
||||
{
|
||||
return OSCR;
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ static struct irqaction realview_timer_irq = {
|
||||
.handler = realview_timer_interrupt,
|
||||
};
|
||||
|
||||
static cycle_t realview_get_cycles(void)
|
||||
static cycle_t realview_get_cycles(struct clocksource *cs)
|
||||
{
|
||||
return ~readl(timer3_va_base + TIMER_VALUE);
|
||||
}
|
||||
|
||||
@@ -948,7 +948,7 @@ static struct irqaction versatile_timer_irq = {
|
||||
.handler = versatile_timer_interrupt,
|
||||
};
|
||||
|
||||
static cycle_t versatile_get_cycles(void)
|
||||
static cycle_t versatile_get_cycles(struct clocksource *cs)
|
||||
{
|
||||
return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
|
||||
|
||||
/* clock source */
|
||||
|
||||
static cycle_t mxc_get_cycles(void)
|
||||
static cycle_t mxc_get_cycles(struct clocksource *cs)
|
||||
{
|
||||
return __raw_readl(TIMER_BASE + MXC_TCN);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ console_initcall(omap_add_serial_console);
|
||||
|
||||
#include <linux/clocksource.h>
|
||||
|
||||
static cycle_t omap_32k_read(void)
|
||||
static cycle_t omap_32k_read(struct clocksource *cs)
|
||||
{
|
||||
return omap_readl(TIMER_32K_SYNCHRONIZED);
|
||||
}
|
||||
@@ -207,7 +207,7 @@ unsigned long long sched_clock(void)
|
||||
{
|
||||
unsigned long long ret;
|
||||
|
||||
ret = (unsigned long long)omap_32k_read();
|
||||
ret = (unsigned long long)omap_32k_read(&clocksource_32k);
|
||||
ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ static u32 ticks_per_jiffy;
|
||||
/*
|
||||
* Clocksource handling.
|
||||
*/
|
||||
static cycle_t orion_clksrc_read(void)
|
||||
static cycle_t orion_clksrc_read(struct clocksource *cs)
|
||||
{
|
||||
return 0xffffffff - readl(TIMER0_VAL);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <mach/pm.h>
|
||||
|
||||
|
||||
static cycle_t read_cycle_count(void)
|
||||
static cycle_t read_cycle_count(struct clocksource *cs)
|
||||
{
|
||||
return (cycle_t)sysreg_read(COUNT);
|
||||
}
|
||||
|
||||
@@ -58,16 +58,11 @@ static inline unsigned long long cycles_2_ns(cycle_t cyc)
|
||||
return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
|
||||
}
|
||||
|
||||
static cycle_t read_cycles(void)
|
||||
static cycle_t read_cycles(struct clocksource *cs)
|
||||
{
|
||||
return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod);
|
||||
}
|
||||
|
||||
unsigned long long sched_clock(void)
|
||||
{
|
||||
return cycles_2_ns(read_cycles());
|
||||
}
|
||||
|
||||
static struct clocksource clocksource_bfin = {
|
||||
.name = "bfin_cycles",
|
||||
.rating = 350,
|
||||
@@ -77,6 +72,11 @@ static struct clocksource clocksource_bfin = {
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||
};
|
||||
|
||||
unsigned long long sched_clock(void)
|
||||
{
|
||||
return cycles_2_ns(read_cycles(&clocksource_bfin));
|
||||
}
|
||||
|
||||
static int __init bfin_clocksource_init(void)
|
||||
{
|
||||
set_cyc2ns_scale(get_cclk() / 1000);
|
||||
|
||||
@@ -21,7 +21,7 @@ void __init cyclone_setup(void)
|
||||
|
||||
static void __iomem *cyclone_mc;
|
||||
|
||||
static cycle_t read_cyclone(void)
|
||||
static cycle_t read_cyclone(struct clocksource *cs)
|
||||
{
|
||||
return (cycle_t)readq((void __iomem *)cyclone_mc);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "fsyscall_gtod_data.h"
|
||||
|
||||
static cycle_t itc_get_cycles(void);
|
||||
static cycle_t itc_get_cycles(struct clocksource *cs);
|
||||
|
||||
struct fsyscall_gtod_data_t fsyscall_gtod_data = {
|
||||
.lock = SEQLOCK_UNLOCKED,
|
||||
@@ -383,7 +383,7 @@ ia64_init_itm (void)
|
||||
}
|
||||
}
|
||||
|
||||
static cycle_t itc_get_cycles(void)
|
||||
static cycle_t itc_get_cycles(struct clocksource *cs)
|
||||
{
|
||||
u64 lcycle, now, ret;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user