diff -urN base-3.14.7.org/config/CONFIG.Host.osf-alpha-gnu base-3.14.7/config/CONFIG.Host.osf-alpha-gnu --- base-3.14.7.org/config/CONFIG.Host.osf-alpha-gnu 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/config/CONFIG.Host.osf-alpha-gnu 2005-03-27 04:46:00.000000000 +0900 @@ -0,0 +1,13 @@ +#************************************************************************* +# Copyright (c) 2002 The University of Chicago, as Operator of Argonne +# National Laboratory. +# Copyright (c) 2002 The Regents of the University of California, as +# Operator of Los Alamos National Laboratory. +# EPICS BASE Versions 3.13.7 +# and higher are distributed subject to a Software License Agreement found +# in file LICENSE that is included with this distribution. +#************************************************************************* +# CONFIG.Host.osf-alpha,v 1.2 2002/07/12 21:32:21 jba Exp + +# osf-alpha is the new name for alpha +-include $(EPICS_BASE)/config/CONFIG.Host.alpha diff -urN base-3.14.7.org/configure/os/CONFIG.Common.osf-alpha base-3.14.7/configure/os/CONFIG.Common.osf-alpha --- base-3.14.7.org/configure/os/CONFIG.Common.osf-alpha 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/configure/os/CONFIG.Common.osf-alpha 2005-03-27 10:05:44.000000000 +0900 @@ -0,0 +1,35 @@ +# CONFIG.Common.osf-alpha +# +# CONFIG.Common.osf-alpha,v 1.3 2003/03/18 22:44:43 jba Exp +# This file is maintained by the build community. +# +# Definitions for osf-alpha target archs +# Sites may override these definitions in CONFIG_SITE.Common.osf-alpha +#------------------------------------------------------- + +# Include definitions common to all Unix targets +include $(CONFIG)/os/CONFIG.Common.UnixCommon + +OS_CLASS = osf +ARCH_CLASS = alpha + +CODE_CPPFLAGS = + +POSIX_CPPFLAGS_YES = +POSIX_LDLIBS_YES += +POSIX_CPPFLAGS_NO = +POSIX_LDLIBS_NO += + +OP_SYS_CPPFLAGS = -D_OSF_SOURCE -DUNIX +OP_SYS_LDLIBS += -lpthread -lrt +USR_SYS_LIBS += m +space:=$(empty) $(empty) +colon := : +RUNTIME_LDFLAGS = -rpath $(SHRLIB_SEARCH_FULLPATHDIRS) + +ifdef CROSS + GNU_TARGET=alpha-osf + CMPLR_SUFFIX= + CMPLR_PREFIX=$(addsuffix -,$(GNU_TARGET)) +endif + diff -urN base-3.14.7.org/configure/os/CONFIG.Common.osf-alpha-gnu base-3.14.7/configure/os/CONFIG.Common.osf-alpha-gnu --- base-3.14.7.org/configure/os/CONFIG.Common.osf-alpha-gnu 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/configure/os/CONFIG.Common.osf-alpha-gnu 2005-03-27 11:11:57.000000000 +0900 @@ -0,0 +1,35 @@ +# CONFIG.Common.osf-alpha +# +# CONFIG.Common.osf-alpha,v 1.3 2003/03/18 22:44:43 jba Exp +# This file is maintained by the build community. +# +# Definitions for osf-alpha target archs +# Sites may override these definitions in CONFIG_SITE.Common.osf-alpha +#------------------------------------------------------- + +# Include definitions common to all Unix targets +include $(CONFIG)/os/CONFIG.Common.UnixCommon + +OS_CLASS = osf +ARCH_CLASS = alpha + +CODE_CPPFLAGS = + +POSIX_CPPFLAGS_YES = +POSIX_LDLIBS_YES += +POSIX_CPPFLAGS_NO = +POSIX_LDLIBS_NO += + +OP_SYS_CPPFLAGS = -D_OSF_SOURCE -D_REENTRANT -DUNIX +OP_SYS_LDLIBS += -lpthread -lrt + +space:=$(empty) $(empty) +colon := : +RUNTIME_LDFLAGS = $(SHRLIB_SEARCH_FULLPATHDIRS:%=-Wl,-rpath,%) + +ifdef CROSS + GNU_TARGET=alpha-osf + CMPLR_SUFFIX= + CMPLR_PREFIX=$(addsuffix -,$(GNU_TARGET)) +endif + diff -urN base-3.14.7.org/configure/os/CONFIG.osf-alpha-gnu.Common base-3.14.7/configure/os/CONFIG.osf-alpha-gnu.Common --- base-3.14.7.org/configure/os/CONFIG.osf-alpha-gnu.Common 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/configure/os/CONFIG.osf-alpha-gnu.Common 2005-03-27 04:46:00.000000000 +0900 @@ -0,0 +1,14 @@ +# CONFIG.osf-alpha.Common +# +# CONFIG.osf-alpha.Common,v 1.2 2001/01/12 23:19:19 jba Exp +# This file is maintained by the build community. +# +# Definitions for osf-alpha host archs +# Sites may override these definitions in CONFIG_SITE.osf-alpha.Common +#------------------------------------------------------- + +#Include definitions common to unix hosts +include $(CONFIG)/os/CONFIG.UnixCommon.Common + +WIND_HOST_TYPE = osf-alpha + diff -urN base-3.14.7.org/configure/os/CONFIG.osf-alpha-gnu.osf-alpha-gnu base-3.14.7/configure/os/CONFIG.osf-alpha-gnu.osf-alpha-gnu --- base-3.14.7.org/configure/os/CONFIG.osf-alpha-gnu.osf-alpha-gnu 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/configure/os/CONFIG.osf-alpha-gnu.osf-alpha-gnu 2005-03-27 04:46:00.000000000 +0900 @@ -0,0 +1,51 @@ +# CONFIG.osf-alpha.osf-alpha +# +# CONFIG.osf-alpha.osf-alpha,v 1.11.2.1 2003/07/03 16:17:34 jba Exp +# This file is maintained by the build community. +# +# Definitions for osf-alpha host archs +# Sites may override these definitions in CONFIG_SITE.osf-alpha.osf-alpha +#------------------------------------------------------- + +# CC = cc +CC = gcc +# CCC = cxx +CCC = g++ +CPP = $(CC) -E +RANLIB = +AR = ar -r +LD = -r + +# Configure OS vendor C compiler +CONFORM_CFLAGS_ANSI = +CONFORM_CFLAGS_STRICT = +CONFORM_CFLAGS_TRAD = +CODE_CFLAGS = +WARN_CFLAGS_YES = +WARN_CFLAGS_NO = -w +OPT_CFLAGS_YES = -O +OPT_CFLAGS_NO = -g + +# Configure OS vendor C++ compiler +CONFORM_CXXFLAGS_NORMAL = +CONFORM_CXXFLAGS_STRICT = +PROF_CXXFLAGS_YES = +p +PROF_CXXFLAGS_NO = +CODE_CXXFLAGS = +WARN_CXXFLAGS_YES = +WARN_CXXFLAGS_NO = +OPT_CXXFLAGS_YES = -O +OPT_CXXFLAGS_NO = -g + +STATIC_LDFLAGS_YES= -Bstatic -lrt -lpthread +STATIC_LDFLAGS_NO= +STATIC_LDLIBS_YES= -Bdynamic +STATIC_LDLIBS_NO= + +SHRLIB_LDFLAGS = -shared +LOADABLE_SHRLIB_LDFLAGS = $(SHRLIB_LDFLAGS) + +############# ??????????? +#####ACC_SFLAGS_YES= -non_shared +#####ACC_SFLAGS_NO= -call_shared + diff -urN base-3.14.7.org/configure/os/CONFIG.osf-alpha.Common base-3.14.7/configure/os/CONFIG.osf-alpha.Common --- base-3.14.7.org/configure/os/CONFIG.osf-alpha.Common 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/configure/os/CONFIG.osf-alpha.Common 2005-03-27 04:46:00.000000000 +0900 @@ -0,0 +1,14 @@ +# CONFIG.osf-alpha.Common +# +# CONFIG.osf-alpha.Common,v 1.2 2001/01/12 23:19:19 jba Exp +# This file is maintained by the build community. +# +# Definitions for osf-alpha host archs +# Sites may override these definitions in CONFIG_SITE.osf-alpha.Common +#------------------------------------------------------- + +#Include definitions common to unix hosts +include $(CONFIG)/os/CONFIG.UnixCommon.Common + +WIND_HOST_TYPE = osf-alpha + diff -urN base-3.14.7.org/configure/os/CONFIG.osf-alpha.osf-alpha base-3.14.7/configure/os/CONFIG.osf-alpha.osf-alpha --- base-3.14.7.org/configure/os/CONFIG.osf-alpha.osf-alpha 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/configure/os/CONFIG.osf-alpha.osf-alpha 2005-03-27 04:46:00.000000000 +0900 @@ -0,0 +1,49 @@ +# CONFIG.osf-alpha.osf-alpha +# +# CONFIG.osf-alpha.osf-alpha,v 1.11.2.1 2003/07/03 16:17:34 jba Exp +# This file is maintained by the build community. +# +# Definitions for osf-alpha host archs +# Sites may override these definitions in CONFIG_SITE.osf-alpha.osf-alpha +#------------------------------------------------------- + +CC = cc +CCC = cxx +CPP = $(CC) -E +RANLIB = +AR = ar -r +LD = -r + +# Configure OS vendor C compiler +CONFORM_CFLAGS_ANSI = -std +CONFORM_CFLAGS_STRICT = -std1 -pthread -ieee +CONFORM_CFLAGS_TRAD = -std0 +CODE_CFLAGS = +WARN_CFLAGS_YES = +WARN_CFLAGS_NO = -w +OPT_CFLAGS_YES = -O +OPT_CFLAGS_NO = -g + +# Configure OS vendor C++ compiler +CONFORM_CXXFLAGS_NORMAL = +CONFORM_CXXFLAGS_STRICT = -std gnu -pthread -ieee +PROF_CXXFLAGS_YES = +p +PROF_CXXFLAGS_NO = +CODE_CXXFLAGS = +WARN_CXXFLAGS_YES = +WARN_CXXFLAGS_NO = +OPT_CXXFLAGS_YES = -O +OPT_CXXFLAGS_NO = -g + +STATIC_LDFLAGS_YES= -Bstatic +STATIC_LDFLAGS_NO= +STATIC_LDLIBS_YES= -Bdynamic +STATIC_LDLIBS_NO= + +SHRLIB_LDFLAGS = -shared +LOADABLE_SHRLIB_LDFLAGS = $(SHRLIB_LDFLAGS) + +############# ??????????? +#####ACC_SFLAGS_YES= -non_shared +#####ACC_SFLAGS_NO= -call_shared + diff -urN base-3.14.7.org/documentation/README.tru64unix base-3.14.7/documentation/README.tru64unix --- base-3.14.7.org/documentation/README.tru64unix 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/documentation/README.tru64unix 2005-03-27 04:56:02.000000000 +0900 @@ -0,0 +1,76 @@ +Compiling EPICS and Building IOC Applications on Tru64Unix/Alpha + (former Digital-Unix, and even former OSF1) + for architectures "osf-alpha" and "osf-alpha-gnu" + +====================================================================== + +Tools needed +------------ + +For C/C++ Compiler, you need one of these compiler set. + + - DEC/Compaq/HP's ANSI C/C++ compilers for "osf-alpha" + I used + cc -V + Compaq C V6.5-011 on Compaq Tru64 UNIX V5.1B (Rev. 2650) + Compiler Driver V6.5-003 (sys) cc Driver + cxx -V + Compaq C++ V6.5-014 for Compaq Tru64 UNIX V5.1B (Rev. 2650) + Compiler Driver V6.5-014 (cxx) cxx Driver + + - GNU gcc/g++ compiler for "osf-alpha-gnu" + I used + gcc --version + gcc (GCC) 3.4.1 + +Environment +----------- + +Before compiling, please set the environment variable EPICS_HOST_ARCH +dependent on your compiler. + + for cc/cxx + setenv EPICS_HOST_ARCH osf-alpha + export EPICS_HOST_ARCH=osf-alpha + + for gcc/g++ + setenv EPICS_HOST_ARCH osf-alpha-gnu + export EPICS_HOST_ARCH=osf-alpha-gnu + +Building +-------- + +Should be quite straightforward. Edit (if necessary) the CONFIG_SITE +files and "make". (Be sure that GNU make is in your path or call it +explicitly as the standard make on Tru64Unix is _not_ GNU.) + +For example (with csh): + setenv EPICS_HOST_ARCH osf-alpha + make |& tee ../make-base-osf.log + setenv EPICS_HOST_ARCH osf-alpha-gnu + make |& tee ../make-base-osfgnu.log + cd bin/osf-alpha + foreach f (*TestHost epics*Test) + time ./$f + end + +Some internals +----------------------- + +__alpha is used to distinguish this architecture from others. +__DECCXX is used to distinguish DEC/Compaq/HP C++ compiler from GNU's. +There are several ways to specify compiler options for pthread. + Please consult the pthread(3) manual page. +src/libCom/osi/os/osf is used for osi definitions, + src/libCom/osi/os/alpha is not used. +About 230 warning messages with cc/cxx, and 6 with gcc. Sometimes + errors from cxx are intuitive. +I just started to use IOC application for a gateway purpose. There + can be architecture-dependent problems, that I didn't find yet. + +Only several lines in configure and src files were modified from + base-3.14.4/5/6/7. Thanks for keeping the alpha-osf dependent part + in the distribution. + + +Kazuro Furukawa diff -urN base-3.14.7.org/src/ca/comBuf.h base-3.14.7/src/ca/comBuf.h --- base-3.14.7.org/src/ca/comBuf.h 2004-10-05 03:55:36.000000000 +0900 +++ base-3.14.7/src/ca/comBuf.h 2005-03-27 04:46:00.000000000 +0900 @@ -90,6 +90,9 @@ bool push ( const epicsFloat32 & value ); bool push ( const epicsFloat64 & value ); bool push ( const epicsOldString & value ); +#ifdef __DECCXX /* cxx on osf-alpha */ + bool push ( const char * value ); +#endif /* __DECCXX */ unsigned push ( const epicsInt8 * pValue, unsigned nElem ); unsigned push ( const epicsUInt8 * pValue, unsigned nElem ); unsigned push ( const epicsInt16 * pValue, unsigned nElem ); @@ -323,6 +326,20 @@ return true; } +#ifdef __DECCXX /* cxx on osf-alpha */ +inline bool comBuf::push ( const char * value ) +{ + unsigned index = this->nextWriteIndex; + unsigned available = sizeof ( this->buf ) - index; + if ( sizeof ( value ) > available ) { + return false; + } + memcpy ( &this->buf[ index ], & value, sizeof ( value ) ); + this->nextWriteIndex = index + sizeof ( value ); + return true; +} +#endif /* __DECCXX */ + inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) { return copyInBytes ( pValue, nElem ); diff -urN base-3.14.7.org/src/ca/comBuf.h~ base-3.14.7/src/ca/comBuf.h~ --- base-3.14.7.org/src/ca/comBuf.h~ 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/src/ca/comBuf.h~ 2004-10-05 03:55:36.000000000 +0900 @@ -0,0 +1,495 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* + * + * + * L O S A L A M O S + * Los Alamos National Laboratory + * Los Alamos, New Mexico 87545 + * + * Copyright, 1986, The Regents of the University of California. + * + * + * Author Jeffrey O. Hill + * johill@lanl.gov + */ + +#ifndef comBufh +#define comBufh + +#include + +#include + +#include "epicsAssert.h" +#include "epicsTypes.h" +#include "tsFreeList.h" +#include "tsDLList.h" +#include "osiWireFormat.h" +#include "compilerDependencies.h" + +static const unsigned comBufSize = 0x4000; + +// this wrapper avoids Tornado 2.0.1 compiler bugs +class comBufMemoryManager { +public: + virtual ~comBufMemoryManager (); + virtual void * allocate ( size_t ) = 0; + virtual void release ( void * ) = 0; +}; + +class wireSendAdapter { // X aCC 655 +public: + virtual unsigned sendBytes ( const void * pBuf, + unsigned nBytesInBuf, + const class epicsTime & currentTime ) = 0; +}; + +enum swioCircuitState { + swioConnected, + swioPeerHangup, + swioPeerAbort, + swioLinkFailure, + swioLocalAbort +}; +struct statusWireIO { + unsigned bytesCopied; + swioCircuitState circuitState; +}; + +class wireRecvAdapter { // X aCC 655 +public: + virtual void recvBytes ( void * pBuf, + unsigned nBytesInBuf, statusWireIO & ) = 0; +}; + +class comBuf : public tsDLNode < comBuf > { +public: + class insufficentBytesAvailable {}; + comBuf (); + unsigned unoccupiedBytes () const; + unsigned occupiedBytes () const; + unsigned uncommittedBytes () const; + static unsigned capacityBytes (); + void clear (); + unsigned copyInBytes ( const void *pBuf, unsigned nBytes ); + unsigned push ( comBuf & ); + bool push ( const epicsInt8 value ); + bool push ( const epicsUInt8 value ); + bool push ( const epicsInt16 value ); + bool push ( const epicsUInt16 value ); + bool push ( const epicsInt32 value ); + bool push ( const epicsUInt32 value ); + bool push ( const epicsFloat32 & value ); + bool push ( const epicsFloat64 & value ); + bool push ( const epicsOldString & value ); + unsigned push ( const epicsInt8 * pValue, unsigned nElem ); + unsigned push ( const epicsUInt8 * pValue, unsigned nElem ); + unsigned push ( const epicsInt16 * pValue, unsigned nElem ); + unsigned push ( const epicsUInt16 * pValue, unsigned nElem ); + unsigned push ( const epicsInt32 * pValue, unsigned nElem ); + unsigned push ( const epicsUInt32 * pValue, unsigned nElem ); + unsigned push ( const epicsFloat32 * pValue, unsigned nElem ); + unsigned push ( const epicsFloat64 * pValue, unsigned nElem ); + unsigned push ( const epicsOldString * pValue, unsigned nElem ); + void commitIncomming (); + void clearUncommittedIncomming (); + bool copyInAllBytes ( const void *pBuf, unsigned nBytes ); + unsigned copyOutBytes ( void *pBuf, unsigned nBytes ); + bool copyOutAllBytes ( void *pBuf, unsigned nBytes ); + unsigned removeBytes ( unsigned nBytes ); + bool flushToWire ( wireSendAdapter &, const epicsTime & currentTime ); + void fillFromWire ( wireRecvAdapter &, statusWireIO & ); + struct popStatus { + bool success; + bool nowEmpty; + }; + popStatus pop ( epicsUInt8 & ); + popStatus pop ( epicsUInt16 & ); + popStatus pop ( epicsUInt32 & ); + static void throwInsufficentBytesException (); + void * operator new ( size_t size, + comBufMemoryManager & ); + epicsPlacementDeleteOperator (( void *, comBufMemoryManager & )) +private: + unsigned commitIndex; + unsigned nextWriteIndex; + unsigned nextReadIndex; + epicsUInt8 buf [ comBufSize ]; + void * operator new ( size_t size ); + void operator delete ( void * ); +}; + +inline void * comBuf::operator new ( size_t size, + comBufMemoryManager & mgr ) +{ + return mgr.allocate ( size ); +} + +#ifdef CXX_PLACEMENT_DELETE +inline void comBuf::operator delete ( void * pCadaver, + comBufMemoryManager & mgr ) +{ + mgr.release ( pCadaver ); +} +#endif + +inline comBuf::comBuf () : commitIndex ( 0u ), + nextWriteIndex ( 0u ), nextReadIndex ( 0u ) +{ +} + +inline void comBuf::clear () +{ + this->commitIndex = 0u; + this->nextWriteIndex = 0u; + this->nextReadIndex = 0u; +} + +inline unsigned comBuf::unoccupiedBytes () const +{ + return sizeof ( this->buf ) - this->nextWriteIndex; +} + +inline unsigned comBuf::occupiedBytes () const +{ + return this->commitIndex - this->nextReadIndex; +} + +inline unsigned comBuf::uncommittedBytes () const +{ + return this->nextWriteIndex - this->commitIndex; +} + +inline unsigned comBuf::push ( comBuf & bufIn ) +{ + unsigned nBytes = this->copyInBytes ( + & bufIn.buf[ bufIn.nextReadIndex ], + bufIn.commitIndex - bufIn.nextReadIndex ); + bufIn.nextReadIndex += nBytes; + return nBytes; +} + +inline unsigned comBuf::capacityBytes () +{ + return comBufSize; +} + +inline void comBuf::fillFromWire ( + wireRecvAdapter & wire, statusWireIO & stat ) +{ + wire.recvBytes ( + & this->buf[this->nextWriteIndex], + sizeof ( this->buf ) - this->nextWriteIndex, stat ); + if ( stat.circuitState == swioConnected ) { + this->nextWriteIndex += stat.bytesCopied; + } +} + +inline bool comBuf::push ( const epicsInt8 value ) +{ + unsigned index = this->nextWriteIndex; + unsigned nextIndex = index + sizeof ( value ); + if ( nextIndex <= sizeof ( this->buf ) ) { + this->buf[ index ] = static_cast < epicsUInt8 > ( value ); + this->nextWriteIndex = nextIndex; + return true; + } + return false; +} + +inline bool comBuf::push ( const epicsUInt8 value ) +{ + unsigned index = this->nextWriteIndex; + unsigned nextIndex = index + sizeof ( value ); + if ( nextIndex <= sizeof ( this->buf ) ) { + this->buf[ index ] = value; + this->nextWriteIndex = nextIndex; + return true; + } + return false; +} + +inline bool comBuf::push ( const epicsInt16 value ) +{ + unsigned index = this->nextWriteIndex; + unsigned nextIndex = index + sizeof ( value ); + if ( nextIndex <= sizeof ( this->buf ) ) { + this->buf[ index + 0u ] = + static_cast < epicsUInt8 > ( value >> 8u ); + this->buf[ index + 1u ] = + static_cast < epicsUInt8 > ( value >> 0u ); + this->nextWriteIndex = nextIndex; + return true; + } + return false; +} + +inline bool comBuf::push ( const epicsUInt16 value ) +{ + unsigned index = this->nextWriteIndex; + unsigned nextIndex = index + sizeof ( value ); + if ( nextIndex <= sizeof ( this->buf ) ) { + this->buf[ index + 0u ] = + static_cast < epicsUInt8 > ( value >> 8u ); + this->buf[ index + 1u ] = + static_cast < epicsUInt8 > ( value >> 0u ); + this->nextWriteIndex = nextIndex; + return true; + } + return false; +} + +inline bool comBuf::push ( const epicsInt32 value ) +{ + unsigned index = this->nextWriteIndex; + unsigned nextIndex = index + sizeof ( value ); + if ( nextIndex <= sizeof ( this->buf ) ) { + this->buf[ index + 0u ] = + static_cast < epicsUInt8 > ( value >> 24u ); + this->buf[ index + 1u ] = + static_cast < epicsUInt8 > ( value >> 16u ); + this->buf[ index + 2u ] = + static_cast < epicsUInt8 > ( value >> 8u ); + this->buf[ index + 3u ] = + static_cast < epicsUInt8 > ( value >> 0u ); + this->nextWriteIndex = nextIndex; + return true; + } + return false; +} + +inline bool comBuf::push ( const epicsUInt32 value ) +{ + unsigned index = this->nextWriteIndex; + unsigned nextIndex = index + sizeof ( value ); + if ( nextIndex <= sizeof ( this->buf ) ) { + this->buf[ index + 0u ] = + static_cast < epicsUInt8 > ( value >> 24u ); + this->buf[ index + 1u ] = + static_cast < epicsUInt8 > ( value >> 16u ); + this->buf[ index + 2u ] = + static_cast < epicsUInt8 > ( value >> 8u ); + this->buf[ index + 3u ] = + static_cast < epicsUInt8 > ( value >> 0u ); + this->nextWriteIndex = nextIndex; + return true; + } + return false; +} + +inline bool comBuf::push ( const epicsFloat32 & value ) +{ + unsigned index = this->nextWriteIndex; + unsigned available = sizeof ( this->buf ) - index; + if ( sizeof ( value ) > available ) { + return false; + } + // allow native floating point formats to be converted to IEEE + osiConvertToWireFormat ( value, & this->buf[index] ); + this->nextWriteIndex = index + sizeof ( value ); + return true; +} + +inline bool comBuf::push ( const epicsFloat64 & value ) +{ + unsigned index = this->nextWriteIndex; + unsigned available = sizeof ( this->buf ) - index; + if ( sizeof ( value ) > available ) { + return false; + } + // allow native floating point formats to be converted to IEEE + osiConvertToWireFormat ( value, & this->buf[index] ); + this->nextWriteIndex = index + sizeof ( value ); + return true; +} + +inline bool comBuf::push ( const epicsOldString & value ) +{ + unsigned index = this->nextWriteIndex; + unsigned available = sizeof ( this->buf ) - index; + if ( sizeof ( value ) > available ) { + return false; + } + memcpy ( &this->buf[ index ], & value, sizeof ( value ) ); + this->nextWriteIndex = index + sizeof ( value ); + return true; +} + +inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) +{ + return copyInBytes ( pValue, nElem ); +} + +inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem ) +{ + return copyInBytes ( pValue, nElem ); +} + +inline unsigned comBuf::push ( const epicsOldString * pValue, unsigned nElem ) +{ + unsigned index = this->nextWriteIndex; + unsigned available = sizeof ( this->buf ) - index; + unsigned nBytes = sizeof ( *pValue ) * nElem; + if ( nBytes > available ) { + nElem = available / sizeof ( *pValue ); + nBytes = nElem * sizeof ( *pValue ); + } + memcpy ( &this->buf[ index ], pValue, nBytes ); + this->nextWriteIndex = index + nBytes; + return nElem; +} + +inline void comBuf::commitIncomming () +{ + this->commitIndex = this->nextWriteIndex; +} + +inline void comBuf::clearUncommittedIncomming () +{ + this->nextWriteIndex = this->commitIndex; +} + +inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) +{ + unsigned index = this->nextWriteIndex; + unsigned available = sizeof ( this->buf ) - index; + if ( nBytes <= available ) { + memcpy ( & this->buf[index], pBuf, nBytes ); + this->nextWriteIndex = index + nBytes; + return true; + } + return false; +} + +inline unsigned comBuf::copyInBytes ( const void * pBuf, unsigned nBytes ) +{ + unsigned index = this->nextWriteIndex; + unsigned available = sizeof ( this->buf ) - index; + if ( nBytes > available ) { + nBytes = available; + } + memcpy ( & this->buf[index], pBuf, nBytes ); + this->nextWriteIndex = index + nBytes; + return nBytes; +} + +inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) +{ + unsigned index = this->nextReadIndex; + unsigned occupied = this->commitIndex - index; + if ( nBytes <= occupied ) { + memcpy ( pBuf, &this->buf[index], nBytes); + this->nextReadIndex = index + nBytes; + return true; + } + return false; +} + +inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) +{ + unsigned index = this->nextReadIndex; + unsigned occupied = this->commitIndex - index; + if ( nBytes > occupied ) { + nBytes = occupied; + } + memcpy ( pBuf, &this->buf[index], nBytes); + this->nextReadIndex = index + nBytes; + return nBytes; +} + +inline unsigned comBuf::removeBytes ( unsigned nBytes ) +{ + unsigned index = this->nextReadIndex; + unsigned occupied = this->commitIndex - index; + if ( nBytes > occupied ) { + nBytes = occupied; + } + this->nextReadIndex = index + nBytes; + return nBytes; +} + +inline comBuf::popStatus comBuf::pop ( epicsUInt8 & returnVal ) +{ + unsigned nrIndex = this->nextReadIndex; + unsigned popIndex = nrIndex + sizeof ( returnVal ); + unsigned cIndex = this->commitIndex; + popStatus status; + status.success = true; + status.nowEmpty = false; + if ( popIndex >= cIndex ) { + if ( popIndex == cIndex ) { + status.nowEmpty = true; + } + else { + status.success = false; + return status; + } + } + returnVal = this->buf[ nrIndex ]; + this->nextReadIndex = popIndex; + return status; +} + +inline comBuf::popStatus comBuf::pop ( epicsUInt16 & returnVal ) +{ + unsigned nrIndex = this->nextReadIndex; + unsigned popIndex = nrIndex + sizeof ( returnVal ); + unsigned cIndex = this->commitIndex; + popStatus status; + status.success = true; + status.nowEmpty = false; + if ( popIndex >= cIndex ) { + if ( popIndex == cIndex ) { + status.nowEmpty = true; + } + else { + status.success = false; + return status; + } + } + returnVal = + static_cast < epicsUInt16 > ( + ( this->buf[ nrIndex + 0 ] << 8u ) | + this->buf[ nrIndex + 1 ] + ); + this->nextReadIndex = popIndex; + return status; +} + +inline comBuf::popStatus comBuf::pop ( epicsUInt32 & returnVal ) +{ + unsigned nrIndex = this->nextReadIndex; + unsigned popIndex = nrIndex + sizeof ( returnVal ); + unsigned cIndex = this->commitIndex; + popStatus status; + status.success = true; + status.nowEmpty = false; + if ( popIndex >= cIndex ) { + if ( popIndex == cIndex ) { + status.nowEmpty = true; + } + else { + status.success = false; + return status; + } + } + returnVal = + static_cast < epicsUInt32 > ( + ( this->buf[ nrIndex + 0 ] << 24u ) | + ( this->buf[ nrIndex + 1 ] << 16u ) | + ( this->buf[ nrIndex + 2 ] << 8u ) | + this->buf[ nrIndex + 3 ] + ); + this->nextReadIndex = popIndex; + return status; +} + +#endif // ifndef comBufh diff -urN base-3.14.7.org/src/libCom/osi/os/osf/epicsMath.h base-3.14.7/src/libCom/osi/os/osf/epicsMath.h --- base-3.14.7.org/src/libCom/osi/os/osf/epicsMath.h 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/src/libCom/osi/os/osf/epicsMath.h 2005-03-27 04:46:01.000000000 +0900 @@ -0,0 +1,16 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +#ifndef epicsMathh +#define epicsMathh + +#include +#define isinf(D) (!finite((D)) && !(isnan((D)))) + +#endif /* epicsMathh */ diff -urN base-3.14.7.org/src/libCom/osi/os/osf/osdSock.h base-3.14.7/src/libCom/osi/os/osf/osdSock.h --- base-3.14.7.org/src/libCom/osi/os/osf/osdSock.h 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/src/libCom/osi/os/osf/osdSock.h 2005-03-27 04:46:01.000000000 +0900 @@ -0,0 +1,73 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +/* + * alpha specific socket include + */ + +#ifndef osdSockH +#define osdSockH + +#ifdef __cplusplus +extern "C" { +struct ifafilt; +#endif + +#include + +#include +#include /* for MAXHOSTNAMELEN */ +#include +#include +#include +/* #include */ +/* #include */ +#include +#include +#include +#include +#include +#include /* close() and others */ + +#ifdef __cplusplus +} +#endif + +typedef int SOCKET; +#define INVALID_SOCKET (-1) +#define SOCKERRNO errno +#define socket_ioctl(A,B,C) ioctl(A,B,C) +typedef int osiSockIoctl_t; +typedef int osiSocklen_t; + +#define FD_IN_FDSET(FD) ((FD)=0) + +#define SOCK_EWOULDBLOCK EWOULDBLOCK +#define SOCK_ENOBUFS ENOBUFS +#define SOCK_ECONNRESET ECONNRESET +#define SOCK_ETIMEDOUT ETIMEDOUT +#define SOCK_EADDRINUSE EADDRINUSE +#define SOCK_ECONNREFUSED ECONNREFUSED +#define SOCK_ECONNABORTED ECONNABORTED +#define SOCK_EINPROGRESS EINPROGRESS +#define SOCK_EISCONN EISCONN +#define SOCK_EALREADY EALREADY +#define SOCK_EINVAL EINVAL +#define SOCK_EINTR EINTR +#define SOCK_EPIPE EPIPE +#define SOCK_EMFILE EMFILE +#define SOCK_SHUTDOWN ESHUTDOWN +#define SOCK_ENOTSOCK ENOTSOCK +#define SOCK_EBADF EBADF + +#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name)) + +#endif /*osdSockH*/ + diff -urN base-3.14.7.org/src/libCom/osi/os/osf/osiFileName.h base-3.14.7/src/libCom/osi/os/osf/osiFileName.h --- base-3.14.7.org/src/libCom/osi/os/osf/osiFileName.h 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/src/libCom/osi/os/osf/osiFileName.h 2005-03-27 04:46:01.000000000 +0900 @@ -0,0 +1,21 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* + * osiFileName.h + * Author: Jeff Hill + * + * + */ +#ifndef osiFileNameH +#define osiFileNameH + +#include "unixFileName.h" + +#endif /* osiFileNameH */ diff -urN base-3.14.7.org/src/libCom/test/epicsListTest.cpp base-3.14.7/src/libCom/test/epicsListTest.cpp --- base-3.14.7.org/src/libCom/test/epicsListTest.cpp 2004-09-16 09:44:59.000000000 +0900 +++ base-3.14.7/src/libCom/test/epicsListTest.cpp 2005-03-27 04:46:01.000000000 +0900 @@ -18,8 +18,10 @@ #include "epicsList.h" +#ifndef __DECCXX /* cxx on osf-alpha */ using std::cout; using std::endl; +#endif /* not __DECCXX */ #if defined(vxWorks) || defined(__rtems__) #define MAIN epicsListTest @@ -189,4 +191,4 @@ cout << tests << " tests completed, " << nak << " failed." << endl; return 0; -}; +} diff -urN base-3.14.7.org/src/libCom/test/epicsListTest.cpp~ base-3.14.7/src/libCom/test/epicsListTest.cpp~ --- base-3.14.7.org/src/libCom/test/epicsListTest.cpp~ 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.7/src/libCom/test/epicsListTest.cpp~ 2004-09-16 09:44:59.000000000 +0900 @@ -0,0 +1,192 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +// epicsListTest.cpp,v 1.7.2.1 2004/09/16 00:44:59 norume Exp +// Author: Andrew Johnson +// Date: December 2000 + +// Test code for the epics::List class + +#include +#include + +#include "epicsList.h" + +using std::cout; +using std::endl; + +#if defined(vxWorks) || defined(__rtems__) + #define MAIN epicsListTest + extern "C" int MAIN(int /*argc*/, char* /*argv[]*/); +#else + #define MAIN main +#endif + +class fred { +public: + fred(const char* const _name) : name(_name) {} + void show () const {cout << name << ' ';} +private: + const char* const name; +}; + +static int tests = 0; +static int nak = 0; + +static void check(bool res, const char* str, int line) { + tests++; + if (!res) { + printf("Test %d failed, line %d: %s\n", tests, line, str); + nak++; + } +} + +#define test(expr) check(expr, #expr, __LINE__) + +int MAIN(int /*argc*/, char* /*argv[]*/) { + + fred* apf[10]; + const char* const names[] = { + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" + }; + int i; + + for (i=0; i<10; i++) + apf[i] = new fred(names[i]); + + epicsList Fred; + test(Fred.empty()); + test(Fred.size() == 0); + test(Fred.begin() == Fred.end()); + + Fred.push_back(apf[0]); + test(!Fred.empty()); + test(Fred.size() == 1); + test(Fred.begin() != Fred.end()); + test(Fred.front() == apf[0]); + test(Fred.back() == apf[0]); + + epicsList::iterator Fi = Fred.begin(); + test(Fi != Fred.end()); + test(*Fi == apf[0]); + + epicsList::const_iterator Fci = Fred.begin(); + test(Fci != Fred.end()); + test(Fci == Fi); + test(Fi == Fci); + test(*Fci == apf[0]); + + ++Fi; + test(Fi == Fred.end()); + test(Fci != Fi); + test(Fi != Fci); + + ++Fci; + test(Fci == Fred.end()); + + Fci = --Fi; + test(Fi == Fred.begin()); + test(Fci == Fred.begin()); + + Fred.push_front(apf[1]); + test(Fred.size() == 2); + test(Fred.front() == apf[1]); + test(Fred.back() == apf[0]); + test(*Fi == apf[0]); + + Fi--; + test(*Fi == apf[1]); + + Fci--; + test(*Fci == apf[1]); + + Fi = Fred.insert(++Fi, apf[2]); + test(Fred.size() == 3); + test(Fred.front() == apf[1]); + test(Fred.back() == apf[0]); + test(Fi != Fci); + test(*Fi == apf[2]); + + Fred.pop_back(); + test(Fred.size() == 2); + + Fred.push_front(apf[0]); + test(Fred.size() == 3); + + Fi = Fred.begin(); + Fred.erase(Fi); + test(Fred.size() == 2); + + Fred.push_front(apf[0]); + test(Fred.size() == 3); + + Fi = Fred.begin(); + for (i=0; Fi != Fred.end(); i++, ++Fi) + test(*Fi == apf[i]); + + Fci = Fred.begin(); + for (i=0; Fci != Fred.end(); i++, ++Fci) + test(*Fci == apf[i]); + + for (i=0; i<10; i++) { + test(Fred.size() == 3); + + epicsList Freda; + test(Freda.empty()); + + epicsListSwap(Fred, Freda); + test(Fred.empty()); + test(Freda.size() == 3); + test(Freda.front() == apf[0]); + + for (Fi = Freda.begin(); Fi != Freda.end(); Fi++) + Fred.push_back(*Fi); + test(Fred.size() == 3); + + Fi = Freda.begin(); + for (Fci = Fred.begin(); Fci != Fred.end(); ++Fci, ++Fi) { + test(Fi != Freda.end()); + test(*Fci == *Fi); + } + // Freda's destructor returns her nodes to global store, + // from where they are allocated again during the next loop. + } + + Fred.erase(Fred.begin(), --Fred.end()); + test(Fred.size() == 1); + + Fred.clear(); + test(Fred.empty()); + + // Some more complicated stuff, just for the fun of it. + // Try doing this in tsDLList! + + epicsList*> llf; + for (i=0; i<10; i++) { + llf.push_front(new epicsList); + llf.front()->push_front(apf[i]); + } + test(llf.size() == 10); + + epicsList*>::iterator llfi; + for (llfi = llf.begin(); llfi != llf.end(); ++llfi) + test(llfi->size() == 1); + + for (llfi = llf.begin(); llfi != llf.end(); ++llfi) { + llfi->clear(); + delete *llfi; + } + llf.clear(); + + for (i=0; i<10; i++) + delete apf[i]; + + cout << tests << " tests completed, " << nak << " failed." << endl; + return 0; +};