m32r tas() implementation

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

m32r tas() implementation

От:
Martin Pitt <martin@piware.de>
Дата:
Вложения:
Hi PostgreSQL developers,

Kazuhiro Inaoka recently sent me a tas() implementation for the m32r
architecture [1]. It applies cleanly to 8.2.3 and seems otherwise
harmless. Do you consider applying it upstream?

Thank you,

Martin

[1] http://en.wikipedia.org/wiki/M32R

-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org
diff -Nur postgresql-8.2/build-tree/postgresql-8.2.3/src/include/storage/s_lock.h postgresql-8.2.new/build-tree/postgresql-8.2.3/src/include/storage/s_lock.h
--- postgresql-8.2.3/src/include/storage/s_lock.h	2006-06-08 00:24:45.000000000 +0200
+++ postgresql-8.2.3/src/include/storage/s_lock.h	2007-04-14 20:50:07.000000000 +0200
@@ -566,6 +566,15 @@
 #endif
 
 
+#if defined(__m32r__)
+#include 
+#define HAS_TEST_AND_SET
+
+typedef int slock_t;
+#define TAS(lock) tas(lock)
+
+#endif
+
 #endif	/* __GNUC__ */
 
 

Re: m32r tas() implementation

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Martin Pitt  writes:
> Kazuhiro Inaoka recently sent me a tas() implementation for the m32r
> architecture [1]. It applies cleanly to 8.2.3 and seems otherwise
> harmless. Do you consider applying it upstream?

The patch seems strongly dependent on an OS as well as a chip, since
 is hardly to be expected to exist everywhere.  Therefore,
it is at least short an #ifdef or so.  More generally I wonder if it's
not going at it backwards: if  exists, could we use it
regardless of CPU type?

			regards, tom lane

Re: m32r tas() implementation

От:
Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
Дата:
Yes, I'm expecting it to be applied to upstream.

Regards,
Kazuhiro Inaoka

Martin Pitt wrote:
> Hi PostgreSQL developers,
>
> Kazuhiro Inaoka recently sent me a tas() implementation for the m32r
> architecture [1]. It applies cleanly to 8.2.3 and seems otherwise
> harmless. Do you consider applying it upstream?
>
> Thank you,
>
> Martin
>
> [1] http://en.wikipedia.org/wiki/M32R
>
>   

Re: m32r tas() implementation

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Kazuhiro Inaoka  writes:
> I'm porting only for Linux on m32r. I think m32r's tas() is depend on 
> glibc's implementation.
> It's a system call now. So  should be used for Linux/m32r only.

Well, my point stands: sys/tas.h is not present on every Linux, so we
need at least another #ifdef here.  I'm not sure what it should be though.

			regards, tom lane

Re: m32r tas() implementation

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
Tom Lane wrote:
> Kazuhiro Inaoka  writes:
> > I'm porting only for Linux on m32r. I think m32r's tas() is depend
> > on glibc's implementation.
> > It's a system call now. So  should be used for
> > Linux/m32r only.
>
> Well, my point stands: sys/tas.h is not present on every Linux, so we
> need at least another #ifdef here.  I'm not sure what it should be
> though.

But every Linux on m32r does have sys/tas.h.  It's among the glibc 
header files for that port.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: m32r tas() implementation

От:
Bruce Momjian <bruce@momjian.us>
Дата:

Your patch has been added to the PostgreSQL unapplied patches list at:

	http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------


Martin Pitt wrote:
-- Start of PGP signed section.
> Hi PostgreSQL developers,
> 
> Kazuhiro Inaoka recently sent me a tas() implementation for the m32r
> architecture [1]. It applies cleanly to 8.2.3 and seems otherwise
> harmless. Do you consider applying it upstream?
> 
> Thank you,
> 
> Martin
> 
> [1] http://en.wikipedia.org/wiki/M32R
> 
> -- 
> Martin Pitt        http://www.piware.de
> Ubuntu Developer   http://www.ubuntu.com
> Debian Developer   http://www.debian.org

-- End of PGP section, PGP failed!

-- 
  Bruce Momjian            http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Re: m32r tas() implementation

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Martin Pitt  writes:
> Kazuhiro Inaoka recently sent me a tas() implementation for the m32r
> architecture [1]. It applies cleanly to 8.2.3 and seems otherwise
> harmless. Do you consider applying it upstream?

Applied with addition of a configure probe for .

			regards, tom lane
FAQ