Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /* Copyright IBM Corp. 2020 */
0003 
0004 #include <linux/compiler.h>
0005 #include <linux/getcpu.h>
0006 #include <asm/timex.h>
0007 #include "vdso.h"
0008 
0009 int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
0010 {
0011     union tod_clock clk;
0012 
0013     /* CPU number is stored in the programmable field of the TOD clock */
0014     store_tod_clock_ext(&clk);
0015     if (cpu)
0016         *cpu = clk.pf;
0017     /* NUMA node is always zero */
0018     if (node)
0019         *node = 0;
0020     return 0;
0021 }