(root)/
strace-6.5/
src/
sysmips.c
       1  /*
       2   * Copyright (c) 2001 Wichert Akkerman <wichert@deephackmode.org>
       3   * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
       4   * Copyright (c) 2014-2021 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  # include <linux/utsname.h>
      15  # ifdef HAVE_ASM_SYSMIPS_H
      16  #  include <asm/sysmips.h>
      17  # endif
      18  
      19  # include "xlat/sysmips_operations.h"
      20  
      21  SYS_FUNC(sysmips)
      22  {
      23  	printxval64(sysmips_operations, tcp->u_arg[0], "???");
      24  	tprint_arg_next();
      25  
      26  	switch (tcp->u_arg[0]) {
      27  	case SETNAME: {
      28  		char nodename[__NEW_UTS_LEN + 1];
      29  
      30  		if (!verbose(tcp))
      31  			break;
      32  		if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1),
      33  			     nodename) < 0) {
      34  			printaddr(tcp->u_arg[1]);
      35  		} else {
      36  			print_quoted_cstring(nodename, __NEW_UTS_LEN + 1);
      37  		}
      38  		return RVAL_DECODED;
      39  	}
      40  	case MIPS_ATOMIC_SET:
      41  		printaddr(tcp->u_arg[1]);
      42  		tprint_arg_next();
      43  
      44  		PRINT_VAL_X(tcp->u_arg[2]);
      45  		return RVAL_DECODED;
      46  	case MIPS_FIXADE:
      47  		PRINT_VAL_X(tcp->u_arg[1]);
      48  		return RVAL_DECODED;
      49  	}
      50  
      51  	PRINT_VAL_X(tcp->u_arg[1]);
      52  	tprint_arg_next();
      53  
      54  	PRINT_VAL_X(tcp->u_arg[2]);
      55  	tprint_arg_next();
      56  
      57  	PRINT_VAL_X(tcp->u_arg[3]);
      58  	return RVAL_DECODED;
      59  }
      60  
      61  #endif /* MIPS */