summaryrefslogtreecommitdiff
path: root/lib/vdso
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vdso')
-rw-r--r--lib/vdso/getrandom.c8
-rw-r--r--lib/vdso/gettimeofday.c23
2 files changed, 20 insertions, 11 deletions
diff --git a/lib/vdso/getrandom.c b/lib/vdso/getrandom.c
index 2851afa9154f..e0fa10bbefc9 100644
--- a/lib/vdso/getrandom.c
+++ b/lib/vdso/getrandom.c
@@ -16,8 +16,12 @@
#include <uapi/linux/mman.h>
#include <uapi/linux/random.h>
-/* Bring in default accessors */
-#include <vdso/vsyscall.h>
+#ifndef __arch_get_vdso_u_rng_data
+static __always_inline const struct vdso_rng_data *__arch_get_vdso_u_rng_data(void)
+{
+ return &vdso_u_rng_data;
+}
+#endif
#define MEMCPY_AND_ZERO_SRC(type, dst, src, len) do { \
while (len >= sizeof(type)) { \
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index f7a591aba59f..c0e81996532d 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -27,9 +27,6 @@
#include <linux/build_bug.h>
-/* Bring in default accessors */
-#include <vdso/vsyscall.h>
-
#ifndef vdso_calc_ns
#ifdef VDSO_DELTA_NOMASK
@@ -93,6 +90,13 @@ static inline bool vdso_cycles_ok(u64 cycles)
}
#endif
+#ifndef __arch_get_vdso_u_time_data
+static __always_inline const struct vdso_time_data *__arch_get_vdso_u_time_data(void)
+{
+ return &vdso_u_time_data;
+}
+#endif
+
static __always_inline bool vdso_clockid_valid(clockid_t clock)
{
/* Check for negative values or invalid clocks */
@@ -136,21 +140,22 @@ const struct vdso_time_data *vdso_timens_data(const struct vdso_time_data *vd)
}
static __always_inline
+const struct vdso_clock *vdso_timens_clock(const struct vdso_clock *vc)
+{
+ return (void *)vc + PAGE_SIZE;
+}
+
+static __always_inline
bool do_hres_timens(const struct vdso_time_data *vdns, const struct vdso_clock *vcns,
clockid_t clk, struct __kernel_timespec *ts)
{
const struct vdso_time_data *vd = vdso_timens_data(vdns);
+ const struct vdso_clock *vc = vdso_timens_clock(vcns);
const struct timens_offset *offs = &vcns->offset[clk];
- const struct vdso_clock *vc = vd->clock_data;
u32 seq;
s64 sec;
u64 ns;
- if (clk != CLOCK_MONOTONIC_RAW)
- vc = &vc[CS_HRES_COARSE];
- else
- vc = &vc[CS_RAW];
-
do {
seq = vdso_read_begin(vc);