From bb9d6835a6d02131c04fd57776b52945c76bb7e6 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 30 May 2016 00:25:03 +0000 Subject: [PATCH] Mpersify hdio.c * defs.h (hdio_ioctl): Remove. * hdio.c: Mpersify struct hd_geometry. (hdio_ioctl): Mpersify. --- defs.h | 1 - hdio.c | 23 +++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/defs.h b/defs.h index e221d4c3..f7a85cad 100644 --- a/defs.h +++ b/defs.h @@ -662,7 +662,6 @@ extern void print_struct_statfs64(struct tcb *tcp, long, unsigned long); extern int file_ioctl(struct tcb *, const unsigned int, long); extern int fs_x_ioctl(struct tcb *, const unsigned int, long); -extern int hdio_ioctl(struct tcb *, const unsigned int, long); extern int loop_ioctl(struct tcb *, const unsigned int, long); extern int ptp_ioctl(struct tcb *, const unsigned int, long); extern int scsi_ioctl(struct tcb *, const unsigned int, long); diff --git a/hdio.c b/hdio.c index 1553825a..e9dbdf1a 100644 --- a/hdio.c +++ b/hdio.c @@ -27,26 +27,33 @@ */ #include "defs.h" + +#include DEF_MPERS_TYPE(struct_hd_geometry) + #include -int -hdio_ioctl(struct tcb *tcp, const unsigned int code, const long arg) +typedef struct hd_geometry struct_hd_geometry; + +#include MPERS_DEFS + +MPERS_PRINTER_DECL(int, hdio_ioctl, struct tcb *tcp, + const unsigned int code, const long arg) { switch (code) { case HDIO_GETGEO: if (entering(tcp)) return 0; else { - struct hd_geometry geo; + struct_hd_geometry geo; tprints(", "); if (!umove_or_printaddr(tcp, arg, &geo)) tprintf("{heads=%u, sectors=%u, " - "cylinders=%u, start=%lu}", - (unsigned)geo.heads, - (unsigned)geo.sectors, - (unsigned)geo.cylinders, - geo.start); + "cylinders=%hu, start=%lu}", + (unsigned) geo.heads, + (unsigned) geo.sectors, + geo.cylinders, + (unsigned long) geo.start); } break; default: -- 2.40.0