]> source.dussan.org Git - rspamd.git/commitdiff
Add support for loongarch 4704/head
authorwuruilong <wuruilong@loongson.cn>
Thu, 16 Nov 2023 07:25:40 +0000 (07:25 +0000)
committerwuruilong <wuruilong@loongson.cn>
Thu, 16 Nov 2023 07:25:40 +0000 (07:25 +0000)
cmake/FindArch.cmake
contrib/backward-cpp/backward.hpp
contrib/libev/ev.c
src/rspamd.c

index d1defc82bea255d5e79300dfd6b87c4c6e8e6ddf..e172207371d3a262860db4a75550711010b87417 100644 (file)
@@ -35,6 +35,8 @@ set(archdetect_c_code "
     #else
         #error cmake_ARCH ppc
     #endif
+#elif defined(__loongarch__) || defined(__loongarch64)
+    #error cmake_ARCH loongarch64
 #endif
 
 #error cmake_ARCH unknown
index ce725559b6a0a767d3fb8ca13a8baae9dd55b7d1..ca09b72179ed56c45ab8e27bfcc7fac457d0c80c 100644 (file)
@@ -4222,6 +4222,8 @@ public:
     #else
       error_addr = reinterpret_cast<void *>(uctx->uc_mcontext.pc);
     #endif
+#elif defined(__loongarch__)
+    error_addr = reinterpret_cast<void *>(uctx->uc_mcontext.__pc);
 #elif defined(__mips__)
     error_addr = reinterpret_cast<void *>(
         reinterpret_cast<struct sigcontext *>(&uctx->uc_mcontext)->sc_pc);
index 8657aa96ee2aa28cbd16322a4ec645cb546f003e..230445d2acce88de71b329ae301750c3441f1a6b 100644 (file)
@@ -843,6 +843,8 @@ struct signalfd_siginfo
       #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("tb1 0,%%r0,128" : : : "memory")
     #elif defined __sh__
       #define ECB_MEMORY_FENCE         __asm__ __volatile__ (""         : : : "memory")
+    #elif defined __loongarch__ || __loongarch64
+      #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("dbar %0 ": : "I"(0) : "memory")
     #endif
   #endif
 #endif
index df08f54104eb88d944bfc27615d2540823fa13c2..b8523b44b50353594d118b52b4b3a9b7f8029c6a 100644 (file)
@@ -1279,6 +1279,8 @@ get_cpu_architecture(void)
        return "ARM64";
 #elif defined(__arm__) || defined(_M_ARM)
        return "ARM";
+#elif defined(__loongarch__) || defined(__loongarch64)
+       return "LOONGARCH64";
 #elif defined(__mips__)
        return "MIPS";
 #elif defined(__powerpc__) || defined(_M_PPC)