aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/timex.h
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2020-11-16 08:06:41 +0100
committerHeiko Carstens <hca@linux.ibm.com>2020-11-23 12:01:13 +0100
commit80f06306240e0ad1c75116111be11950474dfda7 (patch)
tree99ed304a1c6d26ad408145ba98b83d9fbf807b7f /arch/s390/include/asm/timex.h
parents390/mm: add debug user asce support (diff)
downloadlinux-dev-80f06306240e0ad1c75116111be11950474dfda7.tar.xz
linux-dev-80f06306240e0ad1c75116111be11950474dfda7.zip
s390/vdso: reimplement getcpu vdso syscall
Implement the previously removed getcpu vdso syscall by using the TOD programmable field to pass the cpu number to user space. Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/timex.h')
-rw-r--r--arch/s390/include/asm/timex.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index 289aaff4d365..c8e244ecdfde 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -49,6 +49,13 @@ static inline void set_clock_comparator(__u64 time)
asm volatile("sckc %0" : : "Q" (time));
}
+static inline void set_tod_programmable_field(u16 val)
+{
+ register unsigned long reg0 asm("0") = val;
+
+ asm volatile("sckpf" : : "d" (reg0));
+}
+
void clock_comparator_work(void);
void __init time_early_init(void);