getting PostgreSQL to run on superH-based machines

From: sibu xolo <sibxol(at)btconnect(dot)com>
To: pgsql-general(at)postgresql(dot)org, Nobuhiro Iwamatsu <iwamatsu(at)nigauri(dot)org>
Subject: getting PostgreSQL to run on superH-based machines
Date: 2009-07-26 19:08:37
Message-ID: 200907262008.37224.sibxol@btconnect.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

I am interested in using the PostgreSQL on machines with Renesas
(formerly Hitachi) superH4A-based processors. I checked with the literature
and noted from this URL (
http://developer.postgresql.org/pgdocs/postgres/supported-platforms.html )
that the superH family does not appear to be supported.

I also noted that that a Nobuhiro Iwamatsu 5th April 2008 submitted a
patch (
http://www.mail-archive.com/pgsql-patches%40postgresql.org/msg19890.html )
for the file (~/include/server/storage/s_lock.h ) to rectify the
lack-of-support-for-the-superH-problem. I noticed that the patch was not
accepted/applied
(http://wiki.postgresql.org/wiki/CommitFest_2008-05 ) "waiting on the author"
and mentioning these objections:-

"Another question: this asm declaration ignores the advice given at lines
89-107 of s_lock.h, both cosmetic and substantive."

Over 15 months hence, there does not seem to be any communication on this
matter between the patch's author and the 'patch-committers' of the
Postgresql community. Accordingly without wishing to be presumptuous the
above advice is followed and the edited snippet for patching the file
(~/include/server/storage/s_lock.h ) is submitted below:-

################### Nobuhiro Iwamatsu <iwamatsu(at)nigauri(dot)org>

+#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 \n"
+ " movt %0\n\t \n"
+ " xor #1,%0 \n"
+: "=r"(_res), "+m"(*lock)
+: "r"(lock)
+: "t","memory");
+ return (int) _res;
+}
+
+#endif /* __sh__ */

##################

I hope if the minor changes answer the queries the patch is attributed
to the original author Nobuhiro Iwamatsu; my interest extends only to see
Postgresql running on superH-based machines as soon as possible.

Feedback will be much appreciated

Yours sincerely
SibuXolo

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nick Boutelier 2009-07-26 19:30:22 Re: Is there a RECORD[] type in plpgsql?
Previous Message Ivan Sergio Borgonovo 2009-07-26 18:32:58 Constraint between 2 tables and taking a coherent snapshot of both