Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sparc64: vdso: Introduce vdso/processor.h

The generic vDSO library expects a vdso/processor.h with an definition of
cpu_relax().

Split out cpu_relax() into this dedicated header.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Andreas Larsson <andreas@gaisler.com>
Link: https://patch.msgid.link/20260304-vdso-sparc64-generic-2-v6-9-d8eb3b0e1410@linutronix.de

authored by

Thomas Weißschuh and committed by
Thomas Gleixner
e13e3059 d60c682b

+44 -27
+3
arch/sparc/include/asm/processor.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 #ifndef ___ASM_SPARC_PROCESSOR_H 3 3 #define ___ASM_SPARC_PROCESSOR_H 4 + 5 + #include <asm/vdso/processor.h> 6 + 4 7 #if defined(__sparc__) && defined(__arch64__) 5 8 #include <asm/processor_64.h> 6 9 #else
-2
arch/sparc/include/asm/processor_32.h
··· 91 91 extern struct task_struct *last_task_used_math; 92 92 int do_mathemu(struct pt_regs *regs, struct task_struct *fpt); 93 93 94 - #define cpu_relax() barrier() 95 - 96 94 extern void (*sparc_idle)(void); 97 95 98 96 #endif
-25
arch/sparc/include/asm/processor_64.h
··· 182 182 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc) 183 183 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->u_regs[UREG_FP]) 184 184 185 - /* Please see the commentary in asm/backoff.h for a description of 186 - * what these instructions are doing and how they have been chosen. 187 - * To make a long story short, we are trying to yield the current cpu 188 - * strand during busy loops. 189 - */ 190 - #ifdef BUILD_VDSO 191 - #define cpu_relax() asm volatile("\n99:\n\t" \ 192 - "rd %%ccr, %%g0\n\t" \ 193 - "rd %%ccr, %%g0\n\t" \ 194 - "rd %%ccr, %%g0\n\t" \ 195 - ::: "memory") 196 - #else /* ! BUILD_VDSO */ 197 - #define cpu_relax() asm volatile("\n99:\n\t" \ 198 - "rd %%ccr, %%g0\n\t" \ 199 - "rd %%ccr, %%g0\n\t" \ 200 - "rd %%ccr, %%g0\n\t" \ 201 - ".section .pause_3insn_patch,\"ax\"\n\t"\ 202 - ".word 99b\n\t" \ 203 - "wr %%g0, 128, %%asr27\n\t" \ 204 - "nop\n\t" \ 205 - "nop\n\t" \ 206 - ".previous" \ 207 - ::: "memory") 208 - #endif 209 - 210 185 /* Prefetch support. This is tuned for UltraSPARC-III and later. 211 186 * UltraSPARC-I will treat these as nops, and UltraSPARC-II has 212 187 * a shallower prefetch queue than later chips.
+41
arch/sparc/include/asm/vdso/processor.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef _ASM_SPARC_VDSO_PROCESSOR_H 4 + #define _ASM_SPARC_VDSO_PROCESSOR_H 5 + 6 + #include <linux/compiler.h> 7 + 8 + #if defined(__arch64__) 9 + 10 + /* Please see the commentary in asm/backoff.h for a description of 11 + * what these instructions are doing and how they have been chosen. 12 + * To make a long story short, we are trying to yield the current cpu 13 + * strand during busy loops. 14 + */ 15 + #ifdef BUILD_VDSO 16 + #define cpu_relax() asm volatile("\n99:\n\t" \ 17 + "rd %%ccr, %%g0\n\t" \ 18 + "rd %%ccr, %%g0\n\t" \ 19 + "rd %%ccr, %%g0\n\t" \ 20 + ::: "memory") 21 + #else /* ! BUILD_VDSO */ 22 + #define cpu_relax() asm volatile("\n99:\n\t" \ 23 + "rd %%ccr, %%g0\n\t" \ 24 + "rd %%ccr, %%g0\n\t" \ 25 + "rd %%ccr, %%g0\n\t" \ 26 + ".section .pause_3insn_patch,\"ax\"\n\t"\ 27 + ".word 99b\n\t" \ 28 + "wr %%g0, 128, %%asr27\n\t" \ 29 + "nop\n\t" \ 30 + "nop\n\t" \ 31 + ".previous" \ 32 + ::: "memory") 33 + #endif /* BUILD_VDSO */ 34 + 35 + #else /* ! __arch64__ */ 36 + 37 + #define cpu_relax() barrier() 38 + 39 + #endif /* __arch64__ */ 40 + 41 + #endif /* _ASM_SPARC_VDSO_PROCESSOR_H */