/* The base timer frequency, * 27 if selected */ #define HRT_FREQ 1000000
static u64 read_hrt(struct clocksource *cs)
{ /* Read the timer value */ return (u64) inl(scx200_cb_base + SCx200_TIMER_OFFSET);
}
staticstruct clocksource cs_hrt = {
.name = "scx200_hrt",
.rating = 250,
.read = read_hrt,
.mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS, /* mult, shift are set based on mhz27 flag */
};
staticint __init init_hrt_clocksource(void)
{
u32 freq; /* Make sure scx200 has initialized the configuration block */ if (!scx200_cb_present()) return -ENODEV;
/* Reserve the timer's ISA io-region for ourselves */ if (!request_region(scx200_cb_base + SCx200_TIMER_OFFSET,
SCx200_TIMER_SIZE, "NatSemi SCx200 High-Resolution Timer")) {
pr_warn("unable to lock timer region\n"); return -ENODEV;
}
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.