From 23b4e0767e610bd1dbec1c6d47fbf2561d9a6078 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Wed, 7 Oct 2009 13:29:17 +0000 Subject: [PATCH] Port to Renesas SH (linux) by Nobuhiro Iwamatsu --- configure.in | 23 +++++++++++++++++++++++ src/jrd/common.h | 10 ++++++++++ src/jrd/inf_pub.h | 3 +++ src/jrd/pag.cpp | 12 ++++++++++-- src/jrd/utl.cpp | 4 +++- 5 files changed, 49 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 623fae6dc7..18536a831d 100644 --- a/configure.in +++ b/configure.in @@ -230,6 +230,29 @@ dnl CPU_TYPE=ppc64 SHRLIB_EXT=so ;; + sh*-*-linux*) + MAKEFILE_PREFIX=linux_generic + INSTALL_PREFIX=linux + PLATFORM=LINUX + AC_DEFINE(LINUX, 1, [Define this if OS is Linux]) + AC_DEFINE(SH, 1, [Architecture is little-endian sh4]) + LOCK_MANAGER_FLG=Y + EDITLINE_FLG=Y + SHRLIB_EXT=so + ;; + + sh*eb-*-linux*) + MAKEFILE_PREFIX=linux_generic + INSTALL_PREFIX=linux + PLATFORM=LINUX + AC_DEFINE(LINUX, 1, [Define this if OS is Linux]) + AC_DEFINE(SHEB, 1, [Architecture is big-edian sh4]) + LOCK_MANAGER_FLG=Y + EDITLINE_FLG=Y + SHRLIB_EXT=so + ;; + + *-*-linux*) MAKEFILE_PREFIX=linux_generic INSTALL_PREFIX=linux diff --git a/src/jrd/common.h b/src/jrd/common.h index 4fa5448caa..d56ace534d 100644 --- a/src/jrd/common.h +++ b/src/jrd/common.h @@ -172,6 +172,16 @@ #endif // __s390x__ #endif // __s390__ +#ifdef SH +#define IMPLEMENTATION isc_info_db_impl_linux_sh /* 80 */ +#define RISC_ALIGNMENT +#endif /* sh */ + +#ifdef SHEB +#define IMPLEMENTATION isc_info_db_impl_linux_sheb /* 81 */ +#define RISC_ALIGNMENT +#endif /* sheb */ + #endif /* LINUX */ diff --git a/src/jrd/inf_pub.h b/src/jrd/inf_pub.h index 73b73f8133..68dc7c67ff 100644 --- a/src/jrd/inf_pub.h +++ b/src/jrd/inf_pub.h @@ -211,6 +211,9 @@ enum info_db_implementations isc_info_db_impl_linux_s390x = 78, isc_info_db_impl_linux_s390 = 79, + isc_info_db_impl_linux_sh = 80, + isc_info_db_impl_linux_sheb = 81, + isc_info_db_impl_last_value // Leave this LAST! }; diff --git a/src/jrd/pag.cpp b/src/jrd/pag.cpp index 77272cc9a0..359c147603 100644 --- a/src/jrd/pag.cpp +++ b/src/jrd/pag.cpp @@ -158,9 +158,11 @@ static const int CLASS_LINUX_IA64 = 34; // LINUX/IA64 static const int CLASS_DARWIN_PPC64 = 35; // Darwin/PowerPC64 static const int CLASS_LINUX_S390X = 36; // LINUX/s390x static const int CLASS_LINUX_S390 = 37; // LINUX/s390 +static const int CLASS_LINUX_SH = 38; // LINUX/SH (little-endian) +static const int CLASS_LINUX_SHEB = 39; // LINUX/SH (big-endian) static const int CLASS_MAX10 = CLASS_LINUX_AMD64; // This should not be changed, no new ports with ODS10 -static const int CLASS_MAX = CLASS_LINUX_S390; +static const int CLASS_MAX = CLASS_LINUX_SHEB; // ARCHITECTURE COMPATIBILITY CLASSES @@ -255,7 +257,9 @@ static const ArchitectureType archMatrix[CLASS_MAX + 1] = archLittleEndian, // CLASS_LINUX_IA64 archBigEndian, // CLASS_DARWIN_PPC64 archBigEndian, // CLASS_LINUX_S390X - archBigEndian // CLASS_LINUX_S390 + archBigEndian, // CLASS_LINUX_S390 + archLittleEndian, // CLASS_LINUX_SH + archBigEndian // CLASS_LINUX_SHEB }; #ifdef __sun @@ -311,6 +315,10 @@ const SSHORT CLASS = CLASS_LINUX_S390X; # else const SSHORT CLASS = CLASS_LINUX_S390; # endif // defined(__s390x__) +#elif defined(SH) +const SSHORT CLASS = CLASS_LINUX_SH; +#elif defined(SHEB) +const SSHORT CLASS = CLASS_LINUX_SHEB; #else #error no support on other hardware for Linux #endif diff --git a/src/jrd/utl.cpp b/src/jrd/utl.cpp index 2d4d9c5625..289787b844 100644 --- a/src/jrd/utl.cpp +++ b/src/jrd/utl.cpp @@ -223,7 +223,9 @@ static const TEXT* const impl_implementation[] = "Firebird/linux IA64", // 76 "Firebird/Darwin/PowerPC64", // 77 "Firebird/linux s390x", // 78 - "Firebird/linux s390" // 79 + "Firebird/linux s390", // 79 + "Firebird/linux SH", // 80 + "Firebird/linux SHEB" // 81 };