Skip to content
projects
/
linux
·
blob
master ·
refs
linux
arch
s390
kernel
vdso
getcpu.c
…
History
History
·
Raw
Raw
·
Diff
Diff
·
Blob
Blob
20 lines · 426 B
1
//
SPDX-License-Identifier: GPL-2.0
2
/*
Copyright IBM Corp. 2020
*/
3
4
#include
<
linux/compiler.h
>
5
#include
<
asm/timex.h
>
6
#include
"
vdso.h
"
7
8
int
__s390_vdso_getcpu
(
unsigned
*
cpu
,
unsigned
*
node
,
void
*
unused
)
9
{
10
union
tod_clock clk
;
11
12
/*
CPU number is stored in the programmable field of the TOD clock
*/
13
store_tod_clock_ext
(
&
clk
)
;
14
if
(
cpu
)
15
*
cpu
=
clk
.
pf
;
16
/*
NUMA node is always zero
*/
17
if
(
node
)
18
*
node
=
0
;
19
return
0
;
20
}