1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) IBM Corporation, 2012
6 * Author: Anton Blanchard <anton@au.ibm.com>
8 #include <asm/ppc_asm.h>
13 * Exact prototype of getcpu
15 * int __kernel_getcpu(unsigned *cpu, unsigned *node);
18 #if defined(CONFIG_PPC64)
19 V_FUNCTION_BEGIN(__kernel_getcpu)
21 mfspr r5,SPRN_SPRG_VDSO_READ
25 rlwinm r7,r5,16,31-15,31-0
29 li r3,0 /* always success */
34 V_FUNCTION_END(__kernel_getcpu)
35 #elif !defined(CONFIG_SMP)
36 V_FUNCTION_BEGIN(__kernel_getcpu)
43 1: li r3, 0 /* always success */
49 V_FUNCTION_END(__kernel_getcpu)