Dmitry V. Levin | f6eb0d6 | 2014-12-03 20:00:42 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | #ifdef OR1K |
| 4 | |
| 5 | #define OR1K_ATOMIC_SWAP 1 |
| 6 | #define OR1K_ATOMIC_CMPXCHG 2 |
| 7 | #define OR1K_ATOMIC_XCHG 3 |
| 8 | #define OR1K_ATOMIC_ADD 4 |
| 9 | #define OR1K_ATOMIC_DECPOS 5 |
| 10 | #define OR1K_ATOMIC_AND 6 |
| 11 | #define OR1K_ATOMIC_OR 7 |
| 12 | #define OR1K_ATOMIC_UMAX 8 |
| 13 | #define OR1K_ATOMIC_UMIN 9 |
| 14 | |
| 15 | #include "xlat/atomic_ops.h" |
| 16 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 17 | SYS_FUNC(or1k_atomic) |
Dmitry V. Levin | f6eb0d6 | 2014-12-03 20:00:42 +0000 | [diff] [blame] | 18 | { |
Dmitry V. Levin | eebb561 | 2015-07-20 21:18:14 +0000 | [diff] [blame] | 19 | printxval(atomic_ops, tcp->u_arg[0], "???"); |
| 20 | switch(tcp->u_arg[0]) { |
| 21 | case OR1K_ATOMIC_SWAP: |
| 22 | tprintf(", 0x%lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); |
| 23 | break; |
| 24 | case OR1K_ATOMIC_CMPXCHG: |
| 25 | tprintf(", 0x%lx, %#lx, %#lx", tcp->u_arg[1], tcp->u_arg[2], |
| 26 | tcp->u_arg[3]); |
| 27 | break; |
Dmitry V. Levin | f6eb0d6 | 2014-12-03 20:00:42 +0000 | [diff] [blame] | 28 | |
Dmitry V. Levin | eebb561 | 2015-07-20 21:18:14 +0000 | [diff] [blame] | 29 | case OR1K_ATOMIC_XCHG: |
| 30 | case OR1K_ATOMIC_ADD: |
| 31 | case OR1K_ATOMIC_AND: |
| 32 | case OR1K_ATOMIC_OR: |
| 33 | case OR1K_ATOMIC_UMAX: |
| 34 | case OR1K_ATOMIC_UMIN: |
| 35 | tprintf(", 0x%lx, %#lx", tcp->u_arg[1], tcp->u_arg[2]); |
| 36 | break; |
Dmitry V. Levin | f6eb0d6 | 2014-12-03 20:00:42 +0000 | [diff] [blame] | 37 | |
Dmitry V. Levin | eebb561 | 2015-07-20 21:18:14 +0000 | [diff] [blame] | 38 | case OR1K_ATOMIC_DECPOS: |
| 39 | tprintf(", 0x%lx", tcp->u_arg[1]); |
| 40 | break; |
Dmitry V. Levin | f6eb0d6 | 2014-12-03 20:00:42 +0000 | [diff] [blame] | 41 | |
Dmitry V. Levin | eebb561 | 2015-07-20 21:18:14 +0000 | [diff] [blame] | 42 | default: |
| 43 | break; |
Dmitry V. Levin | f6eb0d6 | 2014-12-03 20:00:42 +0000 | [diff] [blame] | 44 | } |
| 45 | |
Dmitry V. Levin | eebb561 | 2015-07-20 21:18:14 +0000 | [diff] [blame] | 46 | return RVAL_DECODED | RVAL_HEX; |
Dmitry V. Levin | f6eb0d6 | 2014-12-03 20:00:42 +0000 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | #endif /* OR1K */ |