diff --git a/cmake/Env.cmake b/cmake/Env.cmake index e028eafff9b175041ef2488fffbf40e0c41a9a1b..ead5127fc3ef1bc669aad589a02f59e16caa1c23 100644 --- a/cmake/Env.cmake +++ b/cmake/Env.cmake @@ -119,6 +119,9 @@ elseif(${ARCHITECTURE} STREQUAL "aarch64") set(MARCH_CFLAGS "-march=armv8-a+crc" ) set(MTUNE_CFLAGS "-mtune=generic" ) set(ARCH_LDFLAGS "-latomic") +elseif(${ARCHITECTURE} STREQUAL "loongarch64") + set(MARCH_CFLAGS "-march=la464" ) + set(MTUNE_CFLAGS "-mabi=lp64d" ) else() message(FATAL_ERROR "UNSUPPORT BUILD ARCH: ${ARCHITECTURE}") endif() diff --git a/deps/easy/src/include/easy_atomic.h b/deps/easy/src/include/easy_atomic.h index 4b07388d9c32bab3daf6641c836b610a64b3e4f7..fcefdcba9510c079fa3fbe4b49bd805de11159e8 100644 --- a/deps/easy/src/include/easy_atomic.h +++ b/deps/easy/src/include/easy_atomic.h @@ -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 diff --git a/deps/easy/src/io/ev.c b/deps/easy/src/io/ev.c index 888cf273cdade726bacb11465c9fa88cfec38d55..43235d9d414416aa66d970d9a8ab8a38d7b86bf2 100644 --- a/deps/easy/src/io/ev.c +++ b/deps/easy/src/io/ev.c @@ -531,7 +531,7 @@ EV_CPP(extern "C" { #define ev_mb() __asm__ __volatile ("mfence" ::: "memory") #elif defined(__aarch64__) #define ev_mb() __asm__ __volatile ("dsb sy" ::: "memory") //for ARM -#elif defined(__sw_64__) +#elif defined(__sw_64__) || defined(__loongarch64) #define ev_mb() __sync_synchronize() #else #error arch unsupported diff --git a/deps/easy/src/util/easy_time.c b/deps/easy/src/util/easy_time.c index 9d6343a667b94b1f0b4fc0359ff7705237846911..2fd32d4de3ae1edc6172d179618097b407518db4 100644 --- a/deps/easy/src/util/easy_time.c +++ b/deps/easy/src/util/easy_time.c @@ -139,7 +139,7 @@ static __inline__ uint64_t rdtscp() __asm__ __volatile__("rdtscp" : "=a"(rax), "=d"(rdx)::"%rcx"); return (rdx << 32) + rax; } -#elif defined(__sw_64__) +#elif defined(__sw_64__) || defined(__loongarch64) static __inline__ uint64_t rdtsc() { return (uint64_t)easy_time_now(); @@ -163,7 +163,7 @@ static __inline__ uint64_t rdtsc() #endif -#if defined(__x86_64__) || defined(__sw_64__) +#if defined(__x86_64__) || defined(__sw_64__) || defined(__loongarch64) uint64_t get_cpufreq_khz() { char line[256]; diff --git a/deps/oblib/src/lib/CMakeLists.txt b/deps/oblib/src/lib/CMakeLists.txt index fb95aec563a15ef5671273a258008b4b1e5ac39a..fb8abd0a65e770d1a61a318ac46c735c0cc99714 100644 --- a/deps/oblib/src/lib/CMakeLists.txt +++ b/deps/oblib/src/lib/CMakeLists.txt @@ -26,6 +26,9 @@ ob_lib_add_target(oblib_lib_coro_context coro/context/asm/make_sw_64_sysv_elf_gas.S coro/context/asm/jump_sw_64_sysv_elf_gas.S coro/context/asm/ontop_sw_64_aapcs_elf_gas.S + coro/context/asm/jump_loongarch64_sysv_elf_gas.S + coro/context/asm/make_loongarch64_sysv_elf_gas.S + coro/context/asm/ontop_loongarch64_sysv_elf_gas.S ) disable_pch(oblib_lib_coro_context) diff --git a/deps/oblib/src/lib/async/ev.c b/deps/oblib/src/lib/async/ev.c index 2414d70a6d463d6ebe1ed4c15475d87792b38e1b..b3394aff69e9e3e638a85d7772a41b2cc0d1ed27 100644 --- a/deps/oblib/src/lib/async/ev.c +++ b/deps/oblib/src/lib/async/ev.c @@ -711,6 +711,8 @@ struct signalfd_siginfo #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("") #elif defined __ia64__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mf" : : : "memory") + #elif defined __loongarch__ + #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dbar 0" : : : "memory") #elif defined __m68k__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory") #elif defined __m88k__ diff --git a/deps/oblib/src/lib/atomic/atomic128.h b/deps/oblib/src/lib/atomic/atomic128.h index 7f2ca616a0d03eb11cfa464c564046c71f68c261..846f4c64bd316922998d5d114e4424fa1c52f039 100644 --- a/deps/oblib/src/lib/atomic/atomic128.h +++ b/deps/oblib/src/lib/atomic/atomic128.h @@ -85,7 +85,7 @@ inline void load128(__uint128_t& target, types::uint128_t* source) __ATOMIC_SEQ_CST) #define LOAD128(dest, src) __atomic_load(((types::uint128_t*)(src)), ((types::uint128_t*)(&(dest))), __ATOMIC_SEQ_CST) -#elif defined(__sw_64__) +#elif defined(__sw_64__) || defined(__loongarch64) inline bool cas128(volatile types::uint128_t* target, types::uint128_t* cmp, types::uint128_t with) { int ret = 0; diff --git a/deps/oblib/src/lib/atomic/ob_atomic.h b/deps/oblib/src/lib/atomic/ob_atomic.h index 14b0a74e9184392185f8a17a38c4a46ff92e33d7..c760ffa5eef726343b8de2fb1362126c8339bb8b 100644 --- a/deps/oblib/src/lib/atomic/ob_atomic.h +++ b/deps/oblib/src/lib/atomic/ob_atomic.h @@ -36,7 +36,7 @@ namespace common { OB_ATOMIC_EVENT(atomic_pause); \ asm("yield\n"); \ }) // for ARM -#elif defined(__sw_64__) +#elif defined(__sw_64__) || defined(__loongarch64) #define WEAK_BARRIER() __sync_synchronize() #define PAUSE() #else diff --git a/deps/oblib/src/lib/checksum/ob_crc64.cpp b/deps/oblib/src/lib/checksum/ob_crc64.cpp index 5e8b0cacefedcf26ccfd346dca69ac9ec1652a7f..6346ceecccef1efb6c40903f40b0543a96974caa 100644 --- a/deps/oblib/src/lib/checksum/ob_crc64.cpp +++ b/deps/oblib/src/lib/checksum/ob_crc64.cpp @@ -422,6 +422,9 @@ for RHEL4 support (GCC 3 doesn't support this instruction) */ #define crc32_sse42_byte \ crc = __crc32cb(crc, (uint8_t)*buf); \ len--, buf++ +#elif defined(__loongarch64) +#define crc32_sse42_byte nullptr +#define crc32_sse42_quadword nullptr #elif defined(__sw_64__) #define crc32_sse42_byte nullptr @@ -2849,7 +2852,7 @@ uint64_t crc64_sse42_dispatch(uint64_t crc, const char* buf, int64_t len) ob_crc64_sse42_func = &fast_crc64_sse42_manually; _OB_LOG(INFO, "Use manual crc32 table lookup for crc64 calculate"); #endif -#elif defined(__sw_64__) +#elif defined(__sw_64__) || defined(__loongarch64) ob_crc64_sse42_func = &fast_crc64_sse42_manually; _OB_LOG(INFO, "Use manual crc32 table lookup for crc64 calculate"); #else diff --git a/deps/oblib/src/lib/coro/co_utils.h b/deps/oblib/src/lib/coro/co_utils.h index 2d492631f2402d327878737c86e444afb421e865..cb457dd7a2a8633b12f944ad2ead422b080cc82c 100644 --- a/deps/oblib/src/lib/coro/co_utils.h +++ b/deps/oblib/src/lib/coro/co_utils.h @@ -73,7 +73,7 @@ OB_INLINE int64_t co_current_time() return now; } -#if defined(__x86_64__) +#if defined(__loongarch64) || defined(__sw_64__) || defined(__x86_64__) OB_INLINE uint64_t co_rdtscp(void) { return co_current_time() * 1000; @@ -86,11 +86,6 @@ OB_INLINE uint64_t co_rdtscp(void) asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); return virtual_timer_value; } -#elif defined(__sw_64__) -OB_INLINE uint64_t co_rdtscp(void) -{ - return co_current_time() * 1000; -} #else #error arch unsupported #endif diff --git a/deps/oblib/src/lib/coro/context/asm/jump_loongarch64_sysv_elf_gas.S b/deps/oblib/src/lib/coro/context/asm/jump_loongarch64_sysv_elf_gas.S new file mode 100644 index 0000000000000000000000000000000000000000..85dc26ac58bf95a55b90dcd4c442d30744e3f0f0 --- /dev/null +++ b/deps/oblib/src/lib/coro/context/asm/jump_loongarch64_sysv_elf_gas.S @@ -0,0 +1,121 @@ +/******************************************************* + * * + * ------------------------------------------------- * + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * + * ------------------------------------------------- * + * | 0 | 8 | 16 | 24 | * + * ------------------------------------------------- * + * | FS0 | FS1 | FS2 | FS3 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * + * ------------------------------------------------- * + * | 32 | 40 | 48 | 56 | * + * ------------------------------------------------- * + * | FS4 | FS5 | FS6 | FS7 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * + * ------------------------------------------------- * + * | 64 | 72 | 80 | 88 | * + * ------------------------------------------------- * + * | S0 | S1 | S2 | S3 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * + * ------------------------------------------------- * + * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * + * ------------------------------------------------- * + * | S4 | S5 | S6 | S7 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * + * ------------------------------------------------- * + * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * + * ------------------------------------------------- * + * | S8 | FP | RA | PC | * + * ------------------------------------------------- * + * * + * *****************************************************/ + +.file "jump_loongarch64_sysv_elf_gas.S" +.text +.globl jump_fcontext +.align 2 +.type jump_fcontext,@function +jump_fcontext: + # reserve space on stack + addi.d $sp, $sp, -160 + + # save fs0 - fs7 + fst.d $fs0, $sp, 0 + fst.d $fs1, $sp, 8 + fst.d $fs2, $sp, 16 + fst.d $fs3, $sp, 24 + fst.d $fs4, $sp, 32 + fst.d $fs5, $sp, 40 + fst.d $fs6, $sp, 48 + fst.d $fs7, $sp, 56 + + # save s0 - s8, fp, ra + st.d $s0, $sp, 64 + st.d $s1, $sp, 72 + st.d $s2, $sp, 80 + st.d $s3, $sp, 88 + st.d $s4, $sp, 96 + st.d $s5, $sp, 104 + st.d $s6, $sp, 112 + st.d $s7, $sp, 120 + st.d $s8, $sp, 128 + st.d $fp, $sp, 136 + st.d $ra, $sp, 144 + + # save RA as PC + st.d $ra, $sp, 152 + + # store SP (pointing to context-data) in A2 + move $a2, $sp + + # restore SP (pointing to context-data) from A0 + move $sp, $a0 + + # load fs0 - fs7 + fld.d $fs0, $sp, 0 + fld.d $fs1, $sp, 8 + fld.d $fs2, $sp, 16 + fld.d $fs3, $sp, 24 + fld.d $fs4, $sp, 32 + fld.d $fs5, $sp, 40 + fld.d $fs6, $sp, 48 + fld.d $fs7, $sp, 56 + + #load s0 - s8, fp, ra + ld.d $s0, $sp, 64 + ld.d $s1, $sp, 72 + ld.d $s2, $sp, 80 + ld.d $s3, $sp, 88 + ld.d $s4, $sp, 96 + ld.d $s5, $sp, 104 + ld.d $s6, $sp, 112 + ld.d $s7, $sp, 120 + ld.d $s8, $sp, 128 + ld.d $fp, $sp, 136 + ld.d $ra, $sp, 144 + + # return transfer_t from jump + # pass transfer_t as first arg in context function + # a0 == FCTX, a1 == DATA + move $a0, $a2 + + # load PC + ld.d $a2, $sp, 152 + + # restore stack + addi.d $sp, $sp, 160 + + # jump to context + jr $a2 +.size jump_fcontext, .-jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/deps/oblib/src/lib/coro/context/asm/make_loongarch64_sysv_elf_gas.S b/deps/oblib/src/lib/coro/context/asm/make_loongarch64_sysv_elf_gas.S new file mode 100644 index 0000000000000000000000000000000000000000..55062702f18d62203b9e8589953c471869b0d332 --- /dev/null +++ b/deps/oblib/src/lib/coro/context/asm/make_loongarch64_sysv_elf_gas.S @@ -0,0 +1,72 @@ +/******************************************************* + * * + * ------------------------------------------------- * + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * + * ------------------------------------------------- * + * | 0 | 8 | 16 | 24 | * + * ------------------------------------------------- * + * | FS0 | FS1 | FS2 | FS3 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * + * ------------------------------------------------- * + * | 32 | 40 | 48 | 56 | * + * ------------------------------------------------- * + * | FS4 | FS5 | FS6 | FS7 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * + * ------------------------------------------------- * + * | 64 | 72 | 80 | 88 | * + * ------------------------------------------------- * + * | S0 | S1 | S2 | S3 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * + * ------------------------------------------------- * + * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * + * ------------------------------------------------- * + * | S4 | S5 | S6 | S7 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * + * ------------------------------------------------- * + * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * + * ------------------------------------------------- * + * | S8 | FP | RA | PC | * + * ------------------------------------------------- * + * * + * *****************************************************/ + +.file "make_loongarch64_sysv_elf_gas.S" +.text +.globl make_fcontext +.align 2 +.type make_fcontext,@function +make_fcontext: + # shift address in A0 to lower 16 byte boundary + bstrins.d $a0, $zero, 3, 0 + + # reserve space for context-data on context-stack + addi.d $a0, $a0, -160 + + # third arg of make_fcontext() == address of context-function + st.d $a2, $a0, 152 + + # save address of finish as return-address for context-function + # will be entered after context-function returns + la.local $a4, finish + st.d $a4, $a0, 144 + + # return pointer to context-data + jr $ra + +finish: + # exit code is zero + li.d $a0, 0 + # call _exit(0) + b %plt(_exit) + +.size make_fcontext, .-make_fcontext +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/deps/oblib/src/lib/coro/context/asm/ontop_loongarch64_sysv_elf_gas.S b/deps/oblib/src/lib/coro/context/asm/ontop_loongarch64_sysv_elf_gas.S new file mode 100644 index 0000000000000000000000000000000000000000..c6ea04485793a9c65290bfe8b7c0e127ffc00a2c --- /dev/null +++ b/deps/oblib/src/lib/coro/context/asm/ontop_loongarch64_sysv_elf_gas.S @@ -0,0 +1,118 @@ +/******************************************************* + * * + * ------------------------------------------------- * + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * + * ------------------------------------------------- * + * | 0 | 8 | 16 | 24 | * + * ------------------------------------------------- * + * | FS0 | FS1 | FS2 | FS3 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * + * ------------------------------------------------- * + * | 32 | 40 | 48 | 56 | * + * ------------------------------------------------- * + * | FS4 | FS5 | FS6 | FS7 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * + * ------------------------------------------------- * + * | 64 | 72 | 80 | 88 | * + * ------------------------------------------------- * + * | S0 | S1 | S2 | S3 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * + * ------------------------------------------------- * + * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * + * ------------------------------------------------- * + * | S4 | S5 | S6 | S7 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * + * ------------------------------------------------- * + * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * + * ------------------------------------------------- * + * | S8 | FP | RA | PC | * + * ------------------------------------------------- * + * * + * *****************************************************/ + +.file "ontop_loongarch64_sysv_elf_gas.S" +.text +.globl ontop_fcontext +.align 2 +.type ontop_fcontext,@function +ontop_fcontext: + # reserve space on stack + addi.d $sp, $sp, -160 + + # save fs0 - fs7 + fst.d $fs0, $sp, 0 + fst.d $fs1, $sp, 8 + fst.d $fs2, $sp, 16 + fst.d $fs3, $sp, 24 + fst.d $fs4, $sp, 32 + fst.d $fs5, $sp, 40 + fst.d $fs6, $sp, 48 + fst.d $fs7, $sp, 56 + + # save s0 - s8, fp, ra + st.d $s0, $sp, 64 + st.d $s1, $sp, 72 + st.d $s2, $sp, 80 + st.d $s3, $sp, 88 + st.d $s4, $sp, 96 + st.d $s5, $sp, 104 + st.d $s6, $sp, 112 + st.d $s7, $sp, 120 + st.d $s8, $sp, 128 + st.d $fp, $sp, 136 + st.d $ra, $sp, 144 + + # save RA as PC + st.d $ra, $sp, 152 + + # store SP (pointing to context-data) in A3 + move $a3, $sp + + # restore SP (pointing to context-data) from A0 + move $sp, $a0 + + # load fs0 - fs11 + fld.d $fs0, $sp, 0 + fld.d $fs1, $sp, 8 + fld.d $fs2, $sp, 16 + fld.d $fs3, $sp, 24 + fld.d $fs4, $sp, 32 + fld.d $fs5, $sp, 40 + fld.d $fs6, $sp, 48 + fld.d $fs7, $sp, 56 + + #load s0 - s11, fp, ra + ld.d $s0, $sp, 64 + ld.d $s1, $sp, 72 + ld.d $s2, $sp, 80 + ld.d $s3, $sp, 88 + ld.d $s4, $sp, 96 + ld.d $s5, $sp, 104 + ld.d $s6, $sp, 112 + ld.d $s7, $sp, 120 + ld.d $s8, $sp, 128 + ld.d $fp, $sp, 136 + ld.d $ra, $sp, 144 + + # return transfer_t from jump + # pass transfer_t as first arg in context function + # a0 == FCTX, a1 == DATA + move $a0, $a3 + + # adjust stack + addi.d $sp, $sp, 160 + + # jump to context + jr $a2 +.size ontop_fcontext, .-ontop_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/deps/oblib/src/lib/list/ob_atomic_list.h b/deps/oblib/src/lib/list/ob_atomic_list.h index 4f02fb411a26686925a0e820da0b24c9abcdd3b2..6b6fd7e3087cf8be25c214ebbc01e51543336976 100644 --- a/deps/oblib/src/lib/list/ob_atomic_list.h +++ b/deps/oblib/src/lib/list/ob_atomic_list.h @@ -104,7 +104,7 @@ union ObHeadNode { #define FREELIST_VERSION(x) ((static_cast((x).data_)) >> 48) #define SET_FREELIST_POINTER_VERSION(x, p, v) \ (x).data_ = (((reinterpret_cast(p)) & 0x0000FFFFFFFFFFFFULL) | (((v)&0xFFFFULL) << 48)) -#elif defined(__sw_64__) +#elif defined(__sw_64__) || defined(__loongarch64) #define FREELIST_POINTER(x) \ (reinterpret_cast((((static_cast((x).data_)) << 16) >> 16) | \ (((~(((static_cast((x).data_)) << 16 >> 63) - 1)) >> 48) << 48))) // sign extend diff --git a/deps/oblib/src/lib/utility/utility.h b/deps/oblib/src/lib/utility/utility.h index c55148bb961f6d386742bc0ce5a5fcbeabcac280..7be3e55f8aad13302c6978b55899bc8be9b0fe54 100644 --- a/deps/oblib/src/lib/utility/utility.h +++ b/deps/oblib/src/lib/utility/utility.h @@ -444,6 +444,8 @@ inline bool is_cpu_support_sse42() return 0 != (data & CPUID_STD_SSE4_2); #elif defined(__aarch64__) return 0; +#elif defined(__loongarch64) + return 0; #elif defined(__sw_64__) return 0; #else diff --git a/src/election/ob_election.h b/src/election/ob_election.h index 8d1b3c0091f39df053d92b2f8e65bd3ce0dfe0de..158ca727059814bcc451538a21ef758efdc65333 100644 --- a/src/election/ob_election.h +++ b/src/election/ob_election.h @@ -384,7 +384,7 @@ private: typedef common::RWLock::RLockGuard RLockGuard; typedef common::RWLock::WLockGuard WLockGuard; mutable common::RWLock lock_; -#elif defined(__sw_64__) +#elif defined(__sw_64__) || defined(__loongarch64) typedef common::SpinRLockGuard RLockGuard; typedef common::SpinWLockGuard WLockGuard; mutable common::SpinRWLock lock_; diff --git a/src/election/ob_election_group.h b/src/election/ob_election_group.h index d211b609a2da88edabf8eb636b73308542345033..aca85cfeef4e006f5072ad1653fd369b8a2e6ddb 100644 --- a/src/election/ob_election_group.h +++ b/src/election/ob_election_group.h @@ -307,7 +307,7 @@ private: typedef common::RWLock::RLockGuard RLockGuard; typedef common::RWLock::WLockGuard WLockGuard; mutable common::RWLock lock_; -#elif defined(__sw_64__) +#elif defined(__sw_64__) || defined(__loongarch64) typedef common::RWLock::RLockGuard RLockGuard; typedef common::RWLock::WLockGuard WLockGuard; mutable common::RWLock lock_;