aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/time.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:38:36 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:38:55 -0500
commitb020632e40c3ed5e8c0c066d022672907e8401cf (patch)
treed7f805bd27e8378436fbba7e7457afbd10c22ed8 /arch/s390/kernel/time.c
parentfc5243d98ac2575ad14a974b3c097e9ba874c03d (diff)
[S390] introduce vdso on s390
Add a vdso to speed up gettimeofday and clock_getres/clock_gettime for CLOCK_REALTIME/CLOCK_MONOTONIC. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/time.c')
-rw-r--r--arch/s390/kernel/time.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index eccefbbff887..b73bbf31f432 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -36,6 +36,7 @@
36#include <asm/delay.h> 36#include <asm/delay.h>
37#include <asm/s390_ext.h> 37#include <asm/s390_ext.h>
38#include <asm/div64.h> 38#include <asm/div64.h>
39#include <asm/vdso.h>
39#include <asm/irq.h> 40#include <asm/irq.h>
40#include <asm/irq_regs.h> 41#include <asm/irq_regs.h>
41#include <asm/timer.h> 42#include <asm/timer.h>
@@ -223,6 +224,36 @@ static struct clocksource clocksource_tod = {
223}; 224};
224 225
225 226
227void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
228{
229 if (clock != &clocksource_tod)
230 return;
231
232 /* Make userspace gettimeofday spin until we're done. */
233 ++vdso_data->tb_update_count;
234 smp_wmb();
235 vdso_data->xtime_tod_stamp = clock->cycle_last;
236 vdso_data->xtime_clock_sec = xtime.tv_sec;
237 vdso_data->xtime_clock_nsec = xtime.tv_nsec;
238 vdso_data->wtom_clock_sec = wall_to_monotonic.tv_sec;
239 vdso_data->wtom_clock_nsec = wall_to_monotonic.tv_nsec;
240 smp_wmb();
241 ++vdso_data->tb_update_count;
242}
243
244extern struct timezone sys_tz;
245
246void update_vsyscall_tz(void)
247{
248 /* Make userspace gettimeofday spin until we're done. */
249 ++vdso_data->tb_update_count;
250 smp_wmb();
251 vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
252 vdso_data->tz_dsttime = sys_tz.tz_dsttime;
253 smp_wmb();
254 ++vdso_data->tb_update_count;
255}
256
226/* 257/*
227 * Initialize the TOD clock and the CPU timer of 258 * Initialize the TOD clock and the CPU timer of
228 * the boot cpu. 259 * the boot cpu.