Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 #ifndef _ASM_POWERPC_VDSO_PROCESSOR_H
0003 #define _ASM_POWERPC_VDSO_PROCESSOR_H
0004 
0005 #ifndef __ASSEMBLY__
0006 
0007 /* Macros for adjusting thread priority (hardware multi-threading) */
0008 #ifdef CONFIG_PPC64
0009 #define HMT_very_low()      asm volatile("or 31, 31, 31 # very low priority")
0010 #define HMT_low()       asm volatile("or 1, 1, 1    # low priority")
0011 #define HMT_medium_low()    asm volatile("or 6, 6, 6    # medium low priority")
0012 #define HMT_medium()        asm volatile("or 2, 2, 2    # medium priority")
0013 #define HMT_medium_high()   asm volatile("or 5, 5, 5    # medium high priority")
0014 #define HMT_high()      asm volatile("or 3, 3, 3    # high priority")
0015 #else
0016 #define HMT_very_low()
0017 #define HMT_low()
0018 #define HMT_medium_low()
0019 #define HMT_medium()
0020 #define HMT_medium_high()
0021 #define HMT_high()
0022 #endif
0023 
0024 #ifdef CONFIG_PPC64
0025 #define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0)
0026 #else
0027 #define cpu_relax() barrier()
0028 #endif
0029 
0030 #endif /* __ASSEMBLY__ */
0031 
0032 #endif /* _ASM_POWERPC_VDSO_PROCESSOR_H */