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], "???"); |
Dmitry V. Levin | 040de57 | 2015-07-16 21:46:05 +0000 | [diff] [blame] | 21 | tprints(", "); |
| 22 | |
| 23 | switch (tcp->u_arg[0]) { |
| 24 | case SETNAME: { |
Dmitry V. Levin | 034f98e | 2015-07-16 21:35:41 +0000 | [diff] [blame] | 25 | char nodename[__NEW_UTS_LEN + 1]; |
Dmitry V. Levin | 040de57 | 2015-07-16 21:46:05 +0000 | [diff] [blame] | 26 | |
| 27 | if (!verbose(tcp)) |
| 28 | break; |
Dmitry V. Levin | 034f98e | 2015-07-16 21:35:41 +0000 | [diff] [blame] | 29 | if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), |
| 30 | nodename) < 0) { |
Dmitry V. Levin | 040de57 | 2015-07-16 21:46:05 +0000 | [diff] [blame] | 31 | printaddr(tcp->u_arg[1]); |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 32 | } else { |
Dmitry V. Levin | 034f98e | 2015-07-16 21:35:41 +0000 | [diff] [blame] | 33 | print_quoted_string(nodename, __NEW_UTS_LEN + 1, |
| 34 | QUOTE_0_TERMINATED); |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 35 | } |
Dmitry V. Levin | 040de57 | 2015-07-16 21:46:05 +0000 | [diff] [blame] | 36 | return RVAL_DECODED; |
| 37 | } |
| 38 | case MIPS_ATOMIC_SET: |
| 39 | tprintf("%#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); |
| 40 | return RVAL_DECODED; |
| 41 | case MIPS_FIXADE: |
| 42 | tprintf("0x%lx", tcp->u_arg[1]); |
| 43 | return RVAL_DECODED; |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 44 | } |
| 45 | |
Dmitry V. Levin | 040de57 | 2015-07-16 21:46:05 +0000 | [diff] [blame] | 46 | tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); |
Dmitry V. Levin | 034f98e | 2015-07-16 21:35:41 +0000 | [diff] [blame] | 47 | return RVAL_DECODED; |
Dmitry V. Levin | 600e33c | 2014-12-03 20:08:44 +0000 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | #endif /* MIPS */ |