diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2020-11-16 10:06:41 +0300 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2020-11-23 14:01:13 +0300 |
commit | 80f06306240e0ad1c75116111be11950474dfda7 (patch) | |
tree | 99ed304a1c6d26ad408145ba98b83d9fbf807b7f /arch/s390/include | |
parent | 062e527956d05fae02f143c0d5ff9e8525c6799f (diff) | |
download | linux-80f06306240e0ad1c75116111be11950474dfda7.tar.xz |
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')
-rw-r--r-- | arch/s390/include/asm/timex.h | 7 | ||||
-rw-r--r-- | arch/s390/include/asm/vdso.h | 2 |
2 files changed, 9 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); diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h index 9b299c05abf1..f65590889054 100644 --- a/arch/s390/include/asm/vdso.h +++ b/arch/s390/include/asm/vdso.h @@ -14,5 +14,7 @@ extern struct vdso_data *vdso_data; +void vdso_getcpu_init(void); + #endif /* __ASSEMBLY__ */ #endif /* __S390_VDSO_H__ */ |