]> git.ipfire.org Git - thirdparty/linux.git/blame - arch/powerpc/kernel/vdso32/getcpu.S
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
[thirdparty/linux.git] / arch / powerpc / kernel / vdso32 / getcpu.S
CommitLineData
1a59d1b8 1/* SPDX-License-Identifier: GPL-2.0-or-later */
18ad51dd 2/*
18ad51dd
AB
3 *
4 * Copyright (C) IBM Corporation, 2012
5 *
6 * Author: Anton Blanchard <anton@au.ibm.com>
7 */
8#include <asm/ppc_asm.h>
9#include <asm/vdso.h>
10
11 .text
12/*
13 * Exact prototype of getcpu
14 *
15 * int __kernel_getcpu(unsigned *cpu, unsigned *node);
16 *
17 */
18V_FUNCTION_BEGIN(__kernel_getcpu)
19 .cfi_startproc
9d378dfa 20 mfspr r5,SPRN_SPRG_VDSO_READ
152d44a8
AB
21 cmpwi cr0,r3,0
22 cmpwi cr1,r4,0
18ad51dd
AB
23 clrlwi r6,r5,16
24 rlwinm r7,r5,16,31-15,31-0
25 beq cr0,1f
26 stw r6,0(r3)
271: beq cr1,2f
28 stw r7,0(r4)
292: crclr cr0*4+so
30 li r3,0 /* always success */
31 blr
32 .cfi_endproc
33V_FUNCTION_END(__kernel_getcpu)