]> granicus.if.org Git - strace/blob - sysmips.c
xlat: provide fallback definitions for XDP_FLAGS_* constants
[strace] / sysmips.c
1 /*
2  * Copyright (c) 2001 Wichert Akkerman <wichert@deephackmode.org>
3  * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
4  * Copyright (c) 2014-2018 The strace developers.
5  * All rights reserved.
6  *
7  * SPDX-License-Identifier: LGPL-2.1-or-later
8  */
9
10 #include "defs.h"
11
12 #ifdef MIPS
13
14 # ifdef HAVE_LINUX_UTSNAME_H
15 #  include <linux/utsname.h>
16 # endif
17 # ifdef HAVE_ASM_SYSMIPS_H
18 #  include <asm/sysmips.h>
19 # endif
20
21 # ifndef __NEW_UTS_LEN
22 #  define __NEW_UTS_LEN 64
23 # endif
24
25 # include "xlat/sysmips_operations.h"
26
27 SYS_FUNC(sysmips)
28 {
29         printxval64(sysmips_operations, tcp->u_arg[0], "???");
30         tprints(", ");
31
32         switch (tcp->u_arg[0]) {
33         case SETNAME: {
34                 char nodename[__NEW_UTS_LEN + 1];
35
36                 if (!verbose(tcp))
37                         break;
38                 if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1),
39                              nodename) < 0) {
40                         printaddr(tcp->u_arg[1]);
41                 } else {
42                         print_quoted_cstring(nodename, __NEW_UTS_LEN + 1);
43                 }
44                 return RVAL_DECODED;
45         }
46         case MIPS_ATOMIC_SET:
47                 printaddr(tcp->u_arg[1]);
48                 tprintf(", %#" PRI_klx, tcp->u_arg[2]);
49                 return RVAL_DECODED;
50         case MIPS_FIXADE:
51                 tprintf("%#" PRI_klx, tcp->u_arg[1]);
52                 return RVAL_DECODED;
53         }
54
55         tprintf("%" PRI_kld ", %" PRI_kld ", %" PRI_kld,
56                 tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
57         return RVAL_DECODED;
58 }
59
60 #endif /* MIPS */