allocator: Improve MIPS coverage of spinlocks

This commit is contained in:
klzgrad 2019-11-30 22:38:31 +08:00
parent ea8590b377
commit c2e6e49551

View File

@ -17,12 +17,12 @@
#define YIELD_PROCESSOR __asm__ __volatile__("pause") #define YIELD_PROCESSOR __asm__ __volatile__("pause")
#elif (defined(ARCH_CPU_ARMEL) && __ARM_ARCH >= 6) || defined(ARCH_CPU_ARM64) #elif (defined(ARCH_CPU_ARMEL) && __ARM_ARCH >= 6) || defined(ARCH_CPU_ARM64)
#define YIELD_PROCESSOR __asm__ __volatile__("yield") #define YIELD_PROCESSOR __asm__ __volatile__("yield")
#elif defined(ARCH_CPU_MIPSEL) #elif defined(ARCH_CPU_MIPSEL) && __mips_isa_rev < 2
// The MIPS32 docs state that the PAUSE instruction is a no-op on older // The MIPS32 docs state that the PAUSE instruction is a no-op on older
// architectures (first added in MIPS32r2). To avoid assembler errors when // architectures (first added in MIPS32r2). To avoid assembler errors when
// targeting pre-r2, we must encode the instruction manually. // targeting pre-r2, we must encode the instruction manually.
#define YIELD_PROCESSOR __asm__ __volatile__(".word 0x00000140") #define YIELD_PROCESSOR __asm__ __volatile__(".word 0x00000140")
#elif defined(ARCH_CPU_MIPS64EL) && __mips_isa_rev >= 2 #elif defined(ARCH_CPU_MIPS_FAMILY) && __mips_isa_rev >= 2
// Don't bother doing using .word here since r2 is the lowest supported mips64 // Don't bother doing using .word here since r2 is the lowest supported mips64
// that Chromium supports. // that Chromium supports.
#define YIELD_PROCESSOR __asm__ __volatile__("pause") #define YIELD_PROCESSOR __asm__ __volatile__("pause")