2015-12-17 17:56:48 +00:00
/*
* Copyright ( c ) 2001 Wichert Akkerman < wichert @ deephackmode . org >
* Copyright ( c ) 2014 - 2015 Dmitry V . Levin < ldv @ altlinux . org >
2018-12-24 23:46:43 +00:00
* Copyright ( c ) 2014 - 2018 The strace developers .
2015-12-17 17:56:48 +00:00
* All rights reserved .
*
2018-12-10 00:00:00 +00:00
* SPDX - License - Identifier : LGPL - 2.1 - or - later
2015-12-17 17:56:48 +00:00
*/
2014-12-03 20:08:44 +00:00
# include "defs.h"
# ifdef MIPS
2018-12-30 15:35:21 +00:00
# ifdef HAVE_LINUX_UTSNAME_H
# include <linux / utsname.h>
# endif
# ifdef HAVE_ASM_SYSMIPS_H
# include <asm / sysmips.h>
# endif
# ifndef __NEW_UTS_LEN
# define __NEW_UTS_LEN 64
# endif
# include "xlat / sysmips_operations.h"
2014-12-03 20:08:44 +00:00
2015-04-07 01:36:50 +00:00
SYS_FUNC ( sysmips )
2014-12-03 20:08:44 +00:00
{
2016-12-25 21:59:59 +00:00
printxval64 ( sysmips_operations , tcp - > u_arg [ 0 ] , " ??? " ) ;
2015-07-16 21:46:05 +00:00
tprints ( " , " ) ;
switch ( tcp - > u_arg [ 0 ] ) {
case SETNAME : {
2015-07-16 21:35:41 +00:00
char nodename [ __NEW_UTS_LEN + 1 ] ;
2015-07-16 21:46:05 +00:00
if ( ! verbose ( tcp ) )
break ;
2015-07-16 21:35:41 +00:00
if ( umovestr ( tcp , tcp - > u_arg [ 1 ] , ( __NEW_UTS_LEN + 1 ) ,
nodename ) < 0 ) {
2015-07-16 21:46:05 +00:00
printaddr ( tcp - > u_arg [ 1 ] ) ;
2014-12-03 20:08:44 +00:00
} else {
2017-07-24 12:10:54 +00:00
print_quoted_cstring ( nodename , __NEW_UTS_LEN + 1 ) ;
2014-12-03 20:08:44 +00:00
}
2015-07-16 21:46:05 +00:00
return RVAL_DECODED ;
}
case MIPS_ATOMIC_SET :
2016-06-11 01:28:21 +00:00
printaddr ( tcp - > u_arg [ 1 ] ) ;
2016-12-26 10:16:35 +00:00
tprintf ( " , %# " PRI_klx , tcp - > u_arg [ 2 ] ) ;
2015-07-16 21:46:05 +00:00
return RVAL_DECODED ;
case MIPS_FIXADE :
2016-12-26 10:16:35 +00:00
tprintf ( " %# " PRI_klx , tcp - > u_arg [ 1 ] ) ;
2015-07-16 21:46:05 +00:00
return RVAL_DECODED ;
2014-12-03 20:08:44 +00:00
}
2016-12-26 10:16:35 +00:00
tprintf ( " % " PRI_kld " , % " PRI_kld " , % " PRI_kld ,
2016-12-26 00:37:18 +00:00
tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ) ;
2015-07-16 21:35:41 +00:00
return RVAL_DECODED ;
2014-12-03 20:08:44 +00:00
}
# endif /* MIPS */