blob: a47facf98c431e36de884d020bba77843f99d542 [file] [log] [blame]
Dmitry V. Levin600e33c2014-12-03 20:08:44 +00001#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. Levina0bd3742015-04-07 01:36:50 +000018SYS_FUNC(sysmips)
Dmitry V. Levin600e33c2014-12-03 20:08:44 +000019{
Dmitry V. Levin034f98e2015-07-16 21:35:41 +000020 printxval(sysmips_operations, tcp->u_arg[0], "???");
Dmitry V. Levin040de572015-07-16 21:46:05 +000021 tprints(", ");
22
23 switch (tcp->u_arg[0]) {
24 case SETNAME: {
Dmitry V. Levin034f98e2015-07-16 21:35:41 +000025 char nodename[__NEW_UTS_LEN + 1];
Dmitry V. Levin040de572015-07-16 21:46:05 +000026
27 if (!verbose(tcp))
28 break;
Dmitry V. Levin034f98e2015-07-16 21:35:41 +000029 if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1),
30 nodename) < 0) {
Dmitry V. Levin040de572015-07-16 21:46:05 +000031 printaddr(tcp->u_arg[1]);
Dmitry V. Levin600e33c2014-12-03 20:08:44 +000032 } else {
Dmitry V. Levin034f98e2015-07-16 21:35:41 +000033 print_quoted_string(nodename, __NEW_UTS_LEN + 1,
34 QUOTE_0_TERMINATED);
Dmitry V. Levin600e33c2014-12-03 20:08:44 +000035 }
Dmitry V. Levin040de572015-07-16 21:46:05 +000036 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. Levin600e33c2014-12-03 20:08:44 +000044 }
45
Dmitry V. Levin040de572015-07-16 21:46:05 +000046 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Dmitry V. Levin034f98e2015-07-16 21:35:41 +000047 return RVAL_DECODED;
Dmitry V. Levin600e33c2014-12-03 20:08:44 +000048}
49
50#endif /* MIPS */