getting PostgreSQL to run on superH-based machines

Поиск
Список
Период
Сортировка
Искать

getting PostgreSQL to run on superH-based machines

От:
sibu 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 

+#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

Re: getting PostgreSQL to run on superH-based machines

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
sibu xolo  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

Re: getting PostgreSQL to run on superH-based machines

От:
Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Дата:
Hi, all.

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

2009/7/27 Tom Lane :
> sibu xolo  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}
FAQ