/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Common time prototypes and such for all ppc machines. * * Written by Cort Dougan (cort@cs.nmt.edu) to merge * Paul Mackerras' version and mine for PReP and Pmac.
*/
staticinline u64 get_vtb(void)
{ if (cpu_has_feature(CPU_FTR_ARCH_207S)) return mfspr(SPRN_VTB);
return 0;
}
/* Accessor functions for the decrementer register. * The 4xx doesn't even have a decrementer. I tried to use the * generic timer interrupt code, which seems OK, with the 4xx PIT * in auto-reload mode. The problem is PIT stops counting when it * hits zero. If it would wrap, we could use it just like a decrementer.
*/ staticinline u64 get_dec(void)
{ return mfspr(SPRN_DEC);
}
/* * Note: Book E and 4xx processors differ from other PowerPC processors * in when the decrementer generates its interrupt: on the 1 to 0 * transition for Book E/4xx, but on the 0 to -1 transition for others.
*/ staticinlinevoid set_dec(u64 val)
{ if (IS_ENABLED(CONFIG_BOOKE))
mtspr(SPRN_DEC, val); else
mtspr(SPRN_DEC, val - 1);
}
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.