Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37889696
en ru br
ALT Linux repos
S:8.2.2.2-alt2

Group :: System/Base
RPM: vdo

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: vdo-8.2.0.2-e2k.patch
Download


From 881532cf197314301eac976e1772f8ed51ae727a Mon Sep 17 00:00:00 2001
From: Alexey Shabalin <shaba@altlinux.org>
Date: Tue, 23 Aug 2022 19:11:16 +0300
Subject: [PATCH] vdo-8.2.0.2 e2k support
e2k support based on patch by Ilya Kurdyukov
---
 utils/uds/atomicDefs.h |  9 +++++++++
 utils/uds/cpu.h        |  2 ++
 2 files changed, 11 insertions(+)
diff --git a/utils/uds/atomicDefs.h b/utils/uds/atomicDefs.h
index 622a985..62d492a 100644
--- a/utils/uds/atomicDefs.h
+++ b/utils/uds/atomicDefs.h
@@ -22,6 +22,9 @@
 
 #include "compiler.h"
 #include "type-defs.h"
+#ifdef __e2k__
+#include <x86intrin.h>
+#endif
 
 // The atomic interfaces are chosen to exactly match those interfaces defined
 // by the Linux kernel.  The rest of this file is the matching user-mode
@@ -95,6 +98,8 @@ static INLINE void smp_mb(void)
   __asm__ __volatile__("bcr 14,0" : : : "memory");
 #elif defined __PPC__
   __asm__ __volatile__("sync" : : : "memory");
+#elif defined __e2k__
+  __builtin_ia32_mfence();
 #else
 #error "no fence defined"
 #endif
@@ -120,6 +125,8 @@ static INLINE void smp_rmb(void)
   __asm__ __volatile__("bcr 14,0" : : : "memory");
 #elif defined __PPC__
   __asm__ __volatile__("lwsync" : : : "memory");
+#elif defined __e2k__
+  __builtin_ia32_lfence();
 #else
 #error "no fence defined"
 #endif
@@ -145,6 +152,8 @@ static INLINE void smp_wmb(void)
   __asm__ __volatile__("bcr 14,0" : : : "memory");
 #elif defined __PPC__
   __asm__ __volatile__("lwsync" : : : "memory");
+#elif defined __e2k__
+  __builtin_ia32_sfence();
 #else
 #error "no fence defined"
 #endif
diff --git a/utils/uds/cpu.h b/utils/uds/cpu.h
index e4b39c2..8f0acd2 100644
--- a/utils/uds/cpu.h
+++ b/utils/uds/cpu.h
@@ -22,6 +22,8 @@
 #define CACHE_LINE_BYTES 256
 #elif defined(__x86_64__) || defined(__aarch64__)
 #define CACHE_LINE_BYTES 64
+#elif defined(__e2k__)
+#define CACHE_LINE_BYTES 64
 #else
 #error "unknown cache line size"
 #endif
--
libgit2 1.3.0
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin