]> granicus.if.org Git - strace/commitdiff
Introduce s390_pci_mmio_read, s390_pci_mmio_write system call decoders
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 14 Jan 2018 09:40:21 +0000 (10:40 +0100)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 29 Jan 2018 13:10:10 +0000 (14:10 +0100)
* linux/s390/syscallent.h ([352]): Change decoder to s390_pci_mmio_write.
([353]): Change decoder to s390_pci_mmio_read.
* linux/s390x/syscallent.h: Likewise.
* s390.c (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)):
New function.

linux/s390/syscallent.h
linux/s390x/syscallent.h
s390.c

index a807c958bb81a28491181b127464305c7461f642..d34cd42f6f1450267f8268d4d45ab7918adadf3c 100644 (file)
 [349] = { 3,   0,              SEN(getrandom),                 "getrandom"             },
 [350] = { 2,   TD,             SEN(memfd_create),              "memfd_create"          },
 [351] = { 3,   TD,             SEN(bpf),                       "bpf"                   },
-[352] = { 3,   0,              SEN(printargs),                 "s390_pci_mmio_write"   },
-[353] = { 3,   0,              SEN(printargs),                 "s390_pci_mmio_read"    },
+[352] = { 3,   0,              SEN(s390_pci_mmio_write),       "s390_pci_mmio_write"   },
+[353] = { 3,   0,              SEN(s390_pci_mmio_read),        "s390_pci_mmio_read"    },
 [354] = { 5,   TD|TF|TP|SE|SI, SEN(execveat),                  "execveat"              },
 [355] = { 1,   TD,             SEN(userfaultfd),               "userfaultfd"           },
 [356] = { 2,   0,              SEN(membarrier),                "membarrier"            },
index c4a770d077165d82a39e49ed2583a7c4799c9c0b..0c842747b4253d395ac6f7e7d26445fc5cf1256b 100644 (file)
 [349] = { 3,   0,              SEN(getrandom),                 "getrandom"             },
 [350] = { 2,   TD,             SEN(memfd_create),              "memfd_create"          },
 [351] = { 3,   TD,             SEN(bpf),                       "bpf"                   },
-[352] = { 3,   0,              SEN(printargs),                 "s390_pci_mmio_write"   },
-[353] = { 3,   0,              SEN(printargs),                 "s390_pci_mmio_read"    },
+[352] = { 3,   0,              SEN(s390_pci_mmio_write),       "s390_pci_mmio_write"   },
+[353] = { 3,   0,              SEN(s390_pci_mmio_read),        "s390_pci_mmio_read"    },
 [354] = { 5,   TD|TF|TP|SE|SI, SEN(execveat),                  "execveat"              },
 [355] = { 1,   TD,             SEN(userfaultfd),               "userfaultfd"           },
 [356] = { 2,   0,              SEN(membarrier),                "membarrier"            },
diff --git a/s390.c b/s390.c
index c562382d85bf52e3df70ce28ed2c3e70c7e69960..a9349936ac7794e1211ef20345453b8c5b14364f 100644 (file)
--- a/s390.c
+++ b/s390.c
@@ -1241,4 +1241,37 @@ SYS_FUNC(s390_runtime_instr)
        return RVAL_DECODED;
 }
 
+SYS_FUNC(s390_pci_mmio_write)
+{
+       kernel_ulong_t mmio_addr = tcp->u_arg[0];
+       kernel_ulong_t user_buf  = tcp->u_arg[1];
+       kernel_ulong_t length    = tcp->u_arg[2];
+
+       tprintf("%#" PRI_klx ", ", mmio_addr);
+       printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX);
+       tprintf(", %" PRI_klu, length);
+
+       return RVAL_DECODED;
+}
+
+SYS_FUNC(s390_pci_mmio_read)
+{
+       kernel_ulong_t mmio_addr = tcp->u_arg[0];
+       kernel_ulong_t user_buf  = tcp->u_arg[1];
+       kernel_ulong_t length    = tcp->u_arg[2];
+
+       if (entering(tcp)) {
+               tprintf("%#" PRI_klx ", ", mmio_addr);
+       } else {
+               if (!syserror(tcp))
+                       printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX);
+               else
+                       printaddr(user_buf);
+
+               tprintf(", %" PRI_klu, length);
+       }
+
+       return 0;
+}
+
 #endif /* defined S390 || defined S390X */