License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / arch / s390 / kernel / vdso64 / getcpu.S
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
249c543b
MS
2/*
3 * Userland implementation of getcpu() for 64 bits processes in a
4 * s390 kernel for use in the vDSO
5 *
6 * Copyright IBM Corp. 2016
7 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
8 */
9#include <asm/vdso.h>
10#include <asm/asm-offsets.h>
11
12 .text
13 .align 4
14 .globl __kernel_getcpu
15 .type __kernel_getcpu,@function
16__kernel_getcpu:
17 .cfi_startproc
18 ear %r1,%a4
19 llilh %r4,0x0100
20 sar %a4,%r4
21 la %r4,0
22 epsw %r0,0
23 sacf 512
24 l %r5,__VDSO_CPU_NR(%r4)
25 l %r4,__VDSO_NODE_ID(%r4)
26 tml %r0,0x4000
27 jo 1f
28 tml %r0,0x8000
29 jno 0f
30 sacf 256
31 j 1f
320: sacf 0
331: sar %a4,%r1
34 ltgr %r2,%r2
35 jz 2f
36 st %r5,0(%r2)
372: ltgr %r3,%r3
38 jz 3f
39 st %r4,0(%r3)
403: lghi %r2,0
41 br %r14
42 .cfi_endproc
43 .size __kernel_getcpu,.-__kernel_getcpu