8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:03:03 +01:00

commit missing Solaris inline assembly routines - SPARC and AMD64

This commit is contained in:
verbguy 2009-11-10 15:53:38 +00:00
parent dbd6bf9a81
commit 6fe23f8f33
5 changed files with 89 additions and 1 deletions

View File

@ -119,6 +119,10 @@ TLS_OPTIONS=@TLS_OPTIONS@
# atomic options - set by configure
ATOMIC_OPTIONS=@ATOMIC_OPTIONS@
# compare and swap options - set by configure
# needed at least for solaris inline assembly routines
CAS_OPTIONS=@CAS_OPTIONS@
# Default programs and tools to be used in the build process
SH= sh -c

View File

@ -54,7 +54,7 @@
# libC and libCrun need libthread for a multithreaded application
COMMON_FLAGS= -DSOLARIS -DBSD_COMP -D__EXTENSIONS__ \
-D_POSIX_THREAD_SEMANTICS -D_POSIX_THREAD_PRIO_INHERIT -D_POSIX_C_SOURCE=199506L \
-KPIC \
-KPIC $(CAS_OPTIONS) \
-erroff=wvarhidemem $(ATOMIC_OPTIONS)
# if we keep sfio this needs to be set by configure (or move in to extern directory)

View File

@ -325,6 +325,7 @@ dnl CPU_TYPE=ppc64
if test "$isa" = "amd64"; then
libdir=/usr/lib/amd64
fi
CAS_OPTIONS=`pwd`"/src/common/classes/fb_cas_sax.il";
INSTALL_PREFIX=solaris
PLATFORM=solx86
AC_DEFINE(solx86, 1, [Define this if OS is Solarix x86])
@ -348,6 +349,7 @@ dnl CPU_TYPE=ppc64
*) MAKEFILE_PREFIX=solaris-64gcc ;
ICU_PLATFORM=SOLARISGCC ;;
esac
CAS_OPTIONS=`pwd`"/src/common/classes/fb_cas.il";
INSTALL_PREFIX=solaris
PLATFORM=SOLARIS
AC_DEFINE(SOLARIS, 1, [Define this if OS is Solaris Sparc])
@ -946,6 +948,7 @@ AC_COMPILE_IFELSE(
CXXFLAGS=$pre_tls_cxxflags
AC_SUBST(TLS_OPTIONS)
AC_SUBST(ATOMIC_OPTIONS)
AC_SUBST(CAS_OPTIONS)
dnl ##################### DO NOT ADD ANY TESTS BELOW ###########################

View File

@ -0,0 +1,43 @@
/*
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The contents of this file or any work derived from this file
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* author.
*
*
* The Original Code was created by James A. Starkey for IBPhoenix.
*
* Copyright (c) 2004 James A. Starkey
* All Rights Reserved.
*/
.inline cas,3
cas [%o0],%o1,%o2
mov %o2,%o0
.end
.inline casx,3
casx [%o0],%o1,%o2
mov %o2,%o0
.end
.inline membar_flush,0
membar 0x32 /* cmask = MemIssue | Lookaside, mmask = StoreLoad */
.end
.inline membar_wait,0
membar 0x32 /* cmask = MemIssue | Lookaside, mmask = StoreLoad */
.end

View File

@ -0,0 +1,38 @@
/*
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The contents of this file or any work derived from this file
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* author.
*
*
* The Original Code was created by James A. Starkey for IBPhoenix.
*
* Copyright (c) 2004 James A. Starkey
* All Rights Reserved.
*/
.inline cas,3
movl %esi, %eax
movl (%rdi),%r11d
lock; cmpxchgl %edx, (%rdi)
movl %r11d, %eax
.end
.inline casx,3
movq %rsi, %rax
movq (%rdi),%r11
lock; cmpxchgq %rdx, (%rdi)
movq %r11, %rax
.end