Re: 64-bit pgsql

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Jeroen Ruigrok/asmodai" <asmodai(at)wxs(dot)nl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 64-bit pgsql
Date: 2003-09-10 22:32:27
Message-ID: 200309102232.h8AMWR400918@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeroen Ruigrok/asmodai wrote:
> -On [20030905 20:52], Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> >Alternatively, find out what symbols your compiler predeclares.
> >If my theory is right then your pg_config_os.h file is failing to
> >define HAS_TEST_AND_SET; why?
>
> Indeed, pg_config_os.h does not set anything for __ia64__.
>
> When I added definitions for Itanium and Opteron to the
> src/include/port/freebsd.h (attached) I get the following:

This post brings up a problem with our configuration system. Right now,
we test for compiler flags and set HAS_TEST_AND_SET based on the CPU in
each include/port/{os}.h file. However, this requires us to know about
each CPU enabled on each OS, and requires us to add duplicate
CPU-specific code for each platform. See below for FreeBSD:

--- freebsd.h.orig Fri Sep 5 21:38:06 2003
+++ freebsd.h Fri Sep 5 21:41:38 2003
@@ -44,5 +44,14 @@
#if defined(__powerpc__)
#define HAS_TEST_AND_SET
typedef unsigned int slock_t;
+#endif

+#if defined(__ia64__)
+#define HAS_TEST_AND_SET
+typedef unsigned int slock_t;
+#endif
+
+#if defined(__x64_64__)
+#define HAS_TEST_AND_SET
+typedef unsigned int slock_t;
#endif

For example, we will need the last two defines for all platforms that
support Intel. I wonder if we should have the HAS_TEST_AND_SET defined
in s_lock.h where the actual test-and-set is defined. This would
eliminate redundancy, and fix the FreeBSD problem reported with
Opteron/Itanium. I think we still need an slock_t typedef, but it is
probably the same for all CPU's on that platform.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ron Mayer 2003-09-10 22:43:56 Re: Broken(?) 'interval' problems. [Was: ISO 8601 "Time Intervals"]
Previous Message Alvaro Herrera 2003-09-10 22:24:47 Dropping users