License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / arch / s390 / kernel / vdso32 / getcpu.S
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
249c543b
MS
2/*
3 * Userland implementation of getcpu() for 32 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 lhi %r4,1
20 sll %r4,24
21 sar %a4,%r4
22 la %r4,0
23 epsw %r0,0
24 sacf 512
25 l %r5,__VDSO_CPU_NR(%r4)
26 l %r4,__VDSO_NODE_ID(%r4)
27 tml %r0,0x4000
28 jo 1f
29 tml %r0,0x8000
30 jno 0f
31 sacf 256
32 j 1f
330: sacf 0
341: sar %a4,%r1
35 ltr %r2,%r2
36 jz 2f
37 st %r5,0(%r2)
382: ltr %r3,%r3
39 jz 3f
40 st %r4,0(%r3)
413: lhi %r2,0
42 br %r14
43 .cfi_endproc
44 .size __kernel_getcpu,.-__kernel_getcpu