getting PostgreSQL to run on superH-based machines - Mailing list pgsql-general

From sibu xolo
Subject getting PostgreSQL to run on superH-based machines
Date
Msg-id 200907262008.37224.sibxol@btconnect.com
Whole thread Raw
Responses Re: getting PostgreSQL to run on superH-based machines
List 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

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Implicit sequence with start value?
Next
From: Tom Lane
Date:
Subject: Re: getting PostgreSQL to run on superH-based machines