/** * get_clock_monotonic - returns current time in clock rate units * * The clock and tod_clock_base get changed via stop_machine. * Therefore preemption must be disabled, otherwise the returned * value is not guaranteed to be monotonic.
*/ staticinlineunsignedlong get_tod_clock_monotonic(void)
{ unsignedlong tod;
preempt_disable_notrace();
tod = __get_tod_clock_monotonic();
preempt_enable_notrace(); return tod;
}
/** * tod_to_ns - convert a TOD format value to nanoseconds * @todval: to be converted TOD format value * Returns: number of nanoseconds that correspond to the TOD format value * * Converting a 64 Bit TOD format value to nanoseconds means that the value * must be divided by 4.096. In order to achieve that we multiply with 125 * and divide by 512: * * ns = (todval * 125) >> 9; * * In order to avoid an overflow with the multiplication we can rewrite this. * With a split todval == 2^9 * th + tl (th upper 55 bits, tl lower 9 bits) * we end up with * * ns = ((2^9 * th + tl) * 125 ) >> 9; * -> ns = (th * 125) + ((tl * 125) >> 9); *
*/ static __always_inline unsignedlong tod_to_ns(unsignedlong todval)
{ return ((todval >> 9) * 125) + (((todval & 0x1ff) * 125) >> 9);
}
/** * tod_after - compare two 64 bit TOD values * @a: first 64 bit TOD timestamp * @b: second 64 bit TOD timestamp * * Returns: true if a is later than b
*/ staticinlineint tod_after(unsignedlong a, unsignedlong b)
{ if (machine_has_scc()) return (long) a > (long) b; return a > b;
}
/** * tod_after_eq - compare two 64 bit TOD values * @a: first 64 bit TOD timestamp * @b: second 64 bit TOD timestamp * * Returns: true if a is later than b
*/ staticinlineint tod_after_eq(unsignedlong a, unsignedlong b)
{ if (machine_has_scc()) return (long) a >= (long) b; return a >= b;
}
#endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
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.