/* * arch/xtensa/kernel/time.c * * Timer and clock support. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2005 Tensilica Inc. * * Chris Zankel <chris@zankel.net>
*/
staticint ccount_timer_set_next_event(unsignedlong delta, struct clock_event_device *dev)
{ unsignedlong flags, next; int ret = 0;
local_irq_save(flags);
next = get_ccount() + delta;
set_linux_timer(next); if (next - get_ccount() > delta)
ret = -ETIME;
local_irq_restore(flags);
return ret;
}
/* * There is no way to disable the timer interrupt at the device level, * only at the intenable register itself. Since enable_irq/disable_irq * calls are nested, we need to make sure that these calls are * balanced.
*/ staticint ccount_timer_shutdown(struct clock_event_device *evt)
{ struct ccount_timer *timer =
container_of(evt, struct ccount_timer, evt);
cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu"); if (cpu) {
clk = of_clk_get(cpu, 0);
of_node_put(cpu); if (!IS_ERR(clk)) {
ccount_freq = clk_get_rate(clk); return;
} else {
pr_warn("%s: CPU input clock not found\n",
__func__);
}
} else {
pr_warn("%s: CPU node not found in the device tree\n",
__func__);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.