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:
committed by
Andrew Johnson
parent
76b8265dfd
commit
092e161485
@@ -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);
|
||||
//
|
||||
|
||||
@@ -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