WIP FPC-III support
[linux/fpc-iii.git] / arch / s390 / kernel / vdso64 / getcpu.c
blob5b2bc7494d5b3ce26919a8cebd139a5ee279dc6e
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright IBM Corp. 2020 */
4 #include <linux/compiler.h>
5 #include <linux/getcpu.h>
6 #include <asm/timex.h>
7 #include "vdso.h"
9 int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
11 __u16 todval[8];
13 /* CPU number is stored in the programmable field of the TOD clock */
14 get_tod_clock_ext((char *)todval);
15 if (cpu)
16 *cpu = todval[7];
17 /* NUMA node is always zero */
18 if (node)
19 *node = 0;
20 return 0;