forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/powerpc/kernel/vdso32/getcpu.S
....@@ -1,17 +1,5 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
2
- * This program is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License as published by
4
- * the Free Software Foundation; either version 2 of the License, or
5
- * (at your option) any later version.
6
- *
7
- * This program is distributed in the hope that it will be useful,
8
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- * GNU General Public License for more details.
11
- *
12
- * You should have received a copy of the GNU General Public License
13
- * along with this program; if not, write to the Free Software
14
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
153 *
164 * Copyright (C) IBM Corporation, 2012
175 *
....@@ -27,6 +15,7 @@
2715 * int __kernel_getcpu(unsigned *cpu, unsigned *node);
2816 *
2917 */
18
+#if defined(CONFIG_PPC64)
3019 V_FUNCTION_BEGIN(__kernel_getcpu)
3120 .cfi_startproc
3221 mfspr r5,SPRN_SPRG_VDSO_READ
....@@ -36,10 +25,26 @@
3625 rlwinm r7,r5,16,31-15,31-0
3726 beq cr0,1f
3827 stw r6,0(r3)
39
-1: beq cr1,2f
40
- stw r7,0(r4)
41
-2: crclr cr0*4+so
28
+1: crclr cr0*4+so
4229 li r3,0 /* always success */
30
+ beqlr cr1
31
+ stw r7,0(r4)
4332 blr
4433 .cfi_endproc
4534 V_FUNCTION_END(__kernel_getcpu)
35
+#elif !defined(CONFIG_SMP)
36
+V_FUNCTION_BEGIN(__kernel_getcpu)
37
+ .cfi_startproc
38
+ cmpwi cr0, r3, 0
39
+ cmpwi cr1, r4, 0
40
+ li r5, 0
41
+ beq cr0, 1f
42
+ stw r5, 0(r3)
43
+1: li r3, 0 /* always success */
44
+ crclr cr0*4+so
45
+ beqlr cr1
46
+ stw r5, 0(r4)
47
+ blr
48
+ .cfi_endproc
49
+V_FUNCTION_END(__kernel_getcpu)
50
+#endif