Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e00d9d4b authored by Mikael Pettersson's avatar Mikael Pettersson Committed by Russell King
Browse files

ARM: 5869/1: ixp4xx: implement sched_clock()



Add a better sched_clock() to the ixp4xx platform,
implemented via its clocksource support.

This is based on the sched_clock() I implemented for
the IOP platform. Tested on a ds101 ixp420 machine.

Signed-off-by: default avatarMikael Pettersson <mikpe@it.uu.se>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 74d2e4f8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -426,6 +426,17 @@ static void __init ixp4xx_clocksource_init(void)
	clocksource_register(&clocksource_ixp4xx);
}

/*
 * sched_clock()
 */
unsigned long long sched_clock(void)
{
	cycle_t cyc = ixp4xx_get_cycles(NULL);
	struct clocksource *cs = &clocksource_ixp4xx;

	return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
}

/*
 * clockevents
 */