diff options
| author | CoprDistGit <infra@openeuler.org> | 2026-09-22 08:03:48 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2026-09-22 08:03:48 +0000 |
| commit | 1d32bf4d38af3a99537b02fec7e30819381726e5 (patch) | |
| tree | f5fe9fd8818e66b92d3692c33ad7c5e468a55613 /add-sw_64-support.patch | |
| parent | 2bf73940674385629e4eaed7d9df573671a12256 (diff) | |
automatic import of postgresqlopeneuler24.03_LTS_SP4openeuler24.03_LTS_SP3openeuler24.03_LTS_SP1openeuler24.03_LTSopeneuler22.03_LTS_SP3openeuler20.03_LTS_SP4openeuler20.03
Diffstat (limited to 'add-sw_64-support.patch')
| -rw-r--r-- | add-sw_64-support.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/add-sw_64-support.patch b/add-sw_64-support.patch new file mode 100644 index 0000000..caa0c66 --- /dev/null +++ b/add-sw_64-support.patch @@ -0,0 +1,80 @@ +From ed05d50b808df2bb0d11456515896a40e620389b Mon Sep 17 00:00:00 2001 +From: mahailiang <mahailiang@uniontech.com> +Date: Sat, 15 Mar 2025 11:46:26 +0800 +Subject: [PATCH] add sw_64 support + +--- + contrib/pgcrypto/crypt-blowfish.c | 2 +- + src/include/storage/s_lock.h | 43 +++++++++++++++++++++++++++++++ + 2 files changed, 44 insertions(+), 1 deletion(-) + +diff --git a/contrib/pgcrypto/crypt-blowfish.c b/contrib/pgcrypto/crypt-blowfish.c +index a663852..e6d72b2 100644 +--- a/contrib/pgcrypto/crypt-blowfish.c ++++ b/contrib/pgcrypto/crypt-blowfish.c +@@ -41,7 +41,7 @@ + #ifdef __i386__ + #define BF_ASM 0 /* 1 */ + #define BF_SCALE 1 +-#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) ++#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) || defined(__sw_64__) + #define BF_ASM 0 + #define BF_SCALE 1 + #else +diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h +index 1ada0a8..3afd20e 100644 +--- a/src/include/storage/s_lock.h ++++ b/src/include/storage/s_lock.h +@@ -771,6 +771,49 @@ tas(volatile slock_t *lock) + + #endif /* __sh__ */ + ++#if defined(__sw_64) || defined(__sw_64__) /* sw_64 */ ++#define HAS_TEST_AND_SET ++ ++typedef unsigned long slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register slock_t _res; ++ unsigned long tmp; ++ __asm__ __volatile__( ++ " ldl $0, %1 \n" ++ " bne $0, 2f \n" ++ " ldi %2, %1\n" ++ " lldl %0, 0(%2) \n" ++ " mov 1, $0 \n" ++ " wr_f $0 \n" ++ " memb \n" ++ " lstl $0, 0(%2) \n" ++ " rd_f $0 \n" ++ " bne %0, 2f \n" ++ " beq $0, 2f \n" ++ " memb \n" ++ " br 3f \n" ++ "2: mov 1, %0 \n" ++ "3: \n" ++: "=&r"(_res), "+m"(*lock),"=r" (tmp) ++: ++: "memory", "0"); ++ return (int) _res; ++} ++ ++#define S_UNLOCK(lock) \ ++do \ ++{\ ++ __asm__ __volatile__ (" memb \n"); \ ++ *((volatile slock_t *) (lock)) = 0; \ ++} while (0) ++ ++#endif /* __sw_64 || __sw_64__ */ ++ + + /* These live in s_lock.c, but only for gcc */ + +-- +2.43.5 + |
