add support for loongarch64 (#851)

This commit is contained in:
Wu Xiaotian
2022-04-18 15:12:30 +08:00
committed by GitHub
parent 047868e359
commit 6ea9991d84
17 changed files with 340 additions and 17 deletions

View File

@ -95,8 +95,8 @@ static __inline__ void easy_spin_lock(easy_atomic_t* lock)
__asm__(".byte 0xf3, 0x90");
#elif defined(__aarch64__)
__asm__("yield"); // for ARM
#elif defined(__sw_64__)
//sw currently not provide related opcode
#elif defined(__sw_64__) || defined(__loongarch64)
// These platforms currently do not natively support such operation
#else
#error arch unsupported
#endif
@ -158,6 +158,8 @@ static __inline__ int easy_spinrwlock_rdlock(easy_spinrwlock_t* lock)
asm("pause");
#elif defined(__aarch64__)
asm("yield"); // for ARM
#elif defined(__sw_64__) || defined(__loongarch64)
// These platforms currently do not natively support such operation
#else
#error arch unsupported
#endif
@ -199,6 +201,8 @@ static __inline__ int easy_spinrwlock_wrlock(easy_spinrwlock_t* lock)
asm("pause");
#elif defined(__aarch64__)
asm("yield"); // for ARM
#elif defined(__sw_64__) || defined(__loongarch64)
// These platforms currently do not natively support such operation
#else
#error arch unsupported
#endif