Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sysmips.c 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #include "defs.h"
  10. #ifdef MIPS
  11. # ifdef HAVE_LINUX_UTSNAME_H
  12. # include <linux/utsname.h>
  13. # endif
  14. # ifdef HAVE_ASM_SYSMIPS_H
  15. # include <asm/sysmips.h>
  16. # endif
  17. # ifndef __NEW_UTS_LEN
  18. # define __NEW_UTS_LEN 64
  19. # endif
  20. # include "xlat/sysmips_operations.h"
  21. SYS_FUNC(sysmips)
  22. {
  23. printxval64(sysmips_operations, tcp->u_arg[0], "???");
  24. tprints(", ");
  25. switch (tcp->u_arg[0]) {
  26. case SETNAME: {
  27. char nodename[__NEW_UTS_LEN + 1];
  28. if (!verbose(tcp))
  29. break;
  30. if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1),
  31. nodename) < 0) {
  32. printaddr(tcp->u_arg[1]);
  33. } else {
  34. print_quoted_cstring(nodename, __NEW_UTS_LEN + 1);
  35. }
  36. return RVAL_DECODED;
  37. }
  38. case MIPS_ATOMIC_SET:
  39. printaddr(tcp->u_arg[1]);
  40. tprintf(", %#" PRI_klx, tcp->u_arg[2]);
  41. return RVAL_DECODED;
  42. case MIPS_FIXADE:
  43. tprintf("%#" PRI_klx, tcp->u_arg[1]);
  44. return RVAL_DECODED;
  45. }
  46. tprintf("%" PRI_kld ", %" PRI_kld ", %" PRI_kld,
  47. tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
  48. return RVAL_DECODED;
  49. }
  50. #endif /* MIPS */