getting PostgreSQL to run on superH-based machines

Started by sibu xoloover 17 years ago3 messagesgeneral
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us
In reply to: sibu xolo (#2)
Re: getting PostgreSQL to run on superH-based machines

sibu xolo <sibxol@btconnect.com> writes:

+		"	tas.b  @%1\n\t	\n"
+		"	movt   %0\n\t	\n"
+		"	xor    #1,%0	\n"

Hmm, what is the point of introducing extra blank lines into the asm
output? I would hope those are unnecessary, but one never knows ...

regards, tom lane

#2sibu xolo
sibxol@btconnect.com

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

#3Nobuhiro Iwamatsu
iwamatsu@nigauri.org
In reply to: Tom Lane (#1)
Re: getting PostgreSQL to run on superH-based machines

Hi, all.

Sorry, I did not check these mail....

2009/7/27 Tom Lane <tgl@sss.pgh.pa.us>:

sibu xolo <sibxol@btconnect.com> writes:

+             "       tas.b  @%1\n\t  \n"
+             "       movt   %0\n\t   \n"
+             "       xor    #1,%0    \n"

Hmm, what is the point of introducing extra blank lines into the asm
output?  I would hope those are unnecessary, but one never knows ...

I rewrite patch and test on git/HEAD.
Please wait...

Best regards,
Nobuhiro

--
Nobuhiro Iwamatsu / Debian Developer
iwamatsu at {nigauri.org / debian.org}