o fixed compile errors in epicsAtomicOSD.h (I didnt have the proper version of solaris to test)
o fixed darwin compile errors (I dont have access to darwin)
This commit is contained in:
13
LICENSE
13
LICENSE
@@ -1,5 +1,14 @@
|
||||
Copyright (c) 1991-2007 UChicago Argonne LLC and The Regents of the
|
||||
University of California. All rights reserved.
|
||||
Copyright (c) 2007-2011 UChicago Argonne LLC. All rights reserved.
|
||||
|
||||
Copyright (c) 2006-2011. Los Alamos National Security, LLC. Some of this
|
||||
material was produced under U.S. Government contract DE-AC52-06NA25396
|
||||
for Los Alamos National Laboratory (LANL), which is operated by Los Alamos
|
||||
National Security, LLC for the U.S. Department of Energy.
|
||||
|
||||
Copyright (c) 1991-2007 the University of Chicago. All rights reserved.
|
||||
|
||||
Copyright (c) 1991-2006 The Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
EPICS BASE is distributed subject to the following license conditions:
|
||||
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
*/
|
||||
#if _WRS_VXWORKS_MAJOR * 100 + _WRS_VXWORKS_MINOR >= 606
|
||||
|
||||
#define __STDC_LIMIT_MACROS /* define SIZE_MAX for c++ */
|
||||
#include <stdint.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <vxAtomicLib.h>
|
||||
|
||||
@@ -37,16 +34,16 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* we make the probably correct guess that if SIZE_MAX
|
||||
* we make the probably correct guess that if ULONG_MAX
|
||||
* is the same as UINT_MAX then sizeof ( atomic_t )
|
||||
* will be the same as sizeof ( size_t )
|
||||
*
|
||||
* if SIZE_MAX != UINT_MAX then its 64 bit vxWorks and
|
||||
* if ULONG_MAX != UINT_MAX then its 64 bit vxWorks and
|
||||
* WRS doesnt not supply at this time the atomic interface
|
||||
* for 8 byte integers that is needed - so that architecture
|
||||
* receives the lock synchronized version
|
||||
*/
|
||||
#if SIZE_MAX == UINT_MAX
|
||||
#if ULONG_MAX == UINT_MAX
|
||||
|
||||
STATIC_ASSERT ( sizeof ( atomic_t ) == sizeof ( size_t ) );
|
||||
|
||||
@@ -126,7 +123,7 @@ OSD_ATOMIC_INLINE unsigned epicsAtomicTestAndSetUIntT ( unsigned * pTarget )
|
||||
{
|
||||
STATIC_ASSERT ( sizeof ( atomic_t ) == sizeof ( unsigned ) );
|
||||
atomic_t * const pTarg = ( atomic_t * ) ( pTarget );
|
||||
return vxCas ( pTarget, 0, 1 ) != 0;
|
||||
return vxCas ( pTarg, 0, 1 ) != 0;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -424,8 +424,8 @@ void epicsAtomicIncrPerformance ()
|
||||
void atomicCompareAndSetPerformance ()
|
||||
{
|
||||
epicsTime begin = epicsTime::getCurrent ();
|
||||
size_t target;
|
||||
epicsAtomicSetSizeT ( & target, 0 );
|
||||
unsigned target;
|
||||
epicsAtomicSetUIntT ( & target, 0 );
|
||||
testOk1 ( ! target );
|
||||
for ( unsigned i = 0; i < N; i++ ) {
|
||||
oneThousandAtomicTestAndSet ( target );
|
||||
@@ -469,7 +469,7 @@ void ownershipPassRefPerformance ()
|
||||
void epicsAtomicSetPerformance ()
|
||||
{
|
||||
epicsTime begin = epicsTime::getCurrent ();
|
||||
unsigned target;
|
||||
size_t target;
|
||||
for ( unsigned i = 0; i < N; i++ ) {
|
||||
oneThousandAtomicSet ( target );
|
||||
}
|
||||
@@ -480,7 +480,7 @@ void epicsAtomicSetPerformance ()
|
||||
testDiag ( "epicsAtomicSet() takes %f microseconds", delay );
|
||||
}
|
||||
|
||||
MAIN(osiAtomicTest)
|
||||
MAIN(epicsAtomicPerform)
|
||||
{
|
||||
testPlan(5);
|
||||
//
|
||||
@@ -494,6 +494,6 @@ MAIN(osiAtomicTest)
|
||||
epicsAtomicIncrPerformance ();
|
||||
recursiveOwnershipRetPerformance ();
|
||||
ownershipPassRefPerformance ();
|
||||
atomicCompareAndSetPerformance ();
|
||||
atomicTestAndSetPerformance ();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ static void tns ( void *arg )
|
||||
epicsAtomicIncrSizeT ( & pTestData->m_testIterationsSet );
|
||||
}
|
||||
|
||||
MAIN(osiAtomicTest)
|
||||
MAIN(epicsAtomicTest)
|
||||
{
|
||||
const unsigned int stackSize =
|
||||
epicsThreadGetStackSize ( epicsThreadStackSmall );
|
||||
|
||||
Reference in New Issue
Block a user