summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormike <mike>2008-07-01 19:28:00 +0000
committermike <mike>2008-07-01 19:28:00 +0000
commitcf6e7943aab0f3b08071c04b710a1c6facb0c3bb (patch)
tree1b4a32cc0e37eafe1bb5bacca0d0d962076f7702
parentd5f61e7531570783550e6706147155b5507d19d7 (diff)
downloadtog-pegasus-TASK-PEP328_SOLARIS_IX86_CC_PORT-branch-v2.zip
tog-pegasus-TASK-PEP328_SOLARIS_IX86_CC_PORT-branch-v2.tar.gz
tog-pegasus-TASK-PEP328_SOLARIS_IX86_CC_PORT-branch-v2.tar.xz
TITLE: Solaris Porting DESCRIPTION: Ongoing Solaris Porting
-rw-r--r--mak/platform_SOLARIS_SPARC_64_CC.mak2
-rw-r--r--mak/platform_SOLARIS_XXX_CC.mak160
-rw-r--r--src/Pegasus/Common/OrderedSet.h11
-rw-r--r--src/Pegasus/Common/Threads.cpp14
-rw-r--r--src/Pegasus/Common/tests/IPC/IPC.cpp6
5 files changed, 174 insertions, 19 deletions
diff --git a/mak/platform_SOLARIS_SPARC_64_CC.mak b/mak/platform_SOLARIS_SPARC_64_CC.mak
index 5c19d60..aa5897b 100644
--- a/mak/platform_SOLARIS_SPARC_64_CC.mak
+++ b/mak/platform_SOLARIS_SPARC_64_CC.mak
@@ -29,7 +29,7 @@
#//
#//=============================================================================
-PEGASUS_SOLARIS_NEED_PTO=1
+#PEGASUS_SOLARIS_NEED_PTO=1
include $(ROOT)/mak/platform_SOLARIS_XXX_CC.mak
diff --git a/mak/platform_SOLARIS_XXX_CC.mak b/mak/platform_SOLARIS_XXX_CC.mak
new file mode 100644
index 0000000..2dca72c
--- /dev/null
+++ b/mak/platform_SOLARIS_XXX_CC.mak
@@ -0,0 +1,160 @@
+#//%2006////////////////////////////////////////////////////////////////////////
+#//
+#// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+#// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+#// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+#// IBM Corp.; EMC Corporation, The Open Group.
+#// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+#// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+#// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+#// EMC Corporation; VERITAS Software Corporation; The Open Group.
+#// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+#// EMC Corporation; Symantec Corporation; The Open Group.
+#//
+#// Permission is hereby granted, free of charge, to any person obtaining a copy
+#// of this software and associated documentation files (the "Software"), to
+#// deal in the Software without restriction, including without limitation the
+#// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+#// sell copies of the Software, and to permit persons to whom the Software is
+#// furnished to do so, subject to the following conditions:
+#//
+#// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+#// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+#// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+#// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+#// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+#// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+#// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+#// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#//
+#//=============================================================================
+
+include $(ROOT)/mak/config-unix.mak
+
+OS = solaris
+
+COMPILER = CC
+
+CC = cc
+
+CXX = CC
+
+SH = sh
+
+YACC = yacc
+
+RM = rm -f
+
+DIFF = diff
+
+SORT = sort
+
+COPY = cp
+
+MOVE = mv
+
+LIB_SUFFIX = .so
+
+PEGASUS_SUPPORTS_DYNLIB = yes
+
+SYS_INCLUDES =
+
+##==============================================================================
+##
+## DEFINES
+##
+##==============================================================================
+
+DEFINES += -DPEGASUS_PLATFORM_$(PEGASUS_PLATFORM)
+DEFINES += -D_POSIX_PTHREAD_SEMANTICS
+DEFINES += -DPEGASUS_OS_SOLARIS
+
+##==============================================================================
+##
+## FLAGS
+##
+##==============================================================================
+
+ifdef PEGASUS_USE_DEBUG_BUILD_OPTIONS
+ FLAGS = -g -xs
+else
+ FLAGS = -O2 -s
+endif
+
+ifdef PEGASUS_SOLARIS_NEED_PTO
+ FLAGS += -pto
+endif
+
+FLAGS += +w -KPIC -mt -xildoff
+
+##==============================================================================
+##
+## COMMON_SYS_LIBS
+##
+##==============================================================================
+
+COMMON_SYS_LIBS = -lpthread -ldl -lsocket -lnsl -lxnet -lCstd -lrt
+
+##==============================================================================
+##
+## SYS_LIBS (system libraries needed to build programs)
+##
+##==============================================================================
+
+SYS_LIBS = $(COMMON_SYS_LIBS) $(EXTRA_LIBRARIES)
+
+##==============================================================================
+##
+## LIBRARY_SYS_LIBS (system libraries needed to build other libraries)
+##
+##==============================================================================
+
+LIBRARY_SYS_LIBS = $(COMMON_SYS_LIBS)
+
+##==============================================================================
+##
+## OpenSSL Settings
+##
+## To build for SSL, add PEGASUS_HAS_SSL=1 to environment
+##
+##==============================================================================
+
+ifndef OPENSSL_HOME
+ OPENSSL_HOME=/usr/sfw
+endif
+
+ifndef OPENSSL_BIN
+ OPENSSL_BIN=/usr/sfw/bin
+endif
+
+ifndef OPENSSL_COMMAND
+ OPENSSL_COMMAND=/usr/sfw/bin/openssl
+endif
+
+ifndef PEGASUS_ENABLE_SSL_CRL_VERIFICATION
+ PEGASUS_ENABLE_SSL_CRL_VERIFICATION=true
+endif
+
+ifndef PEGASUS_USE_SSL_RANDOMFILE
+ PEGASUS_USE_SSL_RANDOMFILE=true
+endif
+
+ifdef PEGASUS_HAS_SSL
+ FLAGS += -L$(OPENSSL_HOME)/lib
+endif
+
+##==============================================================================
+##
+## OpenSPL Settings
+##
+## To build for SSL, add PEGASUS_HAS_SSL=1 to environment
+##
+##==============================================================================
+
+ifndef PEGASUS_OPENSLP_HOME
+ PEGASUS_OPENSLP_HOME=/usr
+endif
+
+ifeq ($(PEGASUS_USE_OPENSLP),true)
+ FLAGS += -L$(PEGASUS_OPENSLP_HOME)/lib
+endif
diff --git a/src/Pegasus/Common/OrderedSet.h b/src/Pegasus/Common/OrderedSet.h
index 31f69da..02d8772 100644
--- a/src/Pegasus/Common/OrderedSet.h
+++ b/src/Pegasus/Common/OrderedSet.h
@@ -111,7 +111,7 @@ public:
void reserveCapacity(Uint32 capacity)
{
- _array.reserveCapacity(capacity * sizeof(Node));
+ _array.reserveCapacity(capacity * Uint32(sizeof(Node)));
}
Uint32 find(const CIMName& name, Uint32 nameTag) const;
@@ -257,7 +257,7 @@ inline void OrderedSet<T, R, N>::append(const T& x)
// which following have to be _reorganized
Boolean reOrg = (_array.capacity() < sizeof(Node) + _array.size());
if (reOrg)
- reserveCapacity((_size + 1) << 1);
+ reserveCapacity(Uint32((_size + 1) << 1));
// First append to _array(dynamic, ordered list):
{
@@ -266,7 +266,7 @@ inline void OrderedSet<T, R, N>::append(const T& x)
node.index = _size;
node.next = (*_table)[code];
- _array.append((const char*) &node, sizeof(node));
+ _array.append((const char*) &node, Uint32(sizeof(node)));
}
// Now add to hash table
@@ -296,7 +296,7 @@ inline void OrderedSet<T, R, N>::remove(Uint32 index)
Node* node = (Node*) _array.getData() + index;
node->rep->decreaseOwnerCount();
Dec(node->rep);
- _array.remove(index * sizeof(Node), sizeof(Node));
+ _array.remove(index * Uint32(sizeof(Node)), Uint32(sizeof(Node)));
_size--;
}
@@ -335,7 +335,8 @@ inline void OrderedSet<T, R, N>::insert(Uint32 index, const T& x)
Node node;
node.rep = layout->rep;
node.index = _size;
- _array.insert(index * sizeof(Node), (const char*) &node, sizeof(node));
+ _array.insert(index * Uint32(sizeof(Node)), (const char*) &node,
+ Uint32(sizeof(node)));
layout->rep->increaseOwnerCount();
Inc(layout->rep);
_size++;
diff --git a/src/Pegasus/Common/Threads.cpp b/src/Pegasus/Common/Threads.cpp
index 81fef8c..ca8d32d 100644
--- a/src/Pegasus/Common/Threads.cpp
+++ b/src/Pegasus/Common/Threads.cpp
@@ -48,8 +48,7 @@
# include <unistd.h>
#endif
-#if defined(PEGASUS_PLATFORM_SOLARIS_IX86_CC) || \
- defined(PEGASUS_PLATFORM_SOLARIS_X86_64_CC)
+#if defined(PEGASUS_OS_SOLARIS)
# include <unistd.h>
#endif
@@ -208,14 +207,11 @@ int Threads::create(
// Scheduling policy:
-#if defined(PEGASUS_PLATFORM_SOLARIS_SPARC_GNU) || \
- defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
-# if (defined SUNOS_5_7)
- pthread_attr_setschedpolicy(&attr, SCHED_RR);
-# else
+#if defined(PEGASUS_OS_SOLARIS)
+
pthread_attr_setschedpolicy(&attr, SCHED_OTHER);
-# endif
-#endif // PEGASUS_PLATFORM_SOLARIS_SPARC_GNU
+
+#endif /* defined(PEGASUS_OS_SOLARIS) */
// Create thread:
diff --git a/src/Pegasus/Common/tests/IPC/IPC.cpp b/src/Pegasus/Common/tests/IPC/IPC.cpp
index b47644a..8b60ee4 100644
--- a/src/Pegasus/Common/tests/IPC/IPC.cpp
+++ b/src/Pegasus/Common/tests/IPC/IPC.cpp
@@ -125,10 +125,8 @@ ThreadReturnType PEGASUS_THREAD_CDECL deq(void * parm)
while (type != CLOSE_CONNECTION_MESSAGE)
{
message = mq->dequeue();
- while (!message) {
-#if defined PEGASUS_OS_SOLARIS && defined SUNOS_5_6
- Threads::sleep(1);
-#endif
+ while (!message)
+ {
message = mq->dequeue();
}