[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#548847: postgresql: Please port to SH4



Package: postgresql
Version: 8.4.1-1
Severity: wishlist
Tags: patch
User: debian-sh4@superh.org
Usertags: sh4

Hi,

I am now trying to run Debian on Renesas SH CPU(sh4).
Current postgresql package doesn't support sh4.
I made a patch to revise to be able to build.
I attach patch and test log.
Would you apply it?

I will send patch to upstream on git/HEAD.

Best regards,
  Nobuhiro
rm -rf ./testtablespace
mkdir ./testtablespace
./pg_regress --inputdir=. --dlpath=. --multibyte=SQL_ASCII --load-language=plpgsql  --temp-install=./tmp_check --top-builddir=../../.. --schedule=./parallel_schedule
============== creating temporary installation        ==============
============== initializing database system           ==============
============== starting postmaster                    ==============
running on port 64017 with pid 10275
============== creating database "regression"         ==============
CREATE DATABASE
ALTER DATABASE
============== installing plpgsql                     ==============
CREATE LANGUAGE
============== running regression test queries        ==============
parallel group (17 tests):  text name oid float4 varchar char money float8 int2 int4 txid uuid boolean int8 bit enum numeric
     boolean              ... ok
     char                 ... ok
     name                 ... ok
     varchar              ... ok
     text                 ... ok
     int2                 ... ok
     int4                 ... ok
     int8                 ... ok
     oid                  ... ok
     float4               ... ok
     float8               ... ok
     bit                  ... ok
     numeric              ... ok
     txid                 ... ok
     uuid                 ... ok
     enum                 ... ok
     money                ... ok
test strings              ... ok
test numerology           ... ok
parallel group (19 tests):  comments lseg tinterval path reltime point timetz macaddr polygon box circle interval abstime time date inet timestamptz tstypes timestamp
     point                ... ok
     lseg                 ... ok
     box                  ... ok
     path                 ... ok
     polygon              ... ok
     circle               ... ok
     date                 ... ok
     time                 ... ok
     timetz               ... ok
     timestamp            ... ok
     timestamptz          ... ok
     interval             ... ok
     abstime              ... ok
     reltime              ... ok
     tinterval            ... ok
     inet                 ... ok
     macaddr              ... ok
     tstypes              ... ok
     comments             ... ok
parallel group (5 tests):  geometry type_sanity oidjoins horology opr_sanity
     geometry             ... ok
     horology             ... ok
     oidjoins             ... ok
     type_sanity          ... ok
     opr_sanity           ... ok
test insert               ... ok
test create_function_1    ... ok
test create_type          ... ok
test create_table         ... ok

test create_function_2    ... ok
parallel group (2 tests):  copyselect copy
     copy                 ... ok
     copyselect           ... ok
parallel group (9 tests):  create_operator create_aggregate create_cast drop_if_exists vacuum constraints triggers create_misc inherit
     constraints          ... ok
     triggers             ... ok
     create_misc          ... ok
     create_aggregate     ... ok
     create_operator      ... ok
     inherit              ... ok
     vacuum               ... ok
     drop_if_exists       ... ok
     create_cast          ... ok
parallel group (2 tests):  create_view create_index
     create_index         ... ok
     create_view          ... ok
test sanity_check         ... ok
test errors               ... ok
test select               ... ok
parallel group (20 tests):  select_distinct select_distinct_on btree_index random hash_index select_into select_implicit namespace update select_having delete case prepared_xacts union arrays subselect trans
actions portals aggregates join
     select_into          ... ok
     select_distinct      ... ok
     select_distinct_on   ... ok
     select_implicit      ... ok
     select_having        ... ok
     subselect            ... ok
     union                ... ok
     case                 ... ok
     join                 ... ok
     aggregates           ... ok
     transactions         ... ok
     random               ... ok
     portals              ... ok
     arrays               ... ok
     btree_index          ... ok
     hash_index           ... ok
     update               ... ok
     namespace            ... ok
     prepared_xacts       ... ok
     delete               ... ok
test privileges           ... ok

test misc                 ... ok
parallel group (13 tests):  portals_p2 combocid tsdicts guc dependency select_views window tsearch foreign_data cluster bitmapops rules foreign_key
     select_views         ... ok
     portals_p2           ... ok
     rules                ... ok
     foreign_key          ... ok
     cluster              ... ok
     dependency           ... ok
     guc                  ... ok
     bitmapops            ... ok
     combocid             ... ok
     tsearch              ... ok
     tsdicts              ... ok
     foreign_data         ... ok
     window               ... ok
parallel group (19 tests):  limit prepare conversion xml sequence with rowtypes copy2 temp returning plancache without_oid polymorphism largeobject truncate domain rangefuncs alter_table plpgsql
     plancache            ... ok
     limit                ... ok
     plpgsql              ... ok
     copy2                ... ok
     temp                 ... ok
     domain               ... ok
     rangefuncs           ... ok
     prepare              ... ok
     without_oid          ... ok
     conversion           ... ok
     truncate             ... ok
     alter_table          ... ok
     sequence             ... ok
     polymorphism         ... ok
     rowtypes             ... ok
     returning            ... ok
     largeobject          ... ok
     with                 ... ok
     xml                  ... ok
test stats                ... ok
test tablespace           ... ok
============== shutting down postmaster               ==============
server stopped

=======================
 All 120 tests passed.
=======================
--- a/src/include/storage/s_lock.h	2009-01-02 02:24:01.000000000 +0900
+++ b/src/include/storage/s_lock.h	2009-09-29 14:00:40.000000000 +0900
@@ -567,6 +567,28 @@
 
 #endif /* __m32r__ */
 
+#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"
+                "	movt    %0	\n"
+		"	xor	#1,%0	\n"
+:		"=z"(_res), "+m"(*lock)
+:
+:		"t","memory");
+	return (int) _res;
+}
+#endif  /* __sh__ */
 
 /* These live in s_lock.c, but only for gcc */
 

Reply to: