diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-12 10:16:35 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-12 10:16:35 +0100 |
commit | 46fd192d0b688b0f6f55db08e18a3c6ffff42a32 (patch) | |
tree | 27d6fd2ea4d3ab1d1f16a8f5b6f5cff4dcf7da66 | |
parent | 27e5c15e2d246e279a60779109c6f03c412afb67 (diff) |
tx-support
-rw-r--r-- | testsuites/validation/tx-support.c | 11 | ||||
-rw-r--r-- | testsuites/validation/tx-support.h | 7 |
2 files changed, 18 insertions, 0 deletions
diff --git a/testsuites/validation/tx-support.c b/testsuites/validation/tx-support.c index 3f41203a74..5e08f13526 100644 --- a/testsuites/validation/tx-support.c +++ b/testsuites/validation/tx-support.c @@ -892,6 +892,17 @@ void StopDelayThreadDispatch( uint32_t cpu_index ) } #if defined(RTEMS_SMP) +void TicketLockWaitForOwned( const SMP_ticket_lock_Control *lock ) +{ + unsigned int now_serving; + unsigned int next_ticket; + + do { + now_serving = _Atomic_Load_uint( &lock->now_serving, ATOMIC_ORDER_RELAXED ); + next_ticket = _Atomic_Load_uint( &lock->next_ticket, ATOMIC_ORDER_RELAXED ); + } while ( now_serving == next_ticket ); +} + void TicketLockWaitForOthers( const SMP_ticket_lock_Control *lock, unsigned int others diff --git a/testsuites/validation/tx-support.h b/testsuites/validation/tx-support.h index fcabd1108b..efbb8097b2 100644 --- a/testsuites/validation/tx-support.h +++ b/testsuites/validation/tx-support.h @@ -548,11 +548,18 @@ void StartDelayThreadDispatch( uint32_t cpu_index ); void StopDelayThreadDispatch( uint32_t cpu_index ); #if defined(RTEMS_SMP) +void TicketLockWaitForOwned( const SMP_ticket_lock_Control *lock ); + void TicketLockWaitForOthers( const SMP_ticket_lock_Control *lock, unsigned int others ); +static inline void ISRLockWaitForOwned( const ISR_lock_Control *lock ) +{ + TicketLockWaitForOwned( &lock->Lock.Ticket_lock ); +} + static inline void ISRLockWaitForOthers( const ISR_lock_Control *lock, unsigned int others |