]> granicus.if.org Git - strace/blobdiff - mtd.c
Remove HAVE_STRUCT_TCB_EXT_ARG, ext_arg, and u_lrval
[strace] / mtd.c
diff --git a/mtd.c b/mtd.c
index d9ce29229624cbcdddba8fa6b1aa13b4f6c21ca3..954a08b7d590b356c3663574c7fac7b24bd4c2d5 100644 (file)
--- a/mtd.c
+++ b/mtd.c
@@ -26,6 +26,8 @@
 
 #include "defs.h"
 
+#include DEF_MPERS_TYPE(struct_mtd_oob_buf)
+
 #include <linux/ioctl.h>
 
 /* The mtd api changes quickly, so we have to keep a local copy */
 # include <mtd/mtd-abi.h>
 #endif
 
+typedef struct mtd_oob_buf struct_mtd_oob_buf;
+
+#include MPERS_DEFS
+
 #include "xlat/mtd_mode_options.h"
 #include "xlat/mtd_file_mode_options.h"
 #include "xlat/mtd_type_options.h"
@@ -44,7 +50,7 @@
 #include "xlat/mtd_nandecc_options.h"
 
 static void
-decode_erase_info_user(struct tcb *tcp, const long addr)
+decode_erase_info_user(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct erase_info_user einfo;
 
@@ -56,7 +62,7 @@ decode_erase_info_user(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_erase_info_user64(struct tcb *tcp, const long addr)
+decode_erase_info_user64(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct erase_info_user64 einfo64;
 
@@ -69,20 +75,21 @@ decode_erase_info_user64(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_mtd_oob_buf(struct tcb *tcp, const long addr)
+decode_mtd_oob_buf(struct tcb *const tcp, const kernel_ulong_t addr)
 {
-       struct mtd_oob_buf mbuf;
+       struct_mtd_oob_buf mbuf;
 
        tprints(", ");
        if (umove_or_printaddr(tcp, addr, &mbuf))
                return;
 
-       tprintf("{start=%#x, length=%#x, ptr=%#lx}",
-               mbuf.start, mbuf.length, (unsigned long) mbuf.ptr);
+       tprintf("{start=%#x, length=%#x, ptr=", mbuf.start, mbuf.length);
+       printaddr(ptr_to_kulong(mbuf.ptr));
+       tprints("}");
 }
 
 static void
-decode_mtd_oob_buf64(struct tcb *tcp, const long addr)
+decode_mtd_oob_buf64(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct mtd_oob_buf64 mbuf64;
 
@@ -96,7 +103,7 @@ decode_mtd_oob_buf64(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_otp_info(struct tcb *tcp, const long addr)
+decode_otp_info(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct otp_info oinfo;
 
@@ -109,7 +116,7 @@ decode_otp_info(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_otp_select(struct tcb *tcp, const long addr)
+decode_otp_select(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        unsigned int i;
 
@@ -123,7 +130,7 @@ decode_otp_select(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_mtd_write_req(struct tcb *tcp, const long addr)
+decode_mtd_write_req(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct mtd_write_req mreq;
 
@@ -142,7 +149,7 @@ decode_mtd_write_req(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_mtd_info_user(struct tcb *tcp, const long addr)
+decode_mtd_info_user(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct mtd_info_user minfo;
 
@@ -161,7 +168,7 @@ decode_mtd_info_user(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_nand_oobinfo(struct tcb *tcp, const long addr)
+decode_nand_oobinfo(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct nand_oobinfo ninfo;
        unsigned int i, j;
@@ -197,7 +204,7 @@ decode_nand_oobinfo(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_nand_ecclayout_user(struct tcb *tcp, const long addr)
+decode_nand_ecclayout_user(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct nand_ecclayout_user nlay;
        unsigned int i;
@@ -223,7 +230,7 @@ decode_nand_ecclayout_user(struct tcb *tcp, const long addr)
 }
 
 static void
-decode_mtd_ecc_stats(struct tcb *tcp, const long addr)
+decode_mtd_ecc_stats(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct mtd_ecc_stats es;
 
@@ -235,8 +242,8 @@ decode_mtd_ecc_stats(struct tcb *tcp, const long addr)
                es.corrected, es.failed, es.badblocks, es.bbtblocks);
 }
 
-int
-mtd_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
+MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *const tcp,
+                  const unsigned int code, const kernel_ulong_t arg)
 {
        switch (code) {
        case MEMERASE:
@@ -278,7 +285,7 @@ mtd_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
 
        case MTDFILEMODE:
                tprints(", ");
-               printxval_long(mtd_file_mode_options, arg, "MTD_FILE_MODE_???");
+               printxval64(mtd_file_mode_options, arg, "MTD_FILE_MODE_???");
                break;
 
        case MEMGETBADBLOCK: