180f06306SHeiko Carstens // SPDX-License-Identifier: GPL-2.0 280f06306SHeiko Carstens /* Copyright IBM Corp. 2020 */ 380f06306SHeiko Carstens 480f06306SHeiko Carstens #include <linux/compiler.h> 580f06306SHeiko Carstens #include <linux/getcpu.h> 680f06306SHeiko Carstens #include <asm/timex.h> 71ab3001bSHeiko Carstens #include "vdso.h" 880f06306SHeiko Carstens __s390_vdso_getcpu(unsigned * cpu,unsigned * node,struct getcpu_cache * unused)980f06306SHeiko Carstensint __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused) 1080f06306SHeiko Carstens { 11*169ceac4SHeiko Carstens union tod_clock clk; 1280f06306SHeiko Carstens 1380f06306SHeiko Carstens /* CPU number is stored in the programmable field of the TOD clock */ 14*169ceac4SHeiko Carstens store_tod_clock_ext(&clk); 1580f06306SHeiko Carstens if (cpu) 16*169ceac4SHeiko Carstens *cpu = clk.pf; 1780f06306SHeiko Carstens /* NUMA node is always zero */ 1880f06306SHeiko Carstens if (node) 1980f06306SHeiko Carstens *node = 0; 2080f06306SHeiko Carstens return 0; 2180f06306SHeiko Carstens } 22