]> granicus.if.org Git - strace/blobdiff - mtd.c
mem: decode hugetlb page size in mmap flags
[strace] / mtd.c
diff --git a/mtd.c b/mtd.c
index 8c049b2ecfe030b6992a2dbb8b55180021d60d56..8e5fe46ca9c9b277e2f509c494d178a45d1810ba 100644 (file)
--- a/mtd.c
+++ b/mtd.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012 Mike Frysinger <vapier@gentoo.org>
+ * Copyright (c) 2012-2017 The strace developers.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -50,7 +51,7 @@ typedef struct mtd_oob_buf struct_mtd_oob_buf;
 #include "xlat/mtd_nandecc_options.h"
 
 static void
-decode_erase_info_user(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_erase_info_user(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct erase_info_user einfo;
 
@@ -62,7 +63,7 @@ decode_erase_info_user(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_erase_info_user64(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_erase_info_user64(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct erase_info_user64 einfo64;
 
@@ -75,7 +76,7 @@ decode_erase_info_user64(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_mtd_oob_buf(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_mtd_oob_buf(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct_mtd_oob_buf mbuf;
 
@@ -89,7 +90,7 @@ decode_mtd_oob_buf(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_mtd_oob_buf64(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_mtd_oob_buf64(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct mtd_oob_buf64 mbuf64;
 
@@ -103,7 +104,7 @@ decode_mtd_oob_buf64(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_otp_info(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_otp_info(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct otp_info oinfo;
 
@@ -116,7 +117,7 @@ decode_otp_info(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_otp_select(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_otp_select(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        unsigned int i;
 
@@ -130,7 +131,7 @@ decode_otp_select(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_mtd_write_req(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_mtd_write_req(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct mtd_write_req mreq;
 
@@ -149,7 +150,7 @@ decode_mtd_write_req(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_mtd_info_user(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_mtd_info_user(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct mtd_info_user minfo;
 
@@ -168,7 +169,7 @@ decode_mtd_info_user(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_nand_oobinfo(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_nand_oobinfo(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct nand_oobinfo ninfo;
        unsigned int i, j;
@@ -204,7 +205,7 @@ decode_nand_oobinfo(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_nand_ecclayout_user(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_nand_ecclayout_user(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct nand_ecclayout_user nlay;
        unsigned int i;
@@ -230,7 +231,7 @@ decode_nand_ecclayout_user(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 static void
-decode_mtd_ecc_stats(struct tcb *const tcp, const kernel_ureg_t addr)
+decode_mtd_ecc_stats(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct mtd_ecc_stats es;
 
@@ -243,7 +244,7 @@ decode_mtd_ecc_stats(struct tcb *const tcp, const kernel_ureg_t addr)
 }
 
 MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *const tcp,
-                  const unsigned int code, const kernel_ureg_t arg)
+                  const unsigned int code, const kernel_ulong_t arg)
 {
        switch (code) {
        case MEMERASE:
@@ -359,5 +360,5 @@ MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *const tcp,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | 1;
+       return RVAL_IOCTL_DECODED;
 }