2015-12-17 20:56:48 +03:00
/*
* Copyright ( c ) 2013 Christian Svensson < blue @ cmd . nu >
* Copyright ( c ) 2014 - 2015 Dmitry V . Levin < ldv @ altlinux . org >
2017-05-22 20:14:52 +03:00
* Copyright ( c ) 2014 - 2017 The strace developers .
2015-12-17 20:56:48 +03:00
* All rights reserved .
*
2018-12-10 03:00:00 +03:00
* SPDX - License - Identifier : LGPL - 2.1 - or - later
2015-12-17 20:56:48 +03:00
*/
2014-12-03 23:00:42 +03:00
# include "defs.h"
# ifdef OR1K
2017-06-18 01:23:09 +03:00
# define OR1K_ATOMIC_SWAP 1
# define OR1K_ATOMIC_CMPXCHG 2
# define OR1K_ATOMIC_XCHG 3
# define OR1K_ATOMIC_ADD 4
# define OR1K_ATOMIC_DECPOS 5
# define OR1K_ATOMIC_AND 6
# define OR1K_ATOMIC_OR 7
# define OR1K_ATOMIC_UMAX 8
# define OR1K_ATOMIC_UMIN 9
2014-12-03 23:00:42 +03:00
# include "xlat/atomic_ops.h"
2015-04-07 04:36:50 +03:00
SYS_FUNC ( or1k_atomic )
2014-12-03 23:00:42 +03:00
{
2016-12-26 00:59:59 +03:00
printxval64 ( atomic_ops , tcp - > u_arg [ 0 ] , " ??? " ) ;
2017-06-18 01:23:09 +03:00
switch ( tcp - > u_arg [ 0 ] ) {
2015-07-21 00:18:14 +03:00
case OR1K_ATOMIC_SWAP :
tprintf ( " , 0x%lx, 0x%lx " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
break ;
case OR1K_ATOMIC_CMPXCHG :
tprintf ( " , 0x%lx, %#lx, %#lx " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ,
tcp - > u_arg [ 3 ] ) ;
break ;
case OR1K_ATOMIC_XCHG :
case OR1K_ATOMIC_ADD :
case OR1K_ATOMIC_AND :
case OR1K_ATOMIC_OR :
case OR1K_ATOMIC_UMAX :
case OR1K_ATOMIC_UMIN :
tprintf ( " , 0x%lx, %#lx " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
break ;
case OR1K_ATOMIC_DECPOS :
tprintf ( " , 0x%lx " , tcp - > u_arg [ 1 ] ) ;
break ;
default :
break ;
2014-12-03 23:00:42 +03:00
}
2015-07-21 00:18:14 +03:00
return RVAL_DECODED | RVAL_HEX ;
2014-12-03 23:00:42 +03:00
}
# endif /* OR1K */