Skip site navigation (1) Skip section navigation (2)

[PATCH] sh: Add support Renesas SuperH

From: Nobuhiro Iwamatsu <iwamatsu(at)nigauri(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Cc: iwamatsu(at)nigauri(dot)org
Subject: [PATCH] sh: Add support Renesas SuperH
Date: 2008-04-05 06:08:05
Message-ID: 20080405150805.8e7585c4.iwamatsu@nigauri.org (view raw or flat)
Thread:
Lists: pgsql-patches
Hi, all.

I want to use Postgresql on Reneas SuperH.
However, this has not supported SuperH yet. 
I wrote the patch to support it.
 
Please apply. 

Best regards,
 Nobuhiro

# please CC me, i'm not on the list. 

---
This patch support slock_t and tas function for Renesas SuperH.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu(at)nigauri(dot)org>
---
 src/include/storage/s_lock.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index b06bd1b..4a8da8a 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -567,6 +567,29 @@ typedef int slock_t;
 
 #endif /* __m32r__ */
 
+#if defined(__sh__) /* Renesas SuperH */
+#define HAS_TEST_AND_SET
+
+typedef unsigned char slock_t;
+
+#define TAS(lock) tas(lock)
+
+static __inline__ int
+tas(volatile slock_t *lock)
+{
+	register slock_t _res = 1;
+
+	__asm__ __volatile__(
+		"tas.b  @%1\n\t"
+		"movt   %0\n\t"
+		"xor    #1,%0"
+:		"=z"(_res)
+:		"r"(lock)
+:		"t","memory");
+	return (int) _res;
+}
+
+#endif  /* __sh__ */
 
 /* These live in s_lock.c, but only for gcc */
 
-- 
1.5.4.4

Responses

pgsql-patches by date

Next:From: Pavel StehuleDate: 2008-04-05 11:57:59
Subject: plpgsql CASE statement - last version
Previous:From: Zdenek KotalaDate: 2008-04-05 04:50:08
Subject: Re: Headers dependencies cleanup

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group