make vxAtomic64Or available for pthreads_vxworks.c (#11)
Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/11 Co-authored-by: siddhant <siddhant.singh@neominds.in> Co-committed-by: siddhant <siddhant.singh@neominds.in>
This commit is contained in:
@@ -184,6 +184,40 @@ INCLUDE FILES: vxAtomicLib.h
|
|||||||
#include <private/kernelLibP.h>
|
#include <private/kernelLibP.h>
|
||||||
#include <tool/common/private/toolMacrosP.h>
|
#include <tool/common/private/toolMacrosP.h>
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* vxAtomic64Or - atomically perform a bitwise OR on a 64-bit memory location
|
||||||
|
*
|
||||||
|
* This routine atomically performs a bitwise OR operation of <*target> and
|
||||||
|
* <value>, placing the result in <*target>. Various CPU architectures may
|
||||||
|
* impose restrictions with regards to the alignment and cache attributes of
|
||||||
|
* the atomic64_t type.
|
||||||
|
*
|
||||||
|
* This routine can be used from both task and interrupt level.
|
||||||
|
*
|
||||||
|
* RETURNS: Contents of <*target> before the atomic operation
|
||||||
|
*
|
||||||
|
* ERRNO: N/A
|
||||||
|
*
|
||||||
|
* SEE ALSO: vxAtomicLib, vxAtomic64And(), vxAtomic64Or_inline()
|
||||||
|
*/
|
||||||
|
|
||||||
|
atomic64Val_t vxAtomic64Or
|
||||||
|
(
|
||||||
|
atomic64_t * target, /* memory location to OR */
|
||||||
|
atomic64Val_t value /* OR with this value */
|
||||||
|
)
|
||||||
|
{
|
||||||
|
atomic64Val_t oldValue;
|
||||||
|
int lockKey;
|
||||||
|
|
||||||
|
lockKey = KERNEL_INT_CPU_LOCK ();
|
||||||
|
oldValue = *(volatile atomic64_t *)target;
|
||||||
|
*(volatile atomic64_t *)target = oldValue | value;
|
||||||
|
KERNEL_INT_CPU_UNLOCK (lockKey);
|
||||||
|
return (oldValue);
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _WRS_CONFIG_SMP
|
#ifndef _WRS_CONFIG_SMP
|
||||||
#ifdef _WRS_PORTABLE_vxAtomicLib
|
#ifdef _WRS_PORTABLE_vxAtomicLib
|
||||||
|
|
||||||
@@ -731,40 +765,6 @@ atomic64Val_t vxAtomic64Dec
|
|||||||
return (vxAtomic64Sub (target, 1LL));
|
return (vxAtomic64Sub (target, 1LL));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
*
|
|
||||||
* vxAtomic64Or - atomically perform a bitwise OR on a 64-bit memory location
|
|
||||||
*
|
|
||||||
* This routine atomically performs a bitwise OR operation of <*target> and
|
|
||||||
* <value>, placing the result in <*target>. Various CPU architectures may
|
|
||||||
* impose restrictions with regards to the alignment and cache attributes of
|
|
||||||
* the atomic64_t type.
|
|
||||||
*
|
|
||||||
* This routine can be used from both task and interrupt level.
|
|
||||||
*
|
|
||||||
* RETURNS: Contents of <*target> before the atomic operation
|
|
||||||
*
|
|
||||||
* ERRNO: N/A
|
|
||||||
*
|
|
||||||
* SEE ALSO: vxAtomicLib, vxAtomic64And(), vxAtomic64Or_inline()
|
|
||||||
*/
|
|
||||||
|
|
||||||
atomic64Val_t vxAtomic64Or
|
|
||||||
(
|
|
||||||
atomic64_t * target, /* memory location to OR */
|
|
||||||
atomic64Val_t value /* OR with this value */
|
|
||||||
)
|
|
||||||
{
|
|
||||||
atomic64Val_t oldValue;
|
|
||||||
int lockKey;
|
|
||||||
|
|
||||||
lockKey = KERNEL_INT_CPU_LOCK ();
|
|
||||||
oldValue = *(volatile atomic64_t *)target;
|
|
||||||
*(volatile atomic64_t *)target = oldValue | value;
|
|
||||||
KERNEL_INT_CPU_UNLOCK (lockKey);
|
|
||||||
return (oldValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* vxAtomic64Xor - atomically perform a bitwise XOR on a 64-bit memory location
|
* vxAtomic64Xor - atomically perform a bitwise XOR on a 64-bit memory location
|
||||||
|
|||||||
Reference in New Issue
Block a user