2 * Check decoding of s390_runtime_instr syscall.
4 * Copyright (c) 2018 The strace developers.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include <asm/unistd.h>
33 #if defined __NR_s390_runtime_instr
47 { 0, "0 /* S390_RUNTIME_INSTR_??? */" },
48 { 4, "4 /* S390_RUNTIME_INSTR_??? */" },
49 { (kernel_ulong_t) 0xdeafbeefdeadc0deULL,
50 "-559038242 /* S390_RUNTIME_INSTR_??? */" },
51 { 2, "S390_RUNTIME_INSTR_STOP" },
57 } start_sig_args[] = {
59 { (kernel_ulong_t) 0xfacefeedac0ffeedULL, NULL },
68 for (i = 0; i < ARRAY_SIZE(cmd_args); i++) {
69 rc = syscall(__NR_s390_runtime_instr, cmd_args[i].cmd, 0xdead);
70 printf("s390_runtime_instr(%s) = %s\n",
71 cmd_args[i].cmd_str, sprintrc(rc));
74 for (i = 0; i < ARRAY_SIZE(start_sig_args); i++) {
77 rc = syscall(__NR_s390_runtime_instr, 1, start_sig_args[i].sig);
79 printf("s390_runtime_instr(S390_RUNTIME_INSTR_START, ");
81 if (start_sig_args[i].sig_str)
82 printf("%s", start_sig_args[i].sig_str);
84 printf("%d", (int) start_sig_args[i].sig);
87 printf(") = %s\n", sprintrc(rc));
90 puts("+++ exited with 0 +++");
96 SKIP_MAIN_UNDEFINED("__NR_s390_runtime_instr")