summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog73
-rw-r--r--ace/Atomic_Op.cpp28
-rw-r--r--ace/Atomic_Op_Sparc.c113
-rw-r--r--ace/Atomic_Op_Sparc.h14
-rw-r--r--ace/CDR_Base.cpp31
-rw-r--r--ace/CDR_Stream.cpp24
-rw-r--r--ace/CDR_Stream.h21
-rw-r--r--ace/Makefile.am1
-rw-r--r--ace/Message_Block.cpp6
-rw-r--r--ace/Message_Block.h7
-rw-r--r--ace/Message_Block_T.cpp7
-rw-r--r--ace/Message_Block_T.h3
-rw-r--r--ace/OS_NS_Thread.h2
-rw-r--r--ace/OS_NS_string.inl49
-rw-r--r--ace/ace.mpc1
-rw-r--r--ace/config-sunos5.5.h4
-rw-r--r--ace/os_include/os_pthread.h19
-rw-r--r--include/makeinclude/platform_aix_ibm.GNU1
-rw-r--r--include/makeinclude/platform_hpux_aCC.GNU6
-rw-r--r--include/makeinclude/platform_irix6.x_sgic++.GNU1
-rw-r--r--include/makeinclude/platform_sunos5_sunc++.GNU14
21 files changed, 405 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 26a6459a346..e195bf568da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,76 @@
+Tue Jul 11 12:01:12 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * ace/Atomic_Op.cpp:
+ * ace/Atomic_Op_Sparc.h:
+ * ace/Atomic_Op_Sparc.c:
+ * include/makeinclude/platform_sunos5_sunc++.GNU:
+
+ Added a SPARC assembler implementation of functions needed for use
+ within the ACE_Atomic_Op specializations. The implementation will
+ only be used if atomic_ops_sparc is set to 1 in
+ platform_macros.GNU. It also requires that v8plus or higher be
+ used with SunCC.
+
+ * ace/Makefile.am:
+ * ace/ace.mpc:
+
+ Added the new Atomic_Op_Sparc.c.
+
+ * ace/CDR_Base.cpp:
+
+ In grow(), call the clone_nocopy() method on the ACE_Data_Block
+ with the new size. Previously, the clone_nocopy() would be called
+ and then directly after that, size() would be called on the cloned
+ data block which would re-allocate to the new size and copy the
+ previous contents.
+
+ In the same method, we avoid constructing an ACE_Message_Block to
+ avoid reference count manipulating the data block's reference
+ count.
+
+ Also, in consolidate(), avoid attempting to copy data if the
+ destination and source are the same. [RT 8372]
+
+ * ace/CDR_Stream.h:
+ * ace/CDR_Stream.cpp:
+
+ Added a constructor that takes an ACE_Data_Block* which can be
+ used to avoid an allocation while constructing the
+ ACE_Message_Block held by the ACE_OutputCDR. [RT 8372]
+
+ * ace/Message_Block.h:
+ * ace/Message_Block.cpp:
+ * ace/Message_Block_T.h:
+ * ace/Message_Block_T.cpp:
+
+ Added a new parameter to the ACE_Data_Block::clone_nocopy() method
+ that allows the user copy the data block, but increase the size
+ all in one step. [RT 8372]
+
+ * ace/OS_NS_string.inl:
+
+ Added an unrolled implementation of memset, only active if
+ ACE_HAS_SLOW_MEMSET is defined, that supports up to 16 bytes
+ without calling into the memset() C function.
+
+ * ace/config-sunos5.5.h:
+
+ SunCC 5.x supports new(nothrow_t). So, I have enable the use of
+ it when exceptions are enabled. [RT 8372]
+
+ * ace/OS_NS_Thread.h:
+ * ace/os_include/os_pthread.h:
+
+ Added macro definitions required to build ACE and TAO on Solaris
+ without using the pthreads library.
+
+ * include/makeinclude/platform_aix_ibm.GNU:
+ * include/makeinclude/platform_hpux_aCC.GNU:
+ * include/makeinclude/platform_irix6.x_sgic++.GNU:
+
+ Added 64-bit options to the CFLAGS macros to deal with the newly
+ added C file in ACE. [RT 8372]
+
Tue Jul 11 01:47:23 2006 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/Log_Msg_Test.cpp:
diff --git a/ace/Atomic_Op.cpp b/ace/Atomic_Op.cpp
index 8737981a794..84dd1763565 100644
--- a/ace/Atomic_Op.cpp
+++ b/ace/Atomic_Op.cpp
@@ -13,6 +13,10 @@ ACE_RCSID (ace,
#if defined (ACE_HAS_BUILTIN_ATOMIC_OP)
+#if defined (ACE_INCLUDE_ATOMIC_OP_SPARC)
+# include "ace/Atomic_Op_Sparc.h"
+#endif /* ACE_INCLUDE_ATOMIC_OP_SPARC */
+
namespace {
#if defined (_MSC_VER)
@@ -30,6 +34,9 @@ single_cpu_increment (volatile long *value)
unsigned long addr = reinterpret_cast<unsigned long> (value);
asm( "xadd %0, (%1)" : "+r"(tmp) : "r"(addr) );
return tmp + 1;
+#elif defined (sun)
+ return ace_atomic_add_long (
+ reinterpret_cast<volatile unsigned long*> (value), 1);
#else /* __GNUC__ && ACE_HAS_PENTIUM */
ACE_UNUSED_ARG (value);
ACE_NOTSUP_RETURN (-1);
@@ -44,6 +51,9 @@ single_cpu_decrement (volatile long *value)
unsigned long addr = reinterpret_cast<unsigned long> (value);
asm( "xadd %0, (%1)" : "+r"(tmp) : "r"(addr) );
return tmp - 1;
+#elif defined (sun)
+ return ace_atomic_add_long (
+ reinterpret_cast<volatile unsigned long*> (value), -1);
#else /* __GNUC__ && ACE_HAS_PENTIUM */
ACE_UNUSED_ARG (value);
ACE_NOTSUP_RETURN (-1);
@@ -57,6 +67,9 @@ single_cpu_exchange (volatile long *value, long rhs)
unsigned long addr = reinterpret_cast<unsigned long> (value);
asm( "xchg %0, (%1)" : "+r"(rhs) : "r"(addr) );
return rhs;
+#elif defined (sun)
+ return ace_atomic_swap_long (
+ reinterpret_cast<volatile unsigned long*> (value), rhs);
#else /* __GNUC__ && ACE_HAS_PENTIUM */
ACE_UNUSED_ARG (value);
ACE_UNUSED_ARG (rhs);
@@ -71,6 +84,9 @@ single_cpu_exchange_add (volatile long *value, long rhs)
unsigned long addr = reinterpret_cast<unsigned long> (value);
asm( "xadd %0, (%1)" : "+r"(rhs) : "r"(addr) );
return rhs;
+#elif defined (sun)
+ return ace_atomic_swap_add_long (
+ reinterpret_cast<volatile unsigned long*> (value), rhs);
#elif defined (WIN32) && !defined (ACE_HAS_INTERLOCKED_EXCHANGEADD)
# if defined (_MSC_VER)
__asm
@@ -105,6 +121,9 @@ multi_cpu_increment (volatile long *value)
unsigned long addr = reinterpret_cast<unsigned long> (value);
asm( "lock ; xadd %0, (%1)" : "+r"(tmp) : "r"(addr) );
return tmp + 1;
+#elif defined (sun)
+ return ace_atomic_add_long (
+ reinterpret_cast<volatile unsigned long*> (value), 1);
#else /* __GNUC__ && ACE_HAS_PENTIUM */
ACE_UNUSED_ARG (value);
ACE_NOTSUP_RETURN (-1);
@@ -119,6 +138,9 @@ multi_cpu_decrement (volatile long *value)
unsigned long addr = reinterpret_cast<unsigned long> (value);
asm( "lock ; xadd %0, (%1)" : "+r"(tmp) : "r"(addr) );
return tmp - 1;
+#elif defined (sun)
+ return ace_atomic_add_long (
+ reinterpret_cast<volatile unsigned long*> (value), -1);
#else /* __GNUC__ && ACE_HAS_PENTIUM */
ACE_UNUSED_ARG (value);
ACE_NOTSUP_RETURN (-1);
@@ -133,6 +155,9 @@ multi_cpu_exchange (volatile long *value, long rhs)
// The XCHG instruction automatically follows LOCK semantics
asm( "xchg %0, (%1)" : "+r"(rhs) : "r"(addr) );
return rhs;
+#elif defined (sun)
+ return ace_atomic_swap_long (
+ reinterpret_cast<volatile unsigned long*> (value), rhs);
#else /* __GNUC__ && ACE_HAS_PENTIUM */
ACE_UNUSED_ARG (value);
ACE_UNUSED_ARG (rhs);
@@ -147,6 +172,9 @@ multi_cpu_exchange_add (volatile long *value, long rhs)
unsigned long addr = reinterpret_cast<unsigned long> (value);
asm( "lock ; xadd %0, (%1)" : "+r"(rhs) : "r"(addr) );
return rhs;
+#elif defined (sun)
+ return ace_atomic_swap_add_long (
+ reinterpret_cast<volatile unsigned long*> (value), rhs);
#elif defined (WIN32) && !defined (ACE_HAS_INTERLOCKED_EXCHANGEADD)
# if defined (_MSC_VER)
__asm
diff --git a/ace/Atomic_Op_Sparc.c b/ace/Atomic_Op_Sparc.c
new file mode 100644
index 00000000000..f301de5b85f
--- /dev/null
+++ b/ace/Atomic_Op_Sparc.c
@@ -0,0 +1,113 @@
+/* $Id$
+ *
+ * This is a C file for a reason. The Sun C++ compiler does not accept
+ * inline assembler.
+ *
+ * Portions of this code are based on atomic operations found in the
+ * linux kernel source code.
+ */
+
+#if defined (ACE_INCLUDE_ATOMIC_OP_SPARC)
+
+# if defined (__sparcv9)
+
+unsigned long
+ace_atomic_add_long (volatile unsigned long *dest, long rhs)
+{
+ __asm ("restore\n"
+ "ldx [%o0], %o2\n"
+ ".again_add:\n"
+ "add %o2, %o1, %o3\n"
+ "casx [%o0], %o2, %o3\n"
+ "cmp %o2, %o3\n"
+ "bne,pn %xcc, .again_add\n"
+ "mov %o3, %o2\n"
+ "retl\n"
+ "add %o2, %o1, %o0\n");
+}
+
+unsigned long
+ace_atomic_swap_long (volatile unsigned long *dest, unsigned long rhs)
+{
+ __asm ("restore\n"
+ "ldx [%o0], %o2\n"
+ ".again_swap:\n"
+ "mov %o1, %o3\n"
+ "casx [%o0], %o2, %o3\n"
+ "cmp %o2, %o3\n"
+ "bne,pn %xcc, .again_swap\n"
+ "mov %o3, %o2\n"
+ "retl\n"
+ "mov %o3, %o0\n");
+}
+
+unsigned long
+ace_atomic_swap_add_long (volatile unsigned long *dest, long rhs)
+{
+ __asm ("restore\n"
+ "ldx [%o0], %o2\n"
+ ".again_swap_add:\n"
+ "mov %o2, %o4\n"
+ "add %o2, %o1, %o3\n"
+ "casx [%o0], %o2, %o3\n"
+ "cmp %o2, %o3\n"
+ "bne,pn %xcc, .again_swap_add\n"
+ "mov %o3, %o2\n"
+ "retl\n"
+ "mov %o4, %o0\n");
+}
+
+#else
+
+unsigned long
+ace_atomic_add_long (volatile unsigned long *dest, long rhs)
+{
+ __asm ("restore\n"
+ "ld [%o0], %o2\n"
+ ".again_add:\n"
+ "add %o2, %o1, %o3\n"
+ "cas [%o0], %o2, %o3\n"
+ "cmp %o2, %o3\n"
+ "bne,pn %icc, .again_add\n"
+ "mov %o3, %o2\n"
+ "retl\n"
+ "add %o2, %o1, %o0\n");
+}
+
+unsigned long
+ace_atomic_swap_long (volatile unsigned long *dest, unsigned long rhs)
+{
+ __asm ("restore\n"
+ "ld [%o0], %o2\n"
+ ".again_swap:\n"
+ "mov %o1, %o3\n"
+ "cas [%o0], %o2, %o3\n"
+ "cmp %o2, %o3\n"
+ "bne,pn %icc, .again_swap\n"
+ "mov %o3, %o2\n"
+ "retl\n"
+ "mov %o3, %o0\n");
+}
+
+unsigned long
+ace_atomic_swap_add_long (volatile unsigned long *dest, long rhs)
+{
+ __asm ("restore\n"
+ "ld [%o0], %o2\n"
+ ".again_swap_add:\n"
+ "mov %o2, %o4\n"
+ "add %o2, %o1, %o3\n"
+ "cas [%o0], %o2, %o3\n"
+ "cmp %o2, %o3\n"
+ "bne,pn %icc, .again_swap_add\n"
+ "mov %o3, %o2\n"
+ "retl\n"
+ "mov %o4, %o0\n");
+}
+
+# endif /* __sparcv9 */
+
+#elif !defined (__GNUC__)
+/* Make compilers stop complaining about an empty translation unit */
+static int shut_up_compiler = 0;
+#endif /* ACE_INCLUDE_ATOMIC_OP_SPARC */
diff --git a/ace/Atomic_Op_Sparc.h b/ace/Atomic_Op_Sparc.h
new file mode 100644
index 00000000000..6e238e5e909
--- /dev/null
+++ b/ace/Atomic_Op_Sparc.h
@@ -0,0 +1,14 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef ACE_ATOMIC_OP_SPARC_H
+#define ACE_ATOMIC_OP_SPARC_H
+
+extern "C"
+{
+ unsigned long ace_atomic_add_long (volatile unsigned long *dest, long rhs);
+ unsigned long ace_atomic_swap_long (volatile unsigned long *dest, unsigned long rhs);
+ unsigned long ace_atomic_swap_add_long (volatile unsigned long *dest, long rhs);
+}
+
+#endif /* ACE_ATOMIC_OP_SPARC_H */
diff --git a/ace/CDR_Base.cpp b/ace/CDR_Base.cpp
index e4382bff196..cee82641cb5 100644
--- a/ace/CDR_Base.cpp
+++ b/ace/CDR_Base.cpp
@@ -504,18 +504,26 @@ ACE_CDR::grow (ACE_Message_Block *mb, size_t minsize)
return 0;
ACE_Data_Block *db =
- mb->data_block ()->clone_nocopy ();
+ mb->data_block ()->clone_nocopy (0, newsize);
- if (db->size (newsize) == -1)
+ if (db == 0)
return -1;
- ACE_Message_Block tmp (db);
- ACE_CDR::mb_align (&tmp);
+ // Do the equivalent of ACE_CDR::mb_align() here to avoid having
+ // to allocate an ACE_Message_Block on the stack thereby avoiding
+ // the manipulation of the data blocks reference count
+ size_t mb_len = mb->length ();
+ char *start = ACE_ptr_align_binary (db->base (),
+ ACE_CDR::MAX_ALIGNMENT);
+
+ ACE_OS::memcpy (start, mb->rd_ptr (), mb_len);
+ mb->data_block (db);
- tmp.copy (mb->rd_ptr (), mb->length());
- mb->data_block (tmp.data_block ()->duplicate ());
- mb->rd_ptr (tmp.rd_ptr ());
- mb->wr_ptr (tmp.wr_ptr ());
+ // Setting the data block on the mb resets the read and write
+ // pointers back to the beginning. We must set the rd_ptr to the
+ // aligned start and adjust the write pointer to the end
+ mb->rd_ptr (start);
+ mb->wr_ptr (start + mb_len);
// Remove the DONT_DELETE flags from mb
mb->clr_self_flags (ACE_Message_Block::DONT_DELETE);
@@ -566,7 +574,12 @@ ACE_CDR::consolidate (ACE_Message_Block *dst,
i != 0;
i = i->cont ())
{
- dst->copy (i->rd_ptr (), i->length ());
+ // If the destination and source are the same, do not
+ // attempt to copy the data. Just update the write pointer.
+ if (dst->wr_ptr () != i->rd_ptr ())
+ dst->copy (i->rd_ptr (), i->length ());
+ else
+ dst->wr_ptr (i->length ());
}
}
diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp
index 59b3dde4737..d7030235d5d 100644
--- a/ace/CDR_Stream.cpp
+++ b/ace/CDR_Stream.cpp
@@ -88,6 +88,30 @@ ACE_OutputCDR::ACE_OutputCDR (char *data,
this->current_ = &this->start_;
}
+ACE_OutputCDR::ACE_OutputCDR (ACE_Data_Block *data_block,
+ int byte_order,
+ ACE_Allocator *message_block_allocator,
+ size_t memcpy_tradeoff,
+ ACE_CDR::Octet major_version,
+ ACE_CDR::Octet minor_version)
+ : start_ (data_block,
+ ACE_Message_Block::DONT_DELETE,
+ message_block_allocator),
+ current_alignment_ (0),
+ current_is_writable_ (true),
+ do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER),
+ good_bit_ (true),
+ memcpy_tradeoff_ (memcpy_tradeoff),
+ major_version_ (major_version),
+ minor_version_ (minor_version),
+ char_translator_ (0),
+ wchar_translator_ (0)
+{
+ // We cannot trust the buffer to be properly aligned
+ ACE_CDR::mb_align (&this->start_);
+ this->current_ = &this->start_;
+}
+
ACE_OutputCDR::ACE_OutputCDR (ACE_Message_Block *data,
int byte_order,
size_t memcpy_tradeoff,
diff --git a/ace/CDR_Stream.h b/ace/CDR_Stream.h
index d6e7560e7fe..fbb81739c94 100644
--- a/ace/CDR_Stream.h
+++ b/ace/CDR_Stream.h
@@ -132,6 +132,27 @@ public:
ACE_CDR::Octet giop_minor_version =
ACE_CDR_GIOP_MINOR_VERSION);
+ /// Build a CDR stream with an initial data block, it will *not* remove
+ /// <data_block>, since it did not allocated it. It's important to be
+ // careful with the alignment of <data_block>.
+ /**
+ * Create an output stream from an arbitrary data block, care must be
+ * exercised with alignment, because this contructor will align if
+ * needed. In this case the <data_block> buffer will not point to the
+ * start off the output stream. begin()->rd_prt() points to the start
+ * off the output stream. See ACE_ptr_align_binary() to properly align a
+ * pointer and use ACE_CDR::MAX_ALIGNMENT for the correct alignment.
+ */
+ ACE_OutputCDR (ACE_Data_Block *data_block,
+ int byte_order = ACE_CDR_BYTE_ORDER,
+ ACE_Allocator* message_block_allocator = 0,
+ size_t memcpy_tradeoff=
+ ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
+ ACE_CDR::Octet giop_major_version =
+ ACE_CDR_GIOP_MAJOR_VERSION,
+ ACE_CDR::Octet giop_minor_version =
+ ACE_CDR_GIOP_MINOR_VERSION);
+
/// Build a CDR stream with an initial Message_Block chain, it will
/// *not* remove <data>, since it did not allocate it.
ACE_OutputCDR (ACE_Message_Block *data,
diff --git a/ace/Makefile.am b/ace/Makefile.am
index 280854377df..2482d295464 100644
--- a/ace/Makefile.am
+++ b/ace/Makefile.am
@@ -56,6 +56,7 @@ libACE_la_SOURCES = \
Asynch_IO_Impl.cpp \
Asynch_Pseudo_Task.cpp \
Atomic_Op.cpp \
+ Atomic_Op_Sparc.c \
Auto_Event.cpp \
Barrier.cpp \
Base_Thread_Adapter.cpp \
diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp
index 36f34637eb0..be94df6ddeb 100644
--- a/ace/Message_Block.cpp
+++ b/ace/Message_Block.cpp
@@ -1092,7 +1092,8 @@ ACE_Data_Block::clone (ACE_Message_Block::Message_Flags mask) const
}
ACE_Data_Block *
-ACE_Data_Block::clone_nocopy (ACE_Message_Block::Message_Flags mask) const
+ACE_Data_Block::clone_nocopy (ACE_Message_Block::Message_Flags mask,
+ size_t max_size) const
{
ACE_FUNCTION_TIMEPROBE(ACE_DATA_BLOCK_CLONE_ENTER);
@@ -1108,7 +1109,8 @@ ACE_Data_Block::clone_nocopy (ACE_Message_Block::Message_Flags mask) const
ACE_NEW_MALLOC_RETURN (nb,
static_cast<ACE_Data_Block*> (
this->data_block_allocator_->malloc (sizeof (ACE_Data_Block))),
- ACE_Data_Block (this->max_size_, // size
+ ACE_Data_Block (max_size == 0 ?
+ this->max_size_ : max_size, // size
this->type_, // type
0, // data
this->allocator_strategy_, // allocator
diff --git a/ace/Message_Block.h b/ace/Message_Block.h
index f3240957a86..8eb70e72aa0 100644
--- a/ace/Message_Block.h
+++ b/ace/Message_Block.h
@@ -743,9 +743,12 @@ public:
* As clone above, but it does not copy the contents of the buffer,
* i.e., create a new Data_Block of the same dynamic type, with the
* same allocator, locking_strategy, and with the same amount of
- * storage available but the buffer is unitialized.
+ * storage available (if @a max_size is zero) but the buffer is unitialized.
+ * If @a max_size is specified other than zero, it will be used when
+ * creating the new data block.
*/
- virtual ACE_Data_Block *clone_nocopy (ACE_Message_Block::Message_Flags mask = 0) const;
+ virtual ACE_Data_Block *clone_nocopy (ACE_Message_Block::Message_Flags mask = 0,
+ size_t max_size = 0) const;
/// Return a "shallow" copy that increments our reference count by 1.
ACE_Data_Block *duplicate (void);
diff --git a/ace/Message_Block_T.cpp b/ace/Message_Block_T.cpp
index d2cf9464ab0..c02fb7c0401 100644
--- a/ace/Message_Block_T.cpp
+++ b/ace/Message_Block_T.cpp
@@ -19,7 +19,8 @@ ACE_Locked_Data_Block<L>::~ACE_Locked_Data_Block (void)
}
template<class ACE_LOCK> ACE_Data_Block *
-ACE_Locked_Data_Block<ACE_LOCK>::clone_nocopy (ACE_Message_Block::Message_Flags mask) const
+ACE_Locked_Data_Block<ACE_LOCK>::clone_nocopy (ACE_Message_Block::Message_Flags mask,
+ size_t max_size) const
{
ACE_TRACE ("ACE_Locked_Data_Block::clone_nocopy");
@@ -33,7 +34,9 @@ ACE_Locked_Data_Block<ACE_LOCK>::clone_nocopy (ACE_Message_Block::Message_Flags
ACE_NEW_MALLOC_RETURN (nb,
static_cast<ACE_Locked_Data_Block<ACE_LOCK>*> (
this->data_block_allocator ()->malloc (sizeof (ACE_Locked_Data_Block<ACE_LOCK>))),
- ACE_Locked_Data_Block<ACE_LOCK> (this->size (),
+ ACE_Locked_Data_Block<ACE_LOCK> (
+ max_size == 0 ?
+ this->size () : max_size,
this->msg_type (),
0,
this->allocator_strategy (),
diff --git a/ace/Message_Block_T.h b/ace/Message_Block_T.h
index c1b4818a880..e65c92872a8 100644
--- a/ace/Message_Block_T.h
+++ b/ace/Message_Block_T.h
@@ -58,7 +58,8 @@ public:
* ACE_Locked_Data_Block<>
* See the documentation in Message_Block.h for details.
*/
- virtual ACE_Data_Block *clone_nocopy (ACE_Message_Block::Message_Flags mask = 0) const;
+ virtual ACE_Data_Block *clone_nocopy (ACE_Message_Block::Message_Flags mask = 0,
+ size_t max_size = 0) const;
private:
/// The lock
diff --git a/ace/OS_NS_Thread.h b/ace/OS_NS_Thread.h
index 5e75541b11e..33bffe2b066 100644
--- a/ace/OS_NS_Thread.h
+++ b/ace/OS_NS_Thread.h
@@ -151,6 +151,8 @@ ACE_END_VERSIONED_NAMESPACE_DECL
# define THR_SCHED_FIFO 0
# define THR_SCHED_RR 0
# define THR_SCHED_DEFAULT 0
+# define THR_INHERIT_SCHED 0
+# define THR_SCOPE_PROCESS 0
# elif defined (ACE_VXWORKS)
# include /**/ <sysLib.h> // for sysClkRateGet()
diff --git a/ace/OS_NS_string.inl b/ace/OS_NS_string.inl
index 46d13953d89..399b681924c 100644
--- a/ace/OS_NS_string.inl
+++ b/ace/OS_NS_string.inl
@@ -52,7 +52,56 @@ ACE_OS::memmove (void *t, const void *s, size_t len)
ACE_INLINE void *
ACE_OS::memset (void *s, int c, size_t len)
{
+#if defined (ACE_HAS_SLOW_MEMSET)
+ // This section requires a high optimization level (-xO4 with SunCC)
+ // in order to actually be inlined.
+ char* ptr = static_cast<char*> (s);
+ switch (len)
+ {
+ case 16:
+ ptr[15] = c;
+ case 15:
+ ptr[14] = c;
+ case 14:
+ ptr[13] = c;
+ case 13:
+ ptr[12] = c;
+ case 12:
+ ptr[11] = c;
+ case 11:
+ ptr[10] = c;
+ case 10:
+ ptr[9] = c;
+ case 9:
+ ptr[8] = c;
+ case 8:
+ ptr[7] = c;
+ case 7:
+ ptr[6] = c;
+ case 6:
+ ptr[5] = c;
+ case 5:
+ ptr[4] = c;
+ case 4:
+ ptr[3] = c;
+ case 3:
+ ptr[2] = c;
+ case 2:
+ ptr[1] = c;
+ case 1:
+ ptr[0] = c;
+ break;
+ default:
+ for (size_t i = 0; i < len; ++i)
+ {
+ ptr[i] = c;
+ }
+ }
+
+ return s;
+#else
return ::memset (s, c, len);
+#endif /* ACE_HAS_SLOW_MEMSET */
}
ACE_INLINE char *
diff --git a/ace/ace.mpc b/ace/ace.mpc
index 187ff5644d2..1c7c1b2107f 100644
--- a/ace/ace.mpc
+++ b/ace/ace.mpc
@@ -26,6 +26,7 @@ project(ACE) : acedefaults, core, other, codecs, token, svcconf, uuid, filecache
ATM_QoS.cpp
ATM_Stream.cpp
Atomic_Op.cpp
+ Atomic_Op_Sparc.c
Auto_Event.cpp
Barrier.cpp
Base_Thread_Adapter.cpp
diff --git a/ace/config-sunos5.5.h b/ace/config-sunos5.5.h
index c81fd8e2205..1276d00ba66 100644
--- a/ace/config-sunos5.5.h
+++ b/ace/config-sunos5.5.h
@@ -43,7 +43,9 @@
# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1
# define ACE_HAS_THR_C_DEST
# endif /* __SUNPRO_CC_COMPAT >= 5 */
-# if !defined (ACE_HAS_EXCEPTIONS)
+# if defined (ACE_HAS_EXCEPTIONS)
+# define ACE_HAS_NEW_NOTHROW
+# else
// See /opt/SUNWspro_5.0/SC5.0/include/CC/stdcomp.h:
# define _RWSTD_NO_EXCEPTIONS 1
# endif /* ! ACE_HAS_EXCEPTIONS */
diff --git a/ace/os_include/os_pthread.h b/ace/os_include/os_pthread.h
index e6d82891688..782d15b35a3 100644
--- a/ace/os_include/os_pthread.h
+++ b/ace/os_include/os_pthread.h
@@ -434,6 +434,25 @@ public:
# endif /* linux && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) */
+#elif defined (ACE_HAS_STHREADS)
+# if !defined (ACE_THR_PRI_FIFO_MIN)
+# define ACE_THR_PRI_FIFO_MIN (long) 0
+# endif /* !ACE_THR_PRI_FIFO_MIN */
+# if !defined (ACE_THR_PRI_FIFO_MAX)
+# define ACE_THR_PRI_FIFO_MAX (long) 59
+# endif /* !ACE_THR_PRI_FIFO_MAX */
+# if !defined (ACE_THR_PRI_RR_MIN)
+# define ACE_THR_PRI_RR_MIN (long) 0
+# endif /* !ACE_THR_PRI_RR_MIN */
+# if !defined (ACE_THR_PRI_RR_MAX)
+# define ACE_THR_PRI_RR_MAX (long) 59
+# endif /* !ACE_THR_PRI_RR_MAX */
+# if !defined (ACE_THR_PRI_OTHER_MIN)
+# define ACE_THR_PRI_OTHER_MIN (long) 0
+# endif /* !ACE_THR_PRI_OTHER_MIN */
+# if !defined (ACE_THR_PRI_OTHER_MAX)
+# define ACE_THR_PRI_OTHER_MAX (long) 127
+# endif /* !ACE_THR_PRI_OTHER_MAX */
#endif /* ACE_HAS_PTHREADS */
#include /**/ "ace/post.h"
diff --git a/include/makeinclude/platform_aix_ibm.GNU b/include/makeinclude/platform_aix_ibm.GNU
index c2493199884..d785081274d 100644
--- a/include/makeinclude/platform_aix_ibm.GNU
+++ b/include/makeinclude/platform_aix_ibm.GNU
@@ -142,6 +142,7 @@ else # Visual Age 5 and up
SOFLAGS += $(CCFLAGS) $(CPPFLAGS) $(INCLDIRS)
ifeq ($(buildbits),64)
DLD += -q64
+ CFLAGS += -q64 -qwarn64
CCFLAGS += -q64 -qwarn64
ARFLAGS := -X64 $(ARFLAGS)
diff --git a/include/makeinclude/platform_hpux_aCC.GNU b/include/makeinclude/platform_hpux_aCC.GNU
index 3309743947f..08c0deaa13c 100644
--- a/include/makeinclude/platform_hpux_aCC.GNU
+++ b/include/makeinclude/platform_hpux_aCC.GNU
@@ -174,19 +174,24 @@ SOEXT = sl
ifeq ($(buildbits),32)
ifeq ($(itanium),1)
+ CFLAGS += +DD32
CCFLAGS += +DD32
else
+ CFLAGS += +DA1.1 +DS1.1
CCFLAGS += +DA1.1 +DS1.1
endif
else
ifeq ($(buildbits),64)
ifeq ($(itanium),1)
+ CFLAGS += +DD64
CCFLAGS += +DD64
else
ifeq ($(word 2,$(HPVERS_WORDS)), 11)
## Without the W, it isn't really a 64-bit build
+ CFLAGS += +DA2.0W +DS2.0W
CCFLAGS += +DA2.0W +DS2.0W
else
+ CFLAGS += +DA2.0 +DS2.0
CCFLAGS += +DA2.0 +DS2.0
endif
endif
@@ -194,6 +199,7 @@ LDFLAGS += -Wl,+vnocompatwarnings
else
ifneq ($(itanium),1)
# HP aCC on Itanium doesn't support this option, defaults to 32bit then.
+ CFLAGS += +DAportable
CCFLAGS += +DAportable
endif
endif
diff --git a/include/makeinclude/platform_irix6.x_sgic++.GNU b/include/makeinclude/platform_irix6.x_sgic++.GNU
index d51f4876570..933f43db38d 100644
--- a/include/makeinclude/platform_irix6.x_sgic++.GNU
+++ b/include/makeinclude/platform_irix6.x_sgic++.GNU
@@ -35,6 +35,7 @@ DCCFLAGS += -g
# Enable 64-bit builds
ifeq (64,$(buildbits))
+ CFLAGS += -64
CPPFLAGS += -64
endif
diff --git a/include/makeinclude/platform_sunos5_sunc++.GNU b/include/makeinclude/platform_sunos5_sunc++.GNU
index 58f504faf9b..62c9dcfc62b 100644
--- a/include/makeinclude/platform_sunos5_sunc++.GNU
+++ b/include/makeinclude/platform_sunos5_sunc++.GNU
@@ -13,7 +13,7 @@
# platform_macros.GNU file such as this can be used:
# fast=1
# include $(ACE_ROOT)/include/makeinclude/platform_sunos5_sunc++.GNU
-# CCFLAGS += -xtarget=ultra2 -xarch=v9a #### CPU specific!
+# CFLAGS += -xtarget=ultra2 -xarch=v9a #### CPU specific!
# SOFLAGS += -xtarget=ultra2 -xarch=v9a
# LDFLAGS += -L/opt/SUNWspro/SC5.0/lib/v9 -L/usr/lib/sparcv9
# Please note that the xtarget and xarch settings are specific to
@@ -51,6 +51,10 @@ ace_with_x11 ?= 0
no_hidden_visibility ?= 1
templates ?= automatic
+## If you set this to 1 you will need to add -xarch=v8plus (or higher)
+## to CFLAGS or the assembler code will not compile
+atomic_ops_sparc ?= 0
+
PLATFORM_TK_CPPFLAGS=
PLATFORM_TK_LIBS=-ltk -ltcl
PLATFORM_TK_LDFLAGS=
@@ -83,6 +87,10 @@ else
endif
endif
+ifeq ($(atomic_ops_sparc),1)
+ CFLAGS += -DACE_HAS_BUILTIN_ATOMIC_OP -DACE_INCLUDE_ATOMIC_OP_SPARC
+endif
+
#### The following macro overrides enable creation of fast executables.
#### They _don't_ support fast compilation :-)
#### To use, add fast=1 to your "make" invocation.
@@ -181,10 +189,10 @@ else # ! 4.2
# from CCFLAGS in a private platform_macros.GNU file.
ifeq (64,$(buildbits))
ifeq (C++ 5.7,$(findstring C++ 5.7,$(CC_VERSION)))
- CCFLAGS += -xarch=generic64
+ CFLAGS += -xarch=generic64
LDFLAGS += -xarch=generic64
else
- CCFLAGS += -xarch=v9
+ CFLAGS += -xarch=v9
LDFLAGS += -xarch=v9
endif # C++ 5.7
endif # buildbits