Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | #ifdef MIPS |
| 4 | |
| 5 | #ifdef HAVE_LINUX_UTSNAME_H |
| 6 | # include <linux/utsname.h> |
| 7 | #endif |
| 8 | #ifdef HAVE_ASM_SYSMIPS_H |
| 9 | # include <asm/sysmips.h> |
| 10 | #endif |
| 11 | |
| 12 | #ifndef __NEW_UTS_LEN |
| 13 | # define __NEW_UTS_LEN 64 |
| 14 | #endif |
| 15 | |
| 16 | #include "xlat/sysmips_operations.h" |
| 17 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 18 | SYS_FUNC(sysmips) |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 19 | { |
Dmitry V. Levin | 034f98e | 2015-07-16 21:35:41 +0000 | [diff] [blame^] | 20 | printxval(sysmips_operations, tcp->u_arg[0], "???"); |
| 21 | if (!verbose(tcp)) { |
| 22 | tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); |
| 23 | } else if (tcp->u_arg[0] == SETNAME) { |
| 24 | char nodename[__NEW_UTS_LEN + 1]; |
| 25 | tprints(", "); |
| 26 | if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), |
| 27 | nodename) < 0) { |
| 28 | tprintf("%#lx", tcp->u_arg[1]); |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 29 | } else { |
Dmitry V. Levin | 034f98e | 2015-07-16 21:35:41 +0000 | [diff] [blame^] | 30 | print_quoted_string(nodename, __NEW_UTS_LEN + 1, |
| 31 | QUOTE_0_TERMINATED); |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 32 | } |
Dmitry V. Levin | 034f98e | 2015-07-16 21:35:41 +0000 | [diff] [blame^] | 33 | } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) { |
| 34 | tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); |
| 35 | } else if (tcp->u_arg[0] == MIPS_FIXADE) { |
| 36 | tprintf(", 0x%lx", tcp->u_arg[1]); |
| 37 | } else { |
| 38 | tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 39 | } |
| 40 | |
Dmitry V. Levin | 034f98e | 2015-07-16 21:35:41 +0000 | [diff] [blame^] | 41 | return RVAL_DECODED; |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | #endif /* MIPS */ |