blob: 36ee9b9db25bb6f17946fade343282baf1cfe237 [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], "???");
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. Levin600e33c2014-12-03 20:08:44 +000029 } else {
Dmitry V. Levin034f98e2015-07-16 21:35:41 +000030 print_quoted_string(nodename, __NEW_UTS_LEN + 1,
31 QUOTE_0_TERMINATED);
Dmitry V. Levin600e33c2014-12-03 20:08:44 +000032 }
Dmitry V. Levin034f98e2015-07-16 21:35:41 +000033 } 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. Levin600e33c2014-12-03 20:08:44 +000039 }
40
Dmitry V. Levin034f98e2015-07-16 21:35:41 +000041 return RVAL_DECODED;
Dmitry V. Levin600e33c2014-12-03 20:08:44 +000042}
43
44#endif /* MIPS */