pg.ddx.io  pgsql-ports@postgresql.org mailing list archive  
help / color / mirror / Atom feed
m32r tas() implementation
7+ messages / 5 participants
[nested] [flat]

* m32r tas() implementation
@ 2007-04-14 18:54  Martin Pitt <martin@piware.de>
  0 siblings, 4 replies; 7+ messages in thread

From: Martin Pitt @ 2007-04-14 18:54 UTC (permalink / raw)
  To: pgsql-ports; +Cc: Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>

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

Attachments:

13-m32r-tas.patch (text/x-diff, 525B) download 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 <sys/tas.h> +#define HAS_TEST_AND_SET + +typedef int slock_t; +#define TAS(lock) tas(lock) + +#endif + #endif /* __GNUC__ */
signature.asc (application/pgp-signature, 188B) download ^ permalink raw reply [nested|flat] 7+ messages in thread

* Re: m32r tas() implementation
@ 2007-04-14 22:17  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Martin Pitt <martin@piware.de>
  3 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2007-04-14 22:17 UTC (permalink / raw)
  To: Martin Pitt <martin@piware.de>; +Cc: pgsql-ports@postgresql.org, Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>

Martin Pitt <martin@piware.de> 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
<sys/tas.h> 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 <sys/tas.h> exists, could we use it
regardless of CPU type?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: m32r tas() implementation
@ 2007-04-16 03:40  Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
  parent: Martin Pitt <martin@piware.de>
  3 siblings, 0 replies; 7+ messages in thread

From: Kazuhiro Inaoka @ 2007-04-16 03:40 UTC (permalink / raw)
  To: pgsql-ports@postgresql.org, 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
>
>   




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: m32r tas() implementation
@ 2007-04-24 02:22  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2007-04-24 02:22 UTC (permalink / raw)
  To: Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>; +Cc: Martin Pitt <martin@piware.de>; pgsql-ports

Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> 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 <sys/tas.h> 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



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: m32r tas() implementation
@ 2007-04-24 05:27  Peter Eisentraut <peter_e@gmx.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Eisentraut @ 2007-04-24 05:27 UTC (permalink / raw)
  To: pgsql-ports; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>; Martin Pitt <martin@piware.de>

Tom Lane wrote:
> Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> 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 <sys/tas.h> 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/



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: m32r tas() implementation
@ 2007-04-27 01:21  Bruce Momjian <bruce@momjian.us>
  parent: Martin Pitt <martin@piware.de>
  3 siblings, 0 replies; 7+ messages in thread

From: Bruce Momjian @ 2007-04-27 01:21 UTC (permalink / raw)
  To: Martin Pitt <martin@piware.de>; +Cc: pgsql-ports@postgresql.org, Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>


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  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

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



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: m32r tas() implementation
@ 2007-05-04 15:26  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Martin Pitt <martin@piware.de>
  3 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2007-05-04 15:26 UTC (permalink / raw)
  To: Martin Pitt <martin@piware.de>; +Cc: pgsql-ports@postgresql.org, Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>

Martin Pitt <martin@piware.de> 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 <sys/tas.h>.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2007-05-04 15:26 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-04-14 18:54 m32r tas() implementation Martin Pitt <martin@piware.de>
2007-04-14 22:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2007-04-24 02:22   ` Tom Lane <tgl@sss.pgh.pa.us>
2007-04-24 05:27     ` Peter Eisentraut <peter_e@gmx.net>
2007-04-16 03:40 ` Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
2007-04-27 01:21 ` Bruce Momjian <bruce@momjian.us>
2007-05-04 15:26 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox