mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
vdso: Consolidate vdso_calc_delta()
Consolidate vdso_calc_delta(), in preparation for further simplification. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240325064023.2997-2-adrian.hunter@intel.com
This commit is contained in:
committed by
Thomas Gleixner
parent
82ccdf062a
commit
c8e3a8b6f2
@@ -6,6 +6,13 @@
|
||||
#include <vdso/helpers.h>
|
||||
|
||||
#ifndef vdso_calc_delta
|
||||
|
||||
#ifdef VDSO_DELTA_NOMASK
|
||||
# define VDSO_DELTA_MASK(mask) U64_MAX
|
||||
#else
|
||||
# define VDSO_DELTA_MASK(mask) (mask)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Default implementation which works for all sane clocksources. That
|
||||
* obviously excludes x86/TSC.
|
||||
@@ -13,7 +20,7 @@
|
||||
static __always_inline
|
||||
u64 vdso_calc_delta(u64 cycles, u64 last, u64 mask, u32 mult)
|
||||
{
|
||||
return ((cycles - last) & mask) * mult;
|
||||
return ((cycles - last) & VDSO_DELTA_MASK(mask)) * mult;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user