From 3b04bd29e4777bf9a58c7ba0f1a8ebf1619539b3 Mon Sep 17 00:00:00 2001 From: siddhant Date: Thu, 19 Mar 2026 13:23:32 +0000 Subject: [PATCH] make vxAtomic64Or available for pthreads_vxworks.c (#11) Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/11 Co-authored-by: siddhant Co-committed-by: siddhant --- vxworks-6.9/target/src/os/vxAtomicLib.c | 68 ++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/vxworks-6.9/target/src/os/vxAtomicLib.c b/vxworks-6.9/target/src/os/vxAtomicLib.c index c8f79e80..8c7ebd27 100644 --- a/vxworks-6.9/target/src/os/vxAtomicLib.c +++ b/vxworks-6.9/target/src/os/vxAtomicLib.c @@ -184,6 +184,40 @@ INCLUDE FILES: vxAtomicLib.h #include #include +/******************************************************************************* +* +* vxAtomic64Or - atomically perform a bitwise OR on a 64-bit memory location +* +* This routine atomically performs a bitwise OR operation of <*target> and +* , 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 #ifdef _WRS_PORTABLE_vxAtomicLib @@ -731,40 +765,6 @@ atomic64Val_t vxAtomic64Dec 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 -* , 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