From: Dmitry V. Levin Date: Mon, 26 Dec 2016 10:26:03 +0000 (+0000) Subject: Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t X-Git-Tag: v4.16~158 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fa3d78319b20a996923f9b665afc3a3571ed08b;p=strace Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t Remove temporary types created for transition from long to kernel_ulong_t. Automatically replace kernel_scno_t and kernel_ureg_t with kernel_ulong_t using $ git grep -El 'kernel_(scno|ureg)_t' | xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g' * kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove. All users updated. --- diff --git a/affinity.c b/affinity.c index 17b443b7..0eb10940 100644 --- a/affinity.c +++ b/affinity.c @@ -61,7 +61,7 @@ get_cpuset_size(void) } static void -print_affinitylist(struct tcb *const tcp, const kernel_ureg_t addr, +print_affinitylist(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned int len) { const unsigned int max_size = get_cpuset_size(); diff --git a/aio.c b/aio.c index 68194dec..dc9ce467 100644 --- a/aio.c +++ b/aio.c @@ -161,13 +161,13 @@ print_iocb(struct tcb *tcp, const struct iocb *cb) static bool print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - kernel_ureg_t addr; + kernel_ulong_t addr; struct iocb cb; - if (elem_size < sizeof(kernel_ureg_t)) { + if (elem_size < sizeof(kernel_ulong_t)) { addr = * (unsigned int *) elem_buf; } else { - addr = * (kernel_ureg_t *) elem_buf; + addr = * (kernel_ulong_t *) elem_buf; } tprints("{"); @@ -181,8 +181,8 @@ print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) SYS_FUNC(io_submit) { const long nr = widen_to_long(tcp->u_arg[1]); - const kernel_ureg_t addr = tcp->u_arg[2]; - kernel_ureg_t iocbp; + const kernel_ulong_t addr = tcp->u_arg[2]; + kernel_ulong_t iocbp; printaddr(tcp->u_arg[0]); tprintf(", %ld, ", nr); diff --git a/block.c b/block.c index 1864b592..db23e0d2 100644 --- a/block.c +++ b/block.c @@ -144,7 +144,7 @@ print_blkpg_req(struct tcb *tcp, const struct_blkpg_ioctl_arg *blkpg) } MPERS_PRINTER_DECL(int, block_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) { /* take arg as a value, not as a pointer */ diff --git a/bpf.c b/bpf.c index df076e57..04c677a1 100644 --- a/bpf.c +++ b/bpf.c @@ -37,7 +37,7 @@ #include "xlat/bpf_map_update_elem_flags.h" static int -bpf_map_create(struct tcb *const tcp, const kernel_ureg_t addr, +bpf_map_create(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size) { struct { @@ -62,7 +62,7 @@ bpf_map_create(struct tcb *const tcp, const kernel_ureg_t addr, } static void -bpf_map_update_elem(struct tcb *const tcp, const kernel_ureg_t addr, +bpf_map_update_elem(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size) { struct { @@ -90,7 +90,7 @@ bpf_map_update_elem(struct tcb *const tcp, const kernel_ureg_t addr, } static void -bpf_map_delete_elem(struct tcb *const tcp, const kernel_ureg_t addr, +bpf_map_delete_elem(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size) { struct { @@ -113,7 +113,7 @@ bpf_map_delete_elem(struct tcb *const tcp, const kernel_ureg_t addr, } static int -bpf_map_io(struct tcb *const tcp, const kernel_ureg_t addr, unsigned int size, +bpf_map_io(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size, const char *const text) { struct bpf_io_elem_struct { @@ -146,7 +146,7 @@ bpf_map_io(struct tcb *const tcp, const kernel_ureg_t addr, unsigned int size, } static int -bpf_prog_load(struct tcb *const tcp, const kernel_ureg_t addr, +bpf_prog_load(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size) { struct { @@ -180,7 +180,7 @@ bpf_prog_load(struct tcb *const tcp, const kernel_ureg_t addr, SYS_FUNC(bpf) { const unsigned int cmd = tcp->u_arg[0]; - const kernel_ureg_t addr = tcp->u_arg[1]; + const kernel_ulong_t addr = tcp->u_arg[1]; const unsigned int size = tcp->u_arg[2]; int rc = RVAL_DECODED; diff --git a/btrfs.c b/btrfs.c index 87bb3d82..e007040f 100644 --- a/btrfs.c +++ b/btrfs.c @@ -204,7 +204,7 @@ btrfs_print_balance_args(const char *name, const struct btrfs_balance_args *bba) } static void -btrfs_print_balance(struct tcb *const tcp, const kernel_ureg_t arg, bool out) +btrfs_print_balance(struct tcb *const tcp, const kernel_ulong_t arg, bool out) { struct btrfs_ioctl_balance_args balance_args; @@ -376,7 +376,7 @@ print_uint64(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) } static void -btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ureg_t qgi_addr) +btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr) { struct btrfs_qgroup_inherit inherit; @@ -513,7 +513,7 @@ print_btrfs_ioctl_space_info(struct tcb *tcp, void *elem_buf, MPERS_PRINTER_DECL(int, btrfs_ioctl, struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { switch (code) { /* Take no arguments; command only. */ diff --git a/capability.c b/capability.c index 76d382fe..b7a510bd 100644 --- a/capability.c +++ b/capability.c @@ -64,7 +64,7 @@ typedef struct user_cap_data_struct { } *cap_user_data_t; static cap_user_header_t -get_cap_header(struct tcb *const tcp, const kernel_ureg_t addr) +get_cap_header(struct tcb *const tcp, const kernel_ulong_t addr) { static struct user_cap_header_struct header; @@ -78,7 +78,7 @@ get_cap_header(struct tcb *const tcp, const kernel_ureg_t addr) } static void -print_cap_header(struct tcb *const tcp, const kernel_ureg_t addr, +print_cap_header(struct tcb *const tcp, const kernel_ulong_t addr, const cap_user_header_t const h) { if (!addr || !h) { @@ -106,7 +106,7 @@ print_cap_bits(const uint32_t lo, const uint32_t hi) } static void -print_cap_data(struct tcb *const tcp, const kernel_ureg_t addr, +print_cap_data(struct tcb *const tcp, const kernel_ulong_t addr, const cap_user_header_t const h) { struct user_cap_data_struct data[2]; diff --git a/clone.c b/clone.c index 82289111..10cf91d8 100644 --- a/clone.c +++ b/clone.c @@ -76,7 +76,7 @@ #endif static void -print_tls_arg(struct tcb *const tcp, const kernel_ureg_t addr) +print_tls_arg(struct tcb *const tcp, const kernel_ulong_t addr) { #ifdef HAVE_STRUCT_USER_DESC # if SUPPORTED_PERSONALITIES > 1 @@ -98,7 +98,7 @@ SYS_FUNC(clone) { if (exiting(tcp)) { const char *sep = "|"; - kernel_ureg_t flags = tcp->u_arg[ARG_FLAGS]; + kernel_ulong_t flags = tcp->u_arg[ARG_FLAGS]; tprints("child_stack="); printaddr(tcp->u_arg[ARG_STACK]); tprints(", "); diff --git a/defs.h b/defs.h index c79fb864..7c062eb6 100644 --- a/defs.h +++ b/defs.h @@ -232,8 +232,8 @@ struct tcb { int pid; /* If 0, this tcb is free */ int qual_flg; /* qual_flags[scno] or DEFAULT_QUAL_FLAGS + RAW */ unsigned long u_error; /* Error code */ - kernel_scno_t scno; /* System call number */ - kernel_ureg_t u_arg[MAX_ARGS]; /* System call arguments */ + kernel_ulong_t scno; /* System call number */ + kernel_ulong_t u_arg[MAX_ARGS]; /* System call arguments */ #if HAVE_STRUCT_TCB_EXT_ARG unsigned long long ext_arg[MAX_ARGS]; long long u_lrval; /* long long return value */ @@ -471,7 +471,7 @@ extern int get_scno(struct tcb *tcp); * @return String literal corresponding to the syscall number in case latter * is valid; NULL otherwise. */ -extern const char *syscall_name(kernel_scno_t scno); +extern const char *syscall_name(kernel_ulong_t scno); extern const char *err_name(unsigned long err); extern bool is_erestart(struct tcb *); @@ -494,34 +494,34 @@ static inline int set_tcb_priv_ulong(struct tcb *tcp, unsigned long val) } extern int -umoven(struct tcb *tcp, kernel_ureg_t addr, unsigned int len, void *laddr); +umoven(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, void *laddr); #define umove(pid, addr, objp) \ umoven((pid), (addr), sizeof(*(objp)), (void *) (objp)) extern int -umoven_or_printaddr(struct tcb *tcp, kernel_ureg_t addr, +umoven_or_printaddr(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, void *laddr); #define umove_or_printaddr(pid, addr, objp) \ umoven_or_printaddr((pid), (addr), sizeof(*(objp)), (void *) (objp)) extern int -umoven_or_printaddr_ignore_syserror(struct tcb *tcp, kernel_ureg_t addr, +umoven_or_printaddr_ignore_syserror(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, void *laddr); extern int -umovestr(struct tcb *tcp, kernel_ureg_t addr, unsigned int len, char *laddr); +umovestr(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, char *laddr); -extern int upeek(int pid, unsigned long, kernel_ureg_t *); -extern int upoke(int pid, unsigned long, kernel_ureg_t); +extern int upeek(int pid, unsigned long, kernel_ulong_t *); +extern int upoke(int pid, unsigned long, kernel_ulong_t); extern bool print_array(struct tcb *tcp, - kernel_ureg_t start_addr, + kernel_ulong_t start_addr, size_t nmemb, void *elem_buf, size_t elem_size, int (*umoven_func)(struct tcb *, - kernel_ureg_t, + kernel_ulong_t, unsigned int, void *), bool (*print_func)(struct tcb *, @@ -601,24 +601,24 @@ extern void print_numeric_umode_t(unsigned short); extern void print_numeric_long_umask(unsigned long); extern void -dumpiov_in_msghdr(struct tcb *, kernel_ureg_t addr, kernel_ureg_t data_size); +dumpiov_in_msghdr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t data_size); extern void -dumpiov_in_mmsghdr(struct tcb *, kernel_ureg_t addr); +dumpiov_in_mmsghdr(struct tcb *, kernel_ulong_t addr); extern void -dumpiov_upto(struct tcb *, int len, kernel_ureg_t addr, kernel_ureg_t data_size); +dumpiov_upto(struct tcb *, int len, kernel_ulong_t addr, kernel_ulong_t data_size); extern void -dumpstr(struct tcb *, kernel_ureg_t addr, int len); +dumpstr(struct tcb *, kernel_ulong_t addr, int len); extern void -printstr_ex(struct tcb *, kernel_ureg_t addr, kernel_ureg_t len, +printstr_ex(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len, unsigned int user_style); #define DECL_PRINTNUM(name) \ extern bool \ -printnum_ ## name(struct tcb *, kernel_ureg_t addr, const char *fmt) \ +printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \ ATTRIBUTE_FORMAT((printf, 3, 0)) DECL_PRINTNUM(short); DECL_PRINTNUM(int); @@ -627,7 +627,7 @@ DECL_PRINTNUM(int64); #if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 extern bool -printnum_long_int(struct tcb *, kernel_ureg_t addr, +printnum_long_int(struct tcb *, kernel_ulong_t addr, const char *fmt_long, const char *fmt_int) ATTRIBUTE_FORMAT((printf, 3, 0)) ATTRIBUTE_FORMAT((printf, 4, 0)); @@ -655,17 +655,17 @@ printnum_long_int(struct tcb *, kernel_ureg_t addr, #define DECL_PRINTPAIR(name) \ extern bool \ -printpair_ ## name(struct tcb *, kernel_ureg_t addr, const char *fmt) \ +printpair_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \ ATTRIBUTE_FORMAT((printf, 3, 0)) DECL_PRINTPAIR(int); DECL_PRINTPAIR(int64); #undef DECL_PRINTPAIR extern void -printpathn(struct tcb *, kernel_ureg_t addr, unsigned int n); +printpathn(struct tcb *, kernel_ulong_t addr, unsigned int n); extern void -printpath(struct tcb *, kernel_ureg_t addr); +printpath(struct tcb *, kernel_ulong_t addr); #define TIMESPEC_TEXT_BUFSIZE \ (sizeof(intmax_t)*3 * 2 + sizeof("{tv_sec=%jd, tv_nsec=%jd}")) @@ -676,12 +676,12 @@ extern bool print_sockaddr_by_inode_cached(const unsigned long); extern void print_dirfd(struct tcb *, int); extern int -decode_sockaddr(struct tcb *, kernel_ureg_t addr, int addrlen); +decode_sockaddr(struct tcb *, kernel_ulong_t addr, int addrlen); extern void printuid(const char *, const unsigned int); extern void -print_sigset_addr_len(struct tcb *, kernel_ureg_t addr, kernel_ureg_t len); +print_sigset_addr_len(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len); extern const char *sprintsigmask_n(const char *, const void *, unsigned int); #define tprintsigmask_addr(prefix, mask) \ @@ -689,20 +689,20 @@ extern const char *sprintsigmask_n(const char *, const void *, unsigned int); extern void printsignal(int); extern void -tprint_iov_upto(struct tcb *, kernel_ureg_t len, kernel_ureg_t addr, - enum iov_decode, kernel_ureg_t data_size); +tprint_iov_upto(struct tcb *, kernel_ulong_t len, kernel_ulong_t addr, + enum iov_decode, kernel_ulong_t data_size); extern void -decode_netlink(struct tcb *, kernel_ureg_t addr, kernel_ureg_t len); +decode_netlink(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len); extern void tprint_open_modes(unsigned int); extern const char *sprint_open_modes(unsigned int); extern void -print_seccomp_filter(struct tcb *, kernel_ureg_t addr); +print_seccomp_filter(struct tcb *, kernel_ulong_t addr); extern void -print_seccomp_fprog(struct tcb *, kernel_ureg_t addr, unsigned short len); +print_seccomp_fprog(struct tcb *, kernel_ulong_t addr, unsigned short len); struct strace_stat; extern void print_struct_stat(struct tcb *tcp, const struct strace_stat *const st); @@ -710,10 +710,10 @@ extern void print_struct_stat(struct tcb *tcp, const struct strace_stat *const s struct strace_statfs; extern void -print_struct_statfs(struct tcb *, kernel_ureg_t addr); +print_struct_statfs(struct tcb *, kernel_ulong_t addr); extern void -print_struct_statfs64(struct tcb *, kernel_ureg_t addr, kernel_ureg_t size); +print_struct_statfs64(struct tcb *, kernel_ulong_t addr, kernel_ulong_t size); extern void print_ifindex(unsigned int); @@ -728,7 +728,7 @@ extern unsigned int qual_flags(const unsigned int); #define DECL_IOCTL(name) \ extern int \ -name ## _ioctl(struct tcb *, unsigned int request, kernel_ureg_t arg) +name ## _ioctl(struct tcb *, unsigned int request, kernel_ulong_t arg) DECL_IOCTL(dm); DECL_IOCTL(file); DECL_IOCTL(fs_x); @@ -759,19 +759,19 @@ extern void unwind_capture_stacktrace(struct tcb* tcp); #endif static inline void -printaddr(kernel_ureg_t addr) +printaddr(kernel_ulong_t addr) { printaddr_klu(addr); } static inline void -printstrn(struct tcb *tcp, kernel_ureg_t addr, kernel_ureg_t len) +printstrn(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len) { printstr_ex(tcp, addr, len, 0); } static inline void -printstr(struct tcb *tcp, kernel_ureg_t addr) +printstr(struct tcb *tcp, kernel_ulong_t addr) { printstr_ex(tcp, addr, -1, QUOTE_0_TERMINATED); } @@ -795,7 +795,7 @@ printxval(const struct xlat *x, const unsigned int val, const char *dflt) } static inline void -tprint_iov(struct tcb *tcp, kernel_ureg_t len, kernel_ureg_t addr, +tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr, enum iov_decode decode_iov) { tprint_iov_upto(tcp, len, addr, decode_iov, -1); @@ -807,15 +807,15 @@ typedef struct { } timeval32_t; extern void print_timeval32_t(const timeval32_t *); -extern void printrusage32(struct tcb *, kernel_ureg_t); -extern const char *sprint_timeval32(struct tcb *tcp, kernel_ureg_t); -extern void print_timeval32(struct tcb *tcp, kernel_ureg_t); -extern void print_timeval32_pair(struct tcb *tcp, kernel_ureg_t); -extern void print_itimerval32(struct tcb *tcp, kernel_ureg_t); +extern void printrusage32(struct tcb *, kernel_ulong_t); +extern const char *sprint_timeval32(struct tcb *tcp, kernel_ulong_t); +extern void print_timeval32(struct tcb *tcp, kernel_ulong_t); +extern void print_timeval32_pair(struct tcb *tcp, kernel_ulong_t); +extern void print_itimerval32(struct tcb *tcp, kernel_ulong_t); #endif #ifdef HAVE_STRUCT_USER_DESC -extern void print_user_desc(struct tcb *, kernel_ureg_t addr); +extern void print_user_desc(struct tcb *, kernel_ulong_t addr); #endif /* Strace log generation machinery. @@ -885,9 +885,9 @@ extern unsigned current_klongsize; #endif /* - * Cast a pointer or a pointer-sized integer to kernel_ureg_t. + * Cast a pointer or a pointer-sized integer to kernel_ulong_t. */ -#define ptr_to_kulong(v) ((kernel_ureg_t) (unsigned long) (v)) +#define ptr_to_kulong(v) ((kernel_ulong_t) (unsigned long) (v)) /* * Zero-extend a signed integer type to unsigned long long. @@ -949,7 +949,7 @@ extern struct fault_opts *fault_vec[SUPPORTED_PERSONALITIES]; /* Checks that sysent[scno] is not out of range. */ static inline bool -scno_in_range(kernel_scno_t scno) +scno_in_range(kernel_ulong_t scno) { return scno < nsyscalls; } @@ -960,7 +960,7 @@ scno_in_range(kernel_scno_t scno) * and its sysent[scno].sys_flags has no TRACE_INDIRECT_SUBCALL flag set. */ static inline bool -scno_is_valid(kernel_scno_t scno) +scno_is_valid(kernel_ulong_t scno) { return scno_in_range(scno) && sysent[scno].sys_func diff --git a/desc.c b/desc.c index 1870224e..24d657fa 100644 --- a/desc.c +++ b/desc.c @@ -69,15 +69,15 @@ SYS_FUNC(dup3) } static int -decode_select(struct tcb *const tcp, const kernel_ureg_t *const args, - void (*const print_tv_ts) (struct tcb *, kernel_ureg_t), - const char * (*const sprint_tv_ts) (struct tcb *, kernel_ureg_t)) +decode_select(struct tcb *const tcp, const kernel_ulong_t *const args, + void (*const print_tv_ts) (struct tcb *, kernel_ulong_t), + const char * (*const sprint_tv_ts) (struct tcb *, kernel_ulong_t)) { int i, j; int nfds, fdsize; fd_set *fds = NULL; const char *sep; - kernel_ureg_t addr; + kernel_ulong_t addr; /* Kernel truncates args[0] to int, we do the same. */ nfds = (int) args[0]; @@ -192,7 +192,7 @@ decode_select(struct tcb *const tcp, const kernel_ureg_t *const args, SYS_FUNC(oldselect) { - kernel_ureg_t select_args[5]; + kernel_ulong_t select_args[5]; unsigned int oldselect_args[5]; if (sizeof(*select_args) == sizeof(*oldselect_args)) { @@ -227,7 +227,7 @@ SYS_FUNC(select) } static int -umove_kulong_array_or_printaddr(struct tcb *const tcp, const kernel_ureg_t addr, +umove_kulong_array_or_printaddr(struct tcb *const tcp, const kernel_ulong_t addr, kernel_ulong_t *const ptr, const size_t n) { #ifndef current_klongsize diff --git a/dirent.c b/dirent.c index 1a58debb..e09128cb 100644 --- a/dirent.c +++ b/dirent.c @@ -38,7 +38,7 @@ #define D_NAME_LEN_MAX 256 static void -print_old_dirent(struct tcb *const tcp, const kernel_ureg_t addr) +print_old_dirent(struct tcb *const tcp, const kernel_ulong_t addr) { kernel_dirent d; diff --git a/dm.c b/dm.c index c4d3c140..7a1dc3c2 100644 --- a/dm.c +++ b/dm.c @@ -102,7 +102,7 @@ dm_decode_flags(const struct dm_ioctl *ioc) } static void -dm_decode_dm_target_spec(struct tcb *const tcp, const kernel_ureg_t addr, +dm_decode_dm_target_spec(struct tcb *const tcp, const kernel_ulong_t addr, const struct dm_ioctl *const ioc) { static const uint32_t target_spec_size = @@ -177,7 +177,7 @@ dm_print_dev(struct tcb *tcp, void *dev_ptr, size_t dev_size, void *dummy) } static void -dm_decode_dm_target_deps(struct tcb *const tcp, const kernel_ureg_t addr, +dm_decode_dm_target_deps(struct tcb *const tcp, const kernel_ulong_t addr, const struct dm_ioctl *const ioc) { static const uint32_t target_deps_dev_offs = @@ -220,7 +220,7 @@ misplaced: } static void -dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ureg_t addr, +dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ulong_t addr, const struct dm_ioctl *const ioc) { static const uint32_t name_list_name_offs = @@ -276,7 +276,7 @@ misplaced: } static void -dm_decode_dm_target_versions(struct tcb *const tcp, const kernel_ureg_t addr, +dm_decode_dm_target_versions(struct tcb *const tcp, const kernel_ulong_t addr, const struct dm_ioctl *const ioc) { static const uint32_t target_vers_name_offs = @@ -328,7 +328,7 @@ misplaced: } static void -dm_decode_dm_target_msg(struct tcb *const tcp, const kernel_ureg_t addr, +dm_decode_dm_target_msg(struct tcb *const tcp, const kernel_ulong_t addr, const struct dm_ioctl *const ioc) { static const uint32_t target_msg_message_offs = @@ -359,7 +359,7 @@ dm_decode_dm_target_msg(struct tcb *const tcp, const kernel_ureg_t addr, } static void -dm_decode_string(struct tcb *const tcp, const kernel_ureg_t addr, +dm_decode_string(struct tcb *const tcp, const kernel_ulong_t addr, const struct dm_ioctl *const ioc) { uint32_t offset = ioc->data_start; @@ -397,7 +397,7 @@ dm_ioctl_has_params(const unsigned int code) static int dm_known_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { struct dm_ioctl *ioc = NULL; struct dm_ioctl *entering_ioc = NULL; @@ -517,7 +517,7 @@ dm_known_ioctl(struct tcb *const tcp, const unsigned int code, } int -dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ureg_t arg) +dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) { switch (code) { case DM_VERSION: @@ -545,7 +545,7 @@ dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ureg_t arg # else /* !(DM_VERSION_MAJOR == 4) */ int -dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ureg_t arg) +dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) { return 0; } diff --git a/evdev.c b/evdev.c index 9127bf69..8945cfcb 100644 --- a/evdev.c +++ b/evdev.c @@ -76,7 +76,7 @@ decode_envelope(void *const data) } static int -ff_effect_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) +ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) { tprints(", "); @@ -154,7 +154,7 @@ ff_effect_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) } static int -abs_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) +abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) { tprints(", "); @@ -188,7 +188,7 @@ abs_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) } static int -keycode_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) +keycode_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) { tprints(", "); @@ -205,7 +205,7 @@ keycode_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) # ifdef EVIOCGKEYCODE_V2 static int -keycode_V2_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) +keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) { tprints(", "); @@ -242,7 +242,7 @@ keycode_V2_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) # endif /* EVIOCGKEYCODE_V2 */ static int -getid_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) +getid_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) { tprints(", "); @@ -262,14 +262,14 @@ getid_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) } static int -decode_bitset(struct tcb *const tcp, const kernel_ureg_t arg, +decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg, const struct xlat decode_nr[], const unsigned int max_nr, const char *const dflt) { tprints(", "); unsigned int size; - if ((kernel_ureg_t) tcp->u_rval > max_nr) + if ((kernel_ulong_t) tcp->u_rval > max_nr) size = max_nr; else size = tcp->u_rval; @@ -306,7 +306,7 @@ decode_bitset(struct tcb *const tcp, const kernel_ureg_t arg, # ifdef EVIOCGMTSLOTS static int mtslots_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { tprints(", "); @@ -338,7 +338,7 @@ mtslots_ioctl(struct tcb *const tcp, const unsigned int code, # if defined EVIOCGREP || defined EVIOCSREP static int -repeat_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) +repeat_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) { tprints(", "); printpair_int(tcp, arg, "%u"); @@ -348,7 +348,7 @@ repeat_ioctl(struct tcb *const tcp, const kernel_ureg_t arg) static int bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { switch (ev_nr) { case EV_SYN: @@ -399,7 +399,7 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr, static int evdev_read_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { /* fixed-number fixed-length commands */ switch (code) { @@ -474,7 +474,7 @@ evdev_read_ioctl(struct tcb *const tcp, const unsigned int code, static int evdev_write_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { /* fixed-number fixed-length commands */ switch (code) { @@ -515,7 +515,7 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code, } MPERS_PRINTER_DECL(int, evdev_ioctl, struct tcb *const tcp, - const unsigned int code, const kernel_ureg_t arg) + const unsigned int code, const kernel_ulong_t arg) { switch(_IOC_DIR(code)) { case _IOC_READ: diff --git a/execve.c b/execve.c index e7c626ba..6e45b11b 100644 --- a/execve.c +++ b/execve.c @@ -34,7 +34,7 @@ #include "defs.h" static void -printargv(struct tcb *const tcp, kernel_ureg_t addr) +printargv(struct tcb *const tcp, kernel_ulong_t addr) { if (!addr || !verbose(tcp)) { printaddr(addr); @@ -76,7 +76,7 @@ printargv(struct tcb *const tcp, kernel_ureg_t addr) } static void -printargc(struct tcb *const tcp, kernel_ureg_t addr) +printargc(struct tcb *const tcp, kernel_ulong_t addr) { if (!addr || !verbose(tcp)) { printaddr(addr); diff --git a/fcntl.c b/fcntl.c index c7da7f00..2f84e115 100644 --- a/fcntl.c +++ b/fcntl.c @@ -54,7 +54,7 @@ print_struct_flock64(const struct_kernel_flock64 *fl, const int getlk) } static void -printflock64(struct tcb *const tcp, const kernel_ureg_t addr, const int getlk) +printflock64(struct tcb *const tcp, const kernel_ulong_t addr, const int getlk) { struct_kernel_flock64 fl; @@ -63,7 +63,7 @@ printflock64(struct tcb *const tcp, const kernel_ureg_t addr, const int getlk) } static void -printflock(struct tcb *const tcp, const kernel_ureg_t addr, const int getlk) +printflock(struct tcb *const tcp, const kernel_ulong_t addr, const int getlk) { struct_kernel_flock64 fl; @@ -72,7 +72,7 @@ printflock(struct tcb *const tcp, const kernel_ureg_t addr, const int getlk) } static void -print_f_owner_ex(struct tcb *const tcp, const kernel_ureg_t addr) +print_f_owner_ex(struct tcb *const tcp, const kernel_ulong_t addr) { struct { int type, pid; } owner; @@ -143,7 +143,7 @@ print_fcntl(struct tcb *tcp) if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0) return 0; tcp->auxstr = sprintflags("flags ", fdflags, - (kernel_ureg_t) tcp->u_rval); + (kernel_ulong_t) tcp->u_rval); return RVAL_HEX | RVAL_STR; case F_GETFL: if (entering(tcp) || syserror(tcp)) @@ -171,13 +171,13 @@ print_fcntl(struct tcb *tcp) case F_GETLEASE: if (entering(tcp) || syserror(tcp)) return 0; - tcp->auxstr = xlookup(lockfcmds, (kernel_ureg_t) tcp->u_rval); + tcp->auxstr = xlookup(lockfcmds, (kernel_ulong_t) tcp->u_rval); return RVAL_HEX | RVAL_STR; case F_GET_SEALS: if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0) return 0; tcp->auxstr = sprintflags("seals ", f_seals, - (kernel_ureg_t) tcp->u_rval); + (kernel_ulong_t) tcp->u_rval); return RVAL_HEX | RVAL_STR; case F_GETSIG: if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0) diff --git a/fetch_seccomp_fprog.c b/fetch_seccomp_fprog.c index 7293d2f3..e483e816 100644 --- a/fetch_seccomp_fprog.c +++ b/fetch_seccomp_fprog.c @@ -35,7 +35,7 @@ typedef struct seccomp_fprog seccomp_fprog_t; #include MPERS_DEFS MPERS_PRINTER_DECL(bool, fetch_seccomp_fprog, struct tcb *const tcp, - const kernel_ureg_t addr, void *const p) + const kernel_ulong_t addr, void *const p) { struct seccomp_fprog *pfp = p; seccomp_fprog_t mfp; diff --git a/fetch_struct_flock.c b/fetch_struct_flock.c index 773505fe..bb248761 100644 --- a/fetch_struct_flock.c +++ b/fetch_struct_flock.c @@ -52,7 +52,7 @@ typedef struct_kernel_flock64 struct_flock64; && FLOCK_MEMBERS_EQ(type, l_pid)) MPERS_PRINTER_DECL(bool, fetch_struct_flock, struct tcb *const tcp, - const kernel_ureg_t addr, void *const p) + const kernel_ulong_t addr, void *const p) { struct_kernel_flock64 *pfl = p; struct_flock mfl; @@ -72,7 +72,7 @@ MPERS_PRINTER_DECL(bool, fetch_struct_flock, struct tcb *const tcp, } MPERS_PRINTER_DECL(bool, fetch_struct_flock64, struct tcb *const tcp, - const kernel_ureg_t addr, void *const p) + const kernel_ulong_t addr, void *const p) { struct_kernel_flock64 *pfl = p; struct_flock64 mfl; diff --git a/fetch_struct_mmsghdr.c b/fetch_struct_mmsghdr.c index cfa02510..04f98aba 100644 --- a/fetch_struct_mmsghdr.c +++ b/fetch_struct_mmsghdr.c @@ -43,7 +43,7 @@ typedef struct mmsghdr struct_mmsghdr; */ MPERS_PRINTER_DECL(int, fetch_struct_mmsghdr, - struct tcb *const tcp, const kernel_ureg_t addr, + struct tcb *const tcp, const kernel_ulong_t addr, void *const p) { struct mmsghdr *p_native = p; diff --git a/fetch_struct_msghdr.c b/fetch_struct_msghdr.c index 90b84219..d5f5adc5 100644 --- a/fetch_struct_msghdr.c +++ b/fetch_struct_msghdr.c @@ -43,7 +43,7 @@ typedef struct msghdr struct_msghdr; */ MPERS_PRINTER_DECL(int, fetch_struct_msghdr, - struct tcb *const tcp, const kernel_ureg_t addr, + struct tcb *const tcp, const kernel_ulong_t addr, void *const p) { struct msghdr *const p_native = p; diff --git a/fetch_struct_stat.c b/fetch_struct_stat.c index 0a583b4a..50d10284 100644 --- a/fetch_struct_stat.c +++ b/fetch_struct_stat.c @@ -70,7 +70,7 @@ typedef struct stat struct_stat; #endif MPERS_PRINTER_DECL(bool, fetch_struct_stat, - struct tcb *const tcp, const kernel_ureg_t addr, + struct tcb *const tcp, const kernel_ulong_t addr, struct strace_stat *const dst) { #ifdef HAVE_STRUCT_STAT diff --git a/fetch_struct_stat64.c b/fetch_struct_stat64.c index d9051ace..b7e48057 100644 --- a/fetch_struct_stat64.c +++ b/fetch_struct_stat64.c @@ -68,7 +68,7 @@ typedef struct stat64 struct_stat64; #endif MPERS_PRINTER_DECL(bool, fetch_struct_stat64, - struct tcb *const tcp, const kernel_ureg_t addr, + struct tcb *const tcp, const kernel_ulong_t addr, struct strace_stat *const dst) { #ifdef HAVE_STRUCT_STAT64 diff --git a/fetch_struct_statfs.c b/fetch_struct_statfs.c index c22b2446..454e5b4e 100644 --- a/fetch_struct_statfs.c +++ b/fetch_struct_statfs.c @@ -40,7 +40,7 @@ typedef struct statfs64 struct_statfs64; #include "statfs.h" MPERS_PRINTER_DECL(bool, fetch_struct_statfs, - struct tcb *const tcp, const kernel_ureg_t addr, + struct tcb *const tcp, const kernel_ulong_t addr, struct strace_statfs *const p) { struct_statfs b; @@ -79,8 +79,8 @@ MPERS_PRINTER_DECL(bool, fetch_struct_statfs, #endif MPERS_PRINTER_DECL(bool, fetch_struct_statfs64, - struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t size, struct strace_statfs *const p) + struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t size, struct strace_statfs *const p) { struct_statfs64 b; diff --git a/file_handle.c b/file_handle.c index 27e6d446..f2f0b22d 100644 --- a/file_handle.c +++ b/file_handle.c @@ -41,7 +41,7 @@ typedef struct { SYS_FUNC(name_to_handle_at) { file_handle_header h; - const kernel_ureg_t addr = tcp->u_arg[2]; + const kernel_ulong_t addr = tcp->u_arg[2]; if (entering(tcp)) { /* dirfd */ @@ -106,7 +106,7 @@ SYS_FUNC(name_to_handle_at) SYS_FUNC(open_by_handle_at) { file_handle_header h; - const kernel_ureg_t addr = tcp->u_arg[1]; + const kernel_ulong_t addr = tcp->u_arg[1]; /* mount_fd */ printfd(tcp, tcp->u_arg[0]); diff --git a/file_ioctl.c b/file_ioctl.c index 6f30a23d..fec2f69b 100644 --- a/file_ioctl.c +++ b/file_ioctl.c @@ -124,7 +124,7 @@ print_fiemap_extent(struct tcb *tcp, void *elem_buf, size_t elem_size, void *dat int file_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { switch (code) { case FICLONE: /* W */ diff --git a/fs_x_ioctl.c b/fs_x_ioctl.c index 619eaa91..2fa30f56 100644 --- a/fs_x_ioctl.c +++ b/fs_x_ioctl.c @@ -31,7 +31,7 @@ int fs_x_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { switch (code) { #ifdef FITRIM diff --git a/futex.c b/futex.c index 2d1e1ada..5267dc48 100644 --- a/futex.c +++ b/futex.c @@ -43,11 +43,11 @@ SYS_FUNC(futex) { - const kernel_ureg_t uaddr = tcp->u_arg[0]; + const kernel_ulong_t uaddr = tcp->u_arg[0]; const int op = tcp->u_arg[1]; const int cmd = op & 127; - const kernel_ureg_t timeout = tcp->u_arg[3]; - const kernel_ureg_t uaddr2 = tcp->u_arg[4]; + const kernel_ulong_t timeout = tcp->u_arg[3]; + const kernel_ulong_t uaddr2 = tcp->u_arg[4]; const unsigned int val = tcp->u_arg[2]; const unsigned int val2 = tcp->u_arg[3]; const unsigned int val3 = tcp->u_arg[5]; diff --git a/hdio.c b/hdio.c index 97eca582..6e256d94 100644 --- a/hdio.c +++ b/hdio.c @@ -37,7 +37,7 @@ typedef struct hd_geometry struct_hd_geometry; #include MPERS_DEFS MPERS_PRINTER_DECL(int, hdio_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 HDIO_GETGEO: diff --git a/io.c b/io.c index 5e44721e..a785711d 100644 --- a/io.c +++ b/io.c @@ -59,14 +59,14 @@ SYS_FUNC(write) struct print_iovec_config { enum iov_decode decode_iov; - kernel_ureg_t data_size; + kernel_ulong_t data_size; }; static bool print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - const kernel_ureg_t *iov; - kernel_ureg_t iov_buf[2], len; + const kernel_ulong_t *iov; + kernel_ulong_t iov_buf[2], len; struct print_iovec_config *c = data; if (elem_size < sizeof(iov_buf)) { @@ -85,14 +85,14 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) case IOV_DECODE_STR: if (len > c->data_size) len = c->data_size; - if (c->data_size != (kernel_ureg_t) -1) + if (c->data_size != (kernel_ulong_t) -1) c->data_size -= len; printstrn(tcp, iov[0], len); break; case IOV_DECODE_NETLINK: if (len > c->data_size) len = c->data_size; - if (c->data_size != (kernel_ureg_t) -1) + if (c->data_size != (kernel_ulong_t) -1) c->data_size -= len; decode_netlink(tcp, iov[0], iov[1]); break; @@ -111,11 +111,11 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) * Example: recvmsg returing a short read. */ void -tprint_iov_upto(struct tcb *const tcp, const kernel_ureg_t len, - const kernel_ureg_t addr, const enum iov_decode decode_iov, - const kernel_ureg_t data_size) +tprint_iov_upto(struct tcb *const tcp, const kernel_ulong_t len, + const kernel_ulong_t addr, const enum iov_decode decode_iov, + const kernel_ulong_t data_size) { - kernel_ureg_t iov[2]; + kernel_ulong_t iov[2]; struct print_iovec_config config = { .decode_iov = decode_iov, .data_size = data_size }; diff --git a/ioctl.c b/ioctl.c index 19d5ec3b..2ed22cf9 100644 --- a/ioctl.c +++ b/ioctl.c @@ -227,7 +227,7 @@ static int ioctl_decode(struct tcb *tcp) { const unsigned int code = tcp->u_arg[1]; - const kernel_ureg_t arg = tcp->u_arg[2]; + const kernel_ulong_t arg = tcp->u_arg[2]; switch (_IOC_TYPE(code)) { #if defined(ALPHA) || defined(POWERPC) diff --git a/ipc_msg.c b/ipc_msg.c index 7016fec4..42c6cd79 100644 --- a/ipc_msg.c +++ b/ipc_msg.c @@ -57,8 +57,8 @@ SYS_FUNC(msgget) } static void -tprint_msgsnd(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t count, const unsigned int flags) +tprint_msgsnd(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t count, const unsigned int flags) { tprint_msgbuf(tcp, addr, count); printflags(ipc_msg_flags, flags, "MSG_???"); @@ -78,16 +78,16 @@ SYS_FUNC(msgsnd) } static void -tprint_msgrcv(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t count, const kernel_ureg_t msgtyp) +tprint_msgrcv(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t count, const kernel_ulong_t msgtyp) { tprint_msgbuf(tcp, addr, count); tprintf("%" PRI_krd ", ", msgtyp); } static int -fetch_msgrcv_args(struct tcb *const tcp, const kernel_ureg_t addr, - kernel_ureg_t *const pair) +fetch_msgrcv_args(struct tcb *const tcp, const kernel_ulong_t addr, + kernel_ulong_t *const pair) { if (current_wordsize == sizeof(*pair)) { if (umoven_or_printaddr(tcp, addr, 2 * sizeof(*pair), pair)) @@ -118,7 +118,7 @@ SYS_FUNC(msgrcv) tprint_msgrcv(tcp, tcp->u_arg[3], tcp->u_arg[1], tcp->u_arg[4]); } else { - kernel_ureg_t pair[2]; + kernel_ulong_t pair[2]; if (fetch_msgrcv_args(tcp, tcp->u_arg[3], pair)) tprintf(", %" PRI_kru ", ", tcp->u_arg[1]); diff --git a/ipc_msgctl.c b/ipc_msgctl.c index 9ad101f1..f289c301 100644 --- a/ipc_msgctl.c +++ b/ipc_msgctl.c @@ -51,7 +51,7 @@ typedef struct msqid64_ds msqid_ds_t; #include "xlat/msgctl_flags.h" static void -print_msqid_ds(struct tcb *const tcp, const kernel_ureg_t addr, int cmd) +print_msqid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd) { /* TODO: We don't properly decode old compat ipc calls. */ if (cmd & IPC_64) @@ -101,7 +101,7 @@ SYS_FUNC(msgctl) PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???"); tprints(", "); } else { - const kernel_ureg_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]; + const kernel_ulong_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]; print_msqid_ds(tcp, addr, tcp->u_arg[1]); } return 0; diff --git a/ipc_sem.c b/ipc_sem.c index 101d0eca..03dbfe2e 100644 --- a/ipc_sem.c +++ b/ipc_sem.c @@ -57,7 +57,7 @@ print_sembuf(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) #endif static void -tprint_sembuf_array(struct tcb *const tcp, const kernel_ureg_t addr, +tprint_sembuf_array(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned int count) { #if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H diff --git a/ipc_shmctl.c b/ipc_shmctl.c index ee7f7d9f..ff76af8c 100644 --- a/ipc_shmctl.c +++ b/ipc_shmctl.c @@ -51,7 +51,7 @@ typedef struct shmid64_ds shmid_ds_t; #include "xlat/shmctl_flags.h" static void -print_shmid_ds(struct tcb *const tcp, const kernel_ureg_t addr, int cmd) +print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd) { /* TODO: We don't properly decode old compat ipc calls. */ if (cmd & IPC_64) @@ -101,7 +101,7 @@ SYS_FUNC(shmctl) PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???"); tprints(", "); } else { - const kernel_ureg_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]; + const kernel_ulong_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]; print_shmid_ds(tcp, addr, tcp->u_arg[1]); } return 0; diff --git a/kernel_types.h b/kernel_types.h index 66c20831..5a276135 100644 --- a/kernel_types.h +++ b/kernel_types.h @@ -47,9 +47,6 @@ typedef unsigned long kernel_ulong_t; # endif -typedef kernel_ulong_t kernel_scno_t; -typedef kernel_ulong_t kernel_ureg_t; - typedef struct { kernel_ulong_t d_ino; kernel_ulong_t d_off; diff --git a/kexec.c b/kexec.c index fe117233..a851d6a8 100644 --- a/kexec.c +++ b/kexec.c @@ -40,8 +40,8 @@ static bool print_seg(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - const kernel_ureg_t *seg; - kernel_ureg_t seg_buf[4]; + const kernel_ulong_t *seg; + kernel_ulong_t seg_buf[4]; if (elem_size < sizeof(seg_buf)) { unsigned int i; @@ -63,15 +63,15 @@ print_seg(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) } static void -print_kexec_segments(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t len) +print_kexec_segments(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len) { if (len > KEXEC_SEGMENT_MAX) { printaddr(addr); return; } - kernel_ureg_t seg[4]; + kernel_ulong_t seg[4]; const size_t sizeof_seg = ARRAY_SIZE(seg) * current_wordsize; print_array(tcp, addr, len, seg, sizeof_seg, @@ -89,9 +89,9 @@ SYS_FUNC(kexec_load) tprints(", "); /* flags */ - kernel_ureg_t n = tcp->u_arg[3]; + kernel_ulong_t n = tcp->u_arg[3]; printxval64(kexec_arch_values, n & KEXEC_ARCH_MASK, "KEXEC_ARCH_???"); - n &= ~(kernel_ureg_t) KEXEC_ARCH_MASK; + n &= ~(kernel_ulong_t) KEXEC_ARCH_MASK; if (n) { tprints("|"); printflags64(kexec_load_flags, n, "KEXEC_???"); diff --git a/ldt.c b/ldt.c index b7889fb6..b0c9dbd2 100644 --- a/ldt.c +++ b/ldt.c @@ -38,7 +38,7 @@ # include void -print_user_desc(struct tcb *const tcp, const kernel_ureg_t addr) +print_user_desc(struct tcb *const tcp, const kernel_ulong_t addr) { struct user_desc desc; diff --git a/linux/aarch64/get_scno.c b/linux/aarch64/get_scno.c index 6dc4962e..569aea09 100644 --- a/linux/aarch64/get_scno.c +++ b/linux/aarch64/get_scno.c @@ -2,7 +2,7 @@ static int arch_get_scno(struct tcb *tcp) { - kernel_scno_t scno = 0; + kernel_ulong_t scno = 0; switch (aarch64_io.iov_len) { case sizeof(aarch64_regs): diff --git a/linux/aarch64/set_scno.c b/linux/aarch64/set_scno.c index e66297af..fe44672b 100644 --- a/linux/aarch64/set_scno.c +++ b/linux/aarch64/set_scno.c @@ -7,7 +7,7 @@ */ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { unsigned int n = (uint16_t) scno; const struct iovec io = { diff --git a/linux/alpha/get_scno.c b/linux/alpha/get_scno.c index 8e7bab6b..3ffd78a6 100644 --- a/linux/alpha/get_scno.c +++ b/linux/alpha/get_scno.c @@ -2,7 +2,7 @@ static int arch_get_scno(struct tcb *tcp) { - kernel_scno_t scno = 0; + kernel_ulong_t scno = 0; if (upeek(tcp->pid, REG_A3, &alpha_a3) < 0) return -1; diff --git a/linux/alpha/set_scno.c b/linux/alpha/set_scno.c index 4607ce45..d5bcfb6d 100644 --- a/linux/alpha/set_scno.c +++ b/linux/alpha/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { return upoke(tcp->pid, REG_R0, scno); } diff --git a/linux/arc/set_scno.c b/linux/arc/set_scno.c index bc6c9dc7..ea25d74d 100644 --- a/linux/arc/set_scno.c +++ b/linux/arc/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { arc_regs.scratch.r8 = scno; return set_regs(tcp->pid); diff --git a/linux/arm/get_scno.c b/linux/arm/get_scno.c index e312d163..d2bc0682 100644 --- a/linux/arm/get_scno.c +++ b/linux/arm/get_scno.c @@ -31,7 +31,7 @@ static int arch_get_scno(struct tcb *tcp) { - kernel_scno_t scno = 0; + kernel_ulong_t scno = 0; /* Note: we support only 32-bit CPUs, not 26-bit */ diff --git a/linux/arm/set_scno.c b/linux/arm/set_scno.c index 085e539e..015ed066 100644 --- a/linux/arm/set_scno.c +++ b/linux/arm/set_scno.c @@ -7,7 +7,7 @@ */ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { unsigned int n = (uint16_t) scno; int rc = ptrace(PTRACE_SET_SYSCALL, tcp->pid, NULL, (unsigned long) n); diff --git a/linux/avr32/set_scno.c b/linux/avr32/set_scno.c index d8f87d11..66c4db7e 100644 --- a/linux/avr32/set_scno.c +++ b/linux/avr32/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { avr32_regs.r8 = scno; return set_regs(tcp->pid); diff --git a/linux/bfin/set_scno.c b/linux/bfin/set_scno.c index 8f60274d..4508be1a 100644 --- a/linux/bfin/set_scno.c +++ b/linux/bfin/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { return upoke(tcp->pid, PT_ORIG_P0, scno); } diff --git a/linux/crisv10/set_scno.c b/linux/crisv10/set_scno.c index f728c769..0de38fa7 100644 --- a/linux/crisv10/set_scno.c +++ b/linux/crisv10/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { return upoke(tcp->pid, 4 * PT_R9, scno); } diff --git a/linux/hppa/set_scno.c b/linux/hppa/set_scno.c index 3d85f4a5..d4d873be 100644 --- a/linux/hppa/set_scno.c +++ b/linux/hppa/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { return upoke(tcp->pid, PT_GR20, scno); } diff --git a/linux/i386/set_scno.c b/linux/i386/set_scno.c index 1b633f32..3abe7768 100644 --- a/linux/i386/set_scno.c +++ b/linux/i386/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { #ifdef HAVE_GETREGS_OLD return upoke(tcp->pid, 4 * ORIG_EAX, scno); diff --git a/linux/ia64/set_scno.c b/linux/ia64/set_scno.c index a8f9cd87..1af7b025 100644 --- a/linux/ia64/set_scno.c +++ b/linux/ia64/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { if (ia64_ia32mode) ia64_regs.gr[0] = scno; diff --git a/linux/m68k/set_scno.c b/linux/m68k/set_scno.c index 17fa989d..b45e6485 100644 --- a/linux/m68k/set_scno.c +++ b/linux/m68k/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { m68k_regs.orig_d0 = scno; return set_regs(tcp->pid); diff --git a/linux/metag/set_scno.c b/linux/metag/set_scno.c index 8b13e1da..c9b63c81 100644 --- a/linux/metag/set_scno.c +++ b/linux/metag/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { metag_regs.dx[0][1] = scno; return set_regs(tcp->pid); diff --git a/linux/microblaze/set_scno.c b/linux/microblaze/set_scno.c index ff233035..b9cddefc 100644 --- a/linux/microblaze/set_scno.c +++ b/linux/microblaze/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { return upoke(tcp->pid, 0, scno); } diff --git a/linux/mips/arch_sigreturn.c b/linux/mips/arch_sigreturn.c index ad972fe0..14203093 100644 --- a/linux/mips/arch_sigreturn.c +++ b/linux/mips/arch_sigreturn.c @@ -6,7 +6,7 @@ arch_sigreturn(struct tcb *tcp) * offsetof(struct sigframe, sf_mask) == * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct sigcontext) */ - const kernel_ureg_t addr = mips_REG_SP + 6 * 4 + + const kernel_ulong_t addr = mips_REG_SP + 6 * 4 + sizeof(struct sigcontext); #else /* @@ -16,7 +16,7 @@ arch_sigreturn(struct tcb *tcp) * offsetof(struct rt_sigframe, rs_uc) == * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct siginfo) */ - const kernel_ureg_t addr = mips_REG_SP + 6 * 4 + 128 + + const kernel_ulong_t addr = mips_REG_SP + 6 * 4 + 128 + offsetof(struct ucontext, uc_sigmask); #endif diff --git a/linux/mips/set_scno.c b/linux/mips/set_scno.c index 7d8fe9bc..1eb456cc 100644 --- a/linux/mips/set_scno.c +++ b/linux/mips/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { mips_REG_V0 = scno; return set_regs(tcp->pid); diff --git a/linux/nios2/set_scno.c b/linux/nios2/set_scno.c index 64f1ccda..1f5051c2 100644 --- a/linux/nios2/set_scno.c +++ b/linux/nios2/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { nios2_regs.regs[2] = scno; return set_regs(tcp->pid); diff --git a/linux/or1k/set_scno.c b/linux/or1k/set_scno.c index 0ce465ac..269eeb5a 100644 --- a/linux/or1k/set_scno.c +++ b/linux/or1k/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { or1k_regs.gpr[11] = scno; return set_regs(tcp->pid); diff --git a/linux/powerpc/set_scno.c b/linux/powerpc/set_scno.c index aa4a9110..c5a04687 100644 --- a/linux/powerpc/set_scno.c +++ b/linux/powerpc/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { #ifdef HAVE_GETREGS_OLD return upoke(tcp->pid, sizeof(long) * PT_R0, scno); diff --git a/linux/riscv/set_scno.c b/linux/riscv/set_scno.c index 858a0671..64c7db76 100644 --- a/linux/riscv/set_scno.c +++ b/linux/riscv/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { riscv_regs.a7 = scno; return set_regs(tcp->pid); diff --git a/linux/s390/set_scno.c b/linux/s390/set_scno.c index ffa600cf..c7a31100 100644 --- a/linux/s390/set_scno.c +++ b/linux/s390/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { s390_regset.gprs[2] = scno; return set_regs(tcp->pid); diff --git a/linux/sh/get_scno.c b/linux/sh/get_scno.c index 971f5547..45fc0b7b 100644 --- a/linux/sh/get_scno.c +++ b/linux/sh/get_scno.c @@ -2,7 +2,7 @@ static int arch_get_scno(struct tcb *tcp) { - kernel_scno_t scno = 0; + kernel_ulong_t scno = 0; /* * In the new syscall ABI, the system call number is in R3. @@ -14,7 +14,7 @@ arch_get_scno(struct tcb *tcp) /* Odd as it may seem, a glibc bug has been known to cause glibc to issue bogus negative syscall numbers. So for our purposes, make strace print what it *should* have been */ - kernel_scno_t correct_scno = (scno & 0xff); + kernel_ulong_t correct_scno = (scno & 0xff); if (debug_flag) error_msg("Detected glibc bug: bogus system call" " number = %ld, correcting to %ld", diff --git a/linux/sh/set_scno.c b/linux/sh/set_scno.c index 63e5529a..5f71664a 100644 --- a/linux/sh/set_scno.c +++ b/linux/sh/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { return upoke(tcp->pid, 4 * (REG_REG0 + 3), scno); } diff --git a/linux/sh64/set_scno.c b/linux/sh64/set_scno.c index cae7d500..be4f1ed1 100644 --- a/linux/sh64/set_scno.c +++ b/linux/sh64/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { return upoke(tcp->pid, REG_SYSCALL, scno); } diff --git a/linux/sparc/set_scno.c b/linux/sparc/set_scno.c index 0ba7f08f..c891a0b5 100644 --- a/linux/sparc/set_scno.c +++ b/linux/sparc/set_scno.c @@ -4,7 +4,7 @@ */ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { sparc_regs.u_regs[U_REG_G1] = scno; return set_regs(tcp->pid); diff --git a/linux/tile/set_scno.c b/linux/tile/set_scno.c index 84c06767..c28d88c3 100644 --- a/linux/tile/set_scno.c +++ b/linux/tile/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { tile_regs.regs[10] = scno; return set_regs(tcp->pid); diff --git a/linux/x86_64/arch_sigreturn.c b/linux/x86_64/arch_sigreturn.c index 46dce485..6a161e6e 100644 --- a/linux/x86_64/arch_sigreturn.c +++ b/linux/x86_64/arch_sigreturn.c @@ -18,14 +18,14 @@ arch_sigreturn(struct tcb *tcp) #define X86_64_SIGMASK_OFFSET offsetof(struct ucontext, uc_sigmask) #define X32_SIGMASK_OFFSET sizeof(ucontext_x32_header) - const kernel_ureg_t offset = + const kernel_ulong_t offset = #ifdef X32 X32_SIGMASK_OFFSET; #else current_personality == 2 ? X32_SIGMASK_OFFSET : X86_64_SIGMASK_OFFSET; #endif - const kernel_ureg_t addr = (kernel_ureg_t) *x86_64_rsp_ptr + offset; + const kernel_ulong_t addr = (kernel_ulong_t) *x86_64_rsp_ptr + offset; tprints("{mask="); print_sigset_addr_len(tcp, addr, NSIG / 8); tprints("}"); diff --git a/linux/x86_64/get_scno.c b/linux/x86_64/get_scno.c index 45e3cb27..05a8b530 100644 --- a/linux/x86_64/get_scno.c +++ b/linux/x86_64/get_scno.c @@ -40,7 +40,7 @@ static int arch_get_scno(struct tcb *tcp) { - kernel_scno_t scno = 0; + kernel_ulong_t scno = 0; unsigned int currpers; #ifndef __X32_SYSCALL_BIT diff --git a/linux/x86_64/set_scno.c b/linux/x86_64/set_scno.c index c7d5413c..6438c526 100644 --- a/linux/x86_64/set_scno.c +++ b/linux/x86_64/set_scno.c @@ -5,7 +5,7 @@ #endif /* !HAVE_GETREGS_OLD */ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { #ifdef HAVE_GETREGS_OLD return upoke(tcp->pid, 8 * ORIG_RAX, scno); diff --git a/linux/xtensa/set_scno.c b/linux/xtensa/set_scno.c index a869a2b1..54c948d3 100644 --- a/linux/xtensa/set_scno.c +++ b/linux/xtensa/set_scno.c @@ -1,5 +1,5 @@ static int -arch_set_scno(struct tcb *tcp, kernel_scno_t scno) +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { return upoke(tcp->pid, SYSCALL_NR, scno); } diff --git a/loop.c b/loop.c index cccc0143..1699394a 100644 --- a/loop.c +++ b/loop.c @@ -33,7 +33,7 @@ #include "xlat/loop_crypt_type_options.h" static void -decode_loop_info(struct tcb *const tcp, const kernel_ureg_t addr) +decode_loop_info(struct tcb *const tcp, const kernel_ulong_t addr) { struct loop_info info; @@ -83,7 +83,7 @@ decode_loop_info(struct tcb *const tcp, const kernel_ureg_t addr) } static void -decode_loop_info64(struct tcb *const tcp, const kernel_ureg_t addr) +decode_loop_info64(struct tcb *const tcp, const kernel_ulong_t addr) { struct loop_info64 info64; @@ -141,7 +141,7 @@ decode_loop_info64(struct tcb *const tcp, const kernel_ureg_t addr) int loop_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { if (!verbose(tcp)) return RVAL_DECODED; diff --git a/mem.c b/mem.c index 9ce867ac..4e556ded 100644 --- a/mem.c +++ b/mem.c @@ -55,12 +55,12 @@ SYS_FUNC(brk) #include "xlat/mmap_flags.h" static void -print_mmap(struct tcb *tcp, kernel_ureg_t *u_arg, unsigned long long offset) +print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset) { - const kernel_ureg_t addr = u_arg[0]; - const kernel_ureg_t len = u_arg[1]; - const kernel_ureg_t prot = u_arg[2]; - const kernel_ureg_t flags = u_arg[3]; + const kernel_ulong_t addr = u_arg[0]; + const kernel_ulong_t len = u_arg[1]; + const kernel_ulong_t prot = u_arg[2]; + const kernel_ulong_t flags = u_arg[3]; const int fd = u_arg[4]; printaddr(addr); @@ -93,7 +93,7 @@ print_mmap(struct tcb *tcp, kernel_ureg_t *u_arg, unsigned long long offset) /* Params are pointed to by u_arg[0], offset is in bytes */ SYS_FUNC(old_mmap) { - kernel_ureg_t u_arg[6]; + kernel_ulong_t u_arg[6]; # ifndef current_klongsize /* We are here only in a 32-bit personality. */ unsigned int narrow_arg[6]; @@ -116,7 +116,7 @@ SYS_FUNC(old_mmap) /* Params are pointed to by u_arg[0], offset is in pages */ SYS_FUNC(old_mmap_pgoff) { - kernel_ureg_t u_arg[5]; + kernel_ulong_t u_arg[5]; int i; unsigned int narrow_arg[6]; unsigned long long offset; @@ -312,11 +312,11 @@ SYS_FUNC(getpagesize) SYS_FUNC(remap_file_pages) { - const kernel_ureg_t addr = tcp->u_arg[0]; - const kernel_ureg_t size = tcp->u_arg[1]; - const kernel_ureg_t prot = tcp->u_arg[2]; - const kernel_ureg_t pgoff = tcp->u_arg[3]; - const kernel_ureg_t flags = tcp->u_arg[4]; + const kernel_ulong_t addr = tcp->u_arg[0]; + const kernel_ulong_t size = tcp->u_arg[1]; + const kernel_ulong_t prot = tcp->u_arg[2]; + const kernel_ulong_t pgoff = tcp->u_arg[3]; + const kernel_ulong_t flags = tcp->u_arg[4]; printaddr(addr); tprintf(", %" PRI_kru ", ", size); @@ -343,10 +343,10 @@ print_protmap_entry(struct tcb *tcp, void *elem_buf, size_t elem_size, void *dat SYS_FUNC(subpage_prot) { - kernel_ureg_t addr = tcp->u_arg[0]; - kernel_ureg_t len = tcp->u_arg[1]; - kernel_ureg_t nmemb = len >> 16; - kernel_ureg_t map = tcp->u_arg[2]; + kernel_ulong_t addr = tcp->u_arg[0]; + kernel_ulong_t len = tcp->u_arg[1]; + kernel_ulong_t nmemb = len >> 16; + kernel_ulong_t map = tcp->u_arg[2]; printaddr(addr); tprintf(", %" PRI_kru ", ", len); diff --git a/membarrier.c b/membarrier.c index 1a49e595..759b76f3 100644 --- a/membarrier.c +++ b/membarrier.c @@ -44,6 +44,6 @@ SYS_FUNC(membarrier) return 0; tcp->auxstr = sprintflags("", membarrier_cmds, - (kernel_ureg_t) tcp->u_rval); + (kernel_ulong_t) tcp->u_rval); return RVAL_HEX | RVAL_STR; } diff --git a/mmsghdr.c b/mmsghdr.c index ac9327c2..6dfe9b83 100644 --- a/mmsghdr.c +++ b/mmsghdr.c @@ -34,7 +34,7 @@ static int fetch_struct_mmsghdr_or_printaddr(struct tcb *const tcp, - const kernel_ureg_t addr, + const kernel_ulong_t addr, const unsigned int len, void *const mh) { if ((entering(tcp) || !syserror(tcp)) @@ -68,7 +68,7 @@ print_struct_mmsghdr(struct tcb *tcp, void *elem_buf, tprints("{msg_hdr="); print_struct_msghdr(tcp, &mmsg->msg_hdr, c->p_user_msg_namelen, - c->use_msg_len ? mmsg->msg_len : (kernel_ureg_t) -1); + c->use_msg_len ? mmsg->msg_len : (kernel_ulong_t) -1); if (c->msg_len_vlen) { tprintf(", msg_len=%u", mmsg->msg_len); --c->msg_len_vlen; @@ -98,7 +98,7 @@ struct mmsgvec_data { }; static void -save_mmsgvec_namelen(struct tcb *const tcp, kernel_ureg_t addr, +save_mmsgvec_namelen(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, const char *const timeout) { if (len > IOV_MAX) @@ -125,7 +125,7 @@ save_mmsgvec_namelen(struct tcb *const tcp, kernel_ureg_t addr, } static void -decode_mmsgvec(struct tcb *const tcp, const kernel_ureg_t addr, +decode_mmsgvec(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned int vlen, const unsigned int msg_len_vlen, const bool use_msg_len) { @@ -149,7 +149,7 @@ decode_mmsgvec(struct tcb *const tcp, const kernel_ureg_t addr, } void -dumpiov_in_mmsghdr(struct tcb *const tcp, kernel_ureg_t addr) +dumpiov_in_mmsghdr(struct tcb *const tcp, kernel_ulong_t addr) { unsigned int len = tcp->u_rval; unsigned int i, fetched; @@ -160,7 +160,7 @@ dumpiov_in_mmsghdr(struct tcb *const tcp, kernel_ureg_t addr) if (!fetched) break; tprintf(" = %" PRI_kru " buffers in vector %u\n", - (kernel_ureg_t) mmsg.msg_hdr.msg_iovlen, i); + (kernel_ulong_t) mmsg.msg_hdr.msg_iovlen, i); dumpiov_upto(tcp, mmsg.msg_hdr.msg_iovlen, ptr_to_kulong(mmsg.msg_hdr.msg_iov), mmsg.msg_len); diff --git a/mount.c b/mount.c index 7251c5a7..997452cc 100644 --- a/mount.c +++ b/mount.c @@ -42,7 +42,7 @@ SYS_FUNC(mount) bool ignore_type = false; bool ignore_data = false; bool old_magic = false; - kernel_ureg_t flags = tcp->u_arg[3]; + kernel_ulong_t flags = tcp->u_arg[3]; /* Discard magic */ if ((flags & MS_MGC_MSK) == MS_MGC_VAL) { diff --git a/msghdr.c b/msghdr.c index 3aba6427..ee069e3d 100644 --- a/msghdr.c +++ b/msghdr.c @@ -252,8 +252,8 @@ get_optmem_max(void) } static void -decode_msg_control(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t in_control_len) +decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t in_control_len) { if (!in_control_len) return; @@ -279,7 +279,7 @@ decode_msg_control(struct tcb *const tcp, const kernel_ureg_t addr, tprints("["); while (buf_len >= cmsg_size) { - const kernel_ureg_t cmsg_len = + const kernel_ulong_t cmsg_len = #if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_len : #endif @@ -301,7 +301,7 @@ decode_msg_control(struct tcb *const tcp, const kernel_ureg_t addr, printxval(socketlayers, cmsg_level, "SOL_???"); tprints(", cmsg_type="); - kernel_ureg_t len = cmsg_len > buf_len ? buf_len : cmsg_len; + kernel_ulong_t len = cmsg_len > buf_len ? buf_len : cmsg_len; print_cmsg_type_data(tcp, cmsg_level, cmsg_type, (const void *) (u.ptr + cmsg_size), @@ -313,7 +313,7 @@ decode_msg_control(struct tcb *const tcp, const kernel_ureg_t addr, break; } len = (cmsg_len + current_wordsize - 1) & - ~((kernel_ureg_t) current_wordsize - 1); + ~((kernel_ulong_t) current_wordsize - 1); if (len >= buf_len) { buf_len = 0; break; @@ -334,7 +334,7 @@ decode_msg_control(struct tcb *const tcp, const kernel_ureg_t addr, void print_struct_msghdr(struct tcb *tcp, const struct msghdr *msg, const int *const p_user_msg_namelen, - const kernel_ureg_t data_size) + const kernel_ulong_t data_size) { const int msg_namelen = p_user_msg_namelen && (int) msg->msg_namelen > *p_user_msg_namelen @@ -355,11 +355,11 @@ print_struct_msghdr(struct tcb *tcp, const struct msghdr *msg, tprint_iov_upto(tcp, msg->msg_iovlen, ptr_to_kulong(msg->msg_iov), decode, data_size); - tprintf(", msg_iovlen=%" PRI_kru, (kernel_ureg_t) msg->msg_iovlen); + tprintf(", msg_iovlen=%" PRI_kru, (kernel_ulong_t) msg->msg_iovlen); decode_msg_control(tcp, ptr_to_kulong(msg->msg_control), msg->msg_controllen); - tprintf(", msg_controllen=%" PRI_kru, (kernel_ureg_t) msg->msg_controllen); + tprintf(", msg_controllen=%" PRI_kru, (kernel_ulong_t) msg->msg_controllen); tprints(", msg_flags="); printflags(msg_flags, msg->msg_flags, "MSG_???"); @@ -367,7 +367,7 @@ print_struct_msghdr(struct tcb *tcp, const struct msghdr *msg, } static bool -fetch_msghdr_namelen(struct tcb *const tcp, const kernel_ureg_t addr, +fetch_msghdr_namelen(struct tcb *const tcp, const kernel_ulong_t addr, int *const p_msg_namelen) { struct msghdr msg; @@ -382,7 +382,7 @@ fetch_msghdr_namelen(struct tcb *const tcp, const kernel_ureg_t addr, static void decode_msghdr(struct tcb *const tcp, const int *const p_user_msg_namelen, - const kernel_ureg_t addr, const kernel_ureg_t data_size) + const kernel_ulong_t addr, const kernel_ulong_t data_size) { struct msghdr msg; @@ -393,8 +393,8 @@ decode_msghdr(struct tcb *const tcp, const int *const p_user_msg_namelen, } void -dumpiov_in_msghdr(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t data_size) +dumpiov_in_msghdr(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t data_size) { struct msghdr msg; diff --git a/msghdr.h b/msghdr.h index c693df31..9e458fec 100644 --- a/msghdr.h +++ b/msghdr.h @@ -15,6 +15,6 @@ struct tcb; extern void print_struct_msghdr(struct tcb *, const struct msghdr *, - const int *p_user_msg_namelen, kernel_ureg_t data_size); + const int *p_user_msg_namelen, kernel_ulong_t data_size); #endif /* !STRACE_MSGHDR_H */ diff --git a/mtd.c b/mtd.c index 8c049b2e..954a08b7 100644 --- a/mtd.c +++ b/mtd.c @@ -50,7 +50,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 +62,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 +75,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 +89,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 +103,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 +116,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 +130,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 +149,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 +168,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 +204,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 +230,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 +243,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: diff --git a/net.c b/net.c index 54eb1161..9affade3 100644 --- a/net.c +++ b/net.c @@ -104,8 +104,8 @@ print_ifindex(unsigned int ifindex) } static void -decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ureg_t addr, - const kernel_ureg_t addrlen) +decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr, + const kernel_ulong_t addrlen) { switch (verbose(tcp) ? getfdproto(tcp, fd) : SOCK_PROTO_UNKNOWN) { @@ -188,7 +188,7 @@ SYS_FUNC(listen) static bool fetch_socklen(struct tcb *const tcp, int *const plen, - const kernel_ureg_t sockaddr, const kernel_ureg_t socklen) + const kernel_ulong_t sockaddr, const kernel_ulong_t socklen) { return verbose(tcp) && sockaddr && socklen && umove(tcp, socklen, plen) == 0; @@ -374,7 +374,7 @@ printpair_fd(struct tcb *tcp, const int i0, const int i1) } static void -decode_pair_fd(struct tcb *const tcp, const kernel_ureg_t addr) +decode_pair_fd(struct tcb *const tcp, const kernel_ulong_t addr) { int pair[2]; @@ -487,7 +487,7 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level, } static void -print_linger(struct tcb *const tcp, const kernel_ureg_t addr, const int len) +print_linger(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { struct linger linger; @@ -504,7 +504,7 @@ print_linger(struct tcb *const tcp, const kernel_ureg_t addr, const int len) #ifdef SO_PEERCRED static void -print_ucred(struct tcb *const tcp, const kernel_ureg_t addr, const int len) +print_ucred(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { struct ucred uc; @@ -522,7 +522,7 @@ print_ucred(struct tcb *const tcp, const kernel_ureg_t addr, const int len) #ifdef PACKET_STATISTICS static void -print_tpacket_stats(struct tcb *const tcp, const kernel_ureg_t addr, +print_tpacket_stats(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { struct tpacket_stats stats; @@ -541,7 +541,7 @@ print_tpacket_stats(struct tcb *const tcp, const kernel_ureg_t addr, #include "xlat/icmpfilterflags.h" static void -print_icmp_filter(struct tcb *const tcp, const kernel_ureg_t addr, int len) +print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len) { struct icmp_filter filter = {}; @@ -562,7 +562,7 @@ print_icmp_filter(struct tcb *const tcp, const kernel_ureg_t addr, int len) static void print_getsockopt(struct tcb *const tcp, const unsigned int level, - const unsigned int name, const kernel_ureg_t addr, + const unsigned int name, const kernel_ulong_t addr, const int len) { if (addr && verbose(tcp)) @@ -636,7 +636,7 @@ SYS_FUNC(getsockopt) #ifdef IP_ADD_MEMBERSHIP static void -print_mreq(struct tcb *const tcp, const kernel_ureg_t addr, +print_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned int len) { struct ip_mreq mreq; @@ -660,7 +660,7 @@ print_mreq(struct tcb *const tcp, const kernel_ureg_t addr, #ifdef IPV6_ADD_MEMBERSHIP static void -print_mreq6(struct tcb *const tcp, const kernel_ureg_t addr, +print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned int len) { struct ipv6_mreq mreq; @@ -691,7 +691,7 @@ fail: #ifdef MCAST_JOIN_GROUP static void -print_group_req(struct tcb *const tcp, const kernel_ureg_t addr, const int len) +print_group_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { struct group_req greq; @@ -710,7 +710,7 @@ print_group_req(struct tcb *const tcp, const kernel_ureg_t addr, const int len) #ifdef PACKET_RX_RING static void -print_tpacket_req(struct tcb *const tcp, const kernel_ureg_t addr, const int len) +print_tpacket_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { struct tpacket_req req; @@ -732,7 +732,7 @@ print_tpacket_req(struct tcb *const tcp, const kernel_ureg_t addr, const int len # include "xlat/packet_mreq_type.h" static void -print_packet_mreq(struct tcb *const tcp, const kernel_ureg_t addr, const int len) +print_packet_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { struct packet_mreq mreq; @@ -756,7 +756,7 @@ print_packet_mreq(struct tcb *const tcp, const kernel_ureg_t addr, const int len static void print_setsockopt(struct tcb *const tcp, const unsigned int level, - const unsigned int name, const kernel_ureg_t addr, + const unsigned int name, const kernel_ulong_t addr, const int len) { if (addr && verbose(tcp)) diff --git a/netlink.c b/netlink.c index 46bfb177..db6e43f8 100644 --- a/netlink.c +++ b/netlink.c @@ -37,7 +37,7 @@ */ static bool fetch_nlmsghdr(struct tcb *const tcp, struct nlmsghdr *const nlmsghdr, - const kernel_ureg_t addr, const kernel_ureg_t len) + const kernel_ulong_t addr, const kernel_ulong_t len) { if (len < sizeof(struct nlmsghdr)) { printstrn(tcp, addr, len); @@ -69,8 +69,8 @@ print_nlmsghdr(struct tcb *tcp, const struct nlmsghdr *const nlmsghdr) static void decode_nlmsghdr_with_payload(struct tcb *const tcp, const struct nlmsghdr *const nlmsghdr, - const kernel_ureg_t addr, - const kernel_ureg_t len) + const kernel_ulong_t addr, + const kernel_ulong_t len) { tprints("{"); @@ -89,7 +89,7 @@ decode_nlmsghdr_with_payload(struct tcb *const tcp, } void -decode_netlink(struct tcb *const tcp, kernel_ureg_t addr, kernel_ureg_t len) +decode_netlink(struct tcb *const tcp, kernel_ulong_t addr, kernel_ulong_t len) { struct nlmsghdr nlmsghdr; bool print_array = false; @@ -102,8 +102,8 @@ decode_netlink(struct tcb *const tcp, kernel_ureg_t addr, kernel_ureg_t len) } unsigned int nlmsg_len = NLMSG_ALIGN(nlmsghdr.nlmsg_len); - kernel_ureg_t next_addr = 0; - kernel_ureg_t next_len = 0; + kernel_ulong_t next_addr = 0; + kernel_ulong_t next_len = 0; if (nlmsghdr.nlmsg_len >= sizeof(struct nlmsghdr)) { next_len = (len >= nlmsg_len) ? len - nlmsg_len : 0; diff --git a/numa.c b/numa.c index 25031cb4..ececff92 100644 --- a/numa.c +++ b/numa.c @@ -31,23 +31,23 @@ static bool print_node(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - if (elem_size < sizeof(kernel_ureg_t)) { + if (elem_size < sizeof(kernel_ulong_t)) { tprintf("%#0*x", (int) elem_size * 2 + 2, * (unsigned int *) elem_buf); } else { tprintf("%#0*" PRI_krx, (int) elem_size * 2 + 2, - * (kernel_ureg_t *) elem_buf); + * (kernel_ulong_t *) elem_buf); } return true; } static void -print_nodemask(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t maxnodes) +print_nodemask(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t maxnodes) { const unsigned int bits_per_long = 8 * current_wordsize; - const kernel_ureg_t nmemb = + const kernel_ulong_t nmemb = (maxnodes + bits_per_long - 2) / bits_per_long; if (nmemb < maxnodes / bits_per_long || @@ -56,7 +56,7 @@ print_nodemask(struct tcb *const tcp, const kernel_ureg_t addr, return; } - kernel_ureg_t buf; + kernel_ulong_t buf; print_array(tcp, addr, nmemb, &buf, current_wordsize, umoven_or_printaddr, print_node, 0); } @@ -123,12 +123,12 @@ SYS_FUNC(get_mempolicy) static bool print_addr(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - kernel_ureg_t addr; + kernel_ulong_t addr; if (elem_size < sizeof(addr)) { addr = * (unsigned int *) elem_buf; } else { - addr = * (kernel_ureg_t *) elem_buf; + addr = * (kernel_ulong_t *) elem_buf; } printaddr(addr); @@ -159,8 +159,8 @@ print_int(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) SYS_FUNC(move_pages) { - const kernel_ureg_t npages = tcp->u_arg[1]; - kernel_ureg_t buf; + const kernel_ulong_t npages = tcp->u_arg[1]; + kernel_ulong_t buf; if (entering(tcp)) { tprintf("%d, %" PRI_kru ", ", (int) tcp->u_arg[0], npages); diff --git a/oldstat.c b/oldstat.c index df7e13a3..5535310e 100644 --- a/oldstat.c +++ b/oldstat.c @@ -36,7 +36,7 @@ #ifdef HAVE_STRUCT___OLD_KERNEL_STAT static void -print_old_kernel_stat(struct tcb *const tcp, const kernel_ureg_t addr) +print_old_kernel_stat(struct tcb *const tcp, const kernel_ulong_t addr) { struct __old_kernel_stat buf; if (umove_or_printaddr(tcp, addr, &buf)) diff --git a/pathtrace.c b/pathtrace.c index 0026e686..d991aeda 100644 --- a/pathtrace.c +++ b/pathtrace.c @@ -54,7 +54,7 @@ pathmatch(const char *path) * Return true if specified path (in user-space) matches. */ static int -upathmatch(struct tcb *const tcp, const kernel_ureg_t upath) +upathmatch(struct tcb *const tcp, const kernel_ulong_t upath) { char path[PATH_MAX + 1]; @@ -248,8 +248,8 @@ pathtrace_match(struct tcb *tcp) { int i, j; int nfds; - kernel_ureg_t *args; - kernel_ureg_t select_args[5]; + kernel_ulong_t *args; + kernel_ulong_t select_args[5]; unsigned int oldselect_args[5]; unsigned int fdsize; fd_set *fds; @@ -311,7 +311,7 @@ pathtrace_match(struct tcb *tcp) { struct pollfd fds; unsigned nfds; - kernel_ureg_t start, cur, end; + kernel_ulong_t start, cur, end; start = tcp->u_arg[0]; nfds = tcp->u_arg[1]; diff --git a/perf.c b/perf.c index b01e593e..f151c198 100644 --- a/perf.c +++ b/perf.c @@ -61,7 +61,7 @@ free_pea_desc(void *pea_desc_ptr) } static int -fetch_perf_event_attr(struct tcb *const tcp, const kernel_ureg_t addr) +fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) { struct pea_desc *desc; struct perf_event_attr *attr; @@ -118,7 +118,7 @@ fetch_perf_event_attr(struct tcb *const tcp, const kernel_ureg_t addr) } while (0) static void -print_perf_event_attr(struct tcb *const tcp, const kernel_ureg_t addr) +print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) { static const char *precise_ip_desc[] = { "arbitrary skid", diff --git a/poll.c b/poll.c index 1267cfbb..c612c5ee 100644 --- a/poll.c +++ b/poll.c @@ -50,7 +50,7 @@ print_pollfd(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) static void decode_poll_entering(struct tcb *tcp) { - const kernel_ureg_t addr = tcp->u_arg[0]; + const kernel_ulong_t addr = tcp->u_arg[0]; const unsigned int nfds = tcp->u_arg[1]; struct pollfd fds; @@ -60,14 +60,14 @@ decode_poll_entering(struct tcb *tcp) } static int -decode_poll_exiting(struct tcb *const tcp, const kernel_ureg_t pts) +decode_poll_exiting(struct tcb *const tcp, const kernel_ulong_t pts) { struct pollfd fds; const unsigned int nfds = tcp->u_arg[1]; const unsigned long size = sizeof(fds) * nfds; - const kernel_ureg_t start = tcp->u_arg[0]; - const kernel_ureg_t end = start + size; - kernel_ureg_t cur; + const kernel_ulong_t start = tcp->u_arg[0]; + const kernel_ulong_t end = start + size; + kernel_ulong_t cur; const unsigned int max_printed = abbrev(tcp) ? max_strlen : -1U; unsigned int printed; diff --git a/prctl.c b/prctl.c index 34f736bf..79c99165 100644 --- a/prctl.c +++ b/prctl.c @@ -113,7 +113,7 @@ SYS_FUNC(prctl) break; if (syserror(tcp)) return 0; - tcp->auxstr = xlookup(pr_dumpable, (kernel_ureg_t) tcp->u_rval); + tcp->auxstr = xlookup(pr_dumpable, (kernel_ulong_t) tcp->u_rval); return RVAL_STR; case PR_GET_NAME: @@ -144,7 +144,7 @@ SYS_FUNC(prctl) if (syserror(tcp) || tcp->u_rval == 0) return 0; tcp->auxstr = sprintflags("", secbits, - (kernel_ureg_t) tcp->u_rval); + (kernel_ulong_t) tcp->u_rval); return RVAL_STR; case PR_GET_TID_ADDRESS: @@ -180,7 +180,7 @@ SYS_FUNC(prctl) if (syserror(tcp) || tcp->u_rval == 0) return 0; tcp->auxstr = sprintflags("", pr_fp_mode, - (kernel_ureg_t) tcp->u_rval); + (kernel_ulong_t) tcp->u_rval); return RVAL_STR; /* PR_TASK_PERF_EVENTS_* take no arguments. */ @@ -330,7 +330,7 @@ SYS_FUNC(prctl) if (syserror(tcp)) return 0; tcp->auxstr = xlookup(pr_mce_kill_policy, - (kernel_ureg_t) tcp->u_rval); + (kernel_ulong_t) tcp->u_rval); return tcp->auxstr ? RVAL_STR : RVAL_UDECIMAL; case PR_SET_FP_MODE: diff --git a/print_mq_attr.c b/print_mq_attr.c index f4b2d138..b5f9c134 100644 --- a/print_mq_attr.c +++ b/print_mq_attr.c @@ -44,7 +44,7 @@ typedef struct mq_attr mq_attr_t; #include MPERS_DEFS MPERS_PRINTER_DECL(void, printmqattr, struct tcb *const tcp, - const kernel_ureg_t addr, const bool decode_flags) + const kernel_ulong_t addr, const bool decode_flags) { #if defined HAVE_MQUEUE_H || defined HAVE_LINUX_MQUEUE_H mq_attr_t attr; diff --git a/print_msgbuf.c b/print_msgbuf.c index 3695135c..c8dab704 100644 --- a/print_msgbuf.c +++ b/print_msgbuf.c @@ -39,7 +39,7 @@ typedef struct msgbuf msgbuf_t; #include MPERS_DEFS MPERS_PRINTER_DECL(void, tprint_msgbuf, struct tcb *const tcp, - const kernel_ureg_t addr, const kernel_ureg_t count) + const kernel_ulong_t addr, const kernel_ulong_t count) { msgbuf_t msg; diff --git a/print_sigevent.c b/print_sigevent.c index 40ee725e..cfdbc087 100644 --- a/print_sigevent.c +++ b/print_sigevent.c @@ -36,7 +36,7 @@ #include "xlat/sigev_value.h" MPERS_PRINTER_DECL(void, print_sigevent, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { struct_sigevent sev; diff --git a/print_statfs.c b/print_statfs.c index 04addd07..c98ff8fe 100644 --- a/print_statfs.c +++ b/print_statfs.c @@ -56,7 +56,7 @@ print_statfs_number(const char *const prefix, const unsigned long long number) } void -print_struct_statfs(struct tcb *const tcp, const kernel_ureg_t addr) +print_struct_statfs(struct tcb *const tcp, const kernel_ulong_t addr) { #ifdef HAVE_STRUCT_STATFS struct strace_statfs b; @@ -91,8 +91,8 @@ print_struct_statfs(struct tcb *const tcp, const kernel_ureg_t addr) } void -print_struct_statfs64(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t size) +print_struct_statfs64(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t size) { #ifdef HAVE_STRUCT_STATFS64 struct strace_statfs b; diff --git a/print_timespec.c b/print_timespec.c index e005ca99..158396d1 100644 --- a/print_timespec.c +++ b/print_timespec.c @@ -65,7 +65,7 @@ print_timespec_t_utime(const timespec_t *t) } MPERS_PRINTER_DECL(void, print_timespec, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { timespec_t t; @@ -76,7 +76,7 @@ MPERS_PRINTER_DECL(void, print_timespec, } MPERS_PRINTER_DECL(const char *, sprint_timespec, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { timespec_t t; static char buf[sizeof(timespec_fmt) + 3 * sizeof(t)]; @@ -95,7 +95,7 @@ MPERS_PRINTER_DECL(const char *, sprint_timespec, } MPERS_PRINTER_DECL(void, print_timespec_utime_pair, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { timespec_t t[2]; @@ -110,7 +110,7 @@ MPERS_PRINTER_DECL(void, print_timespec_utime_pair, } MPERS_PRINTER_DECL(void, print_itimerspec, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { timespec_t t[2]; diff --git a/print_timeval.c b/print_timeval.c index be49ff34..daed7d36 100644 --- a/print_timeval.c +++ b/print_timeval.c @@ -47,7 +47,7 @@ MPERS_PRINTER_DECL(void, print_struct_timeval, const void *arg) } MPERS_PRINTER_DECL(void, print_timeval, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { timeval_t t; @@ -68,7 +68,7 @@ print_timeval_item(struct tcb *tcp, void *elem_buf, size_t size, void *data) } MPERS_PRINTER_DECL(void, print_timeval_pair, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { timeval_t t; @@ -77,7 +77,7 @@ MPERS_PRINTER_DECL(void, print_timeval_pair, } MPERS_PRINTER_DECL(const char *, sprint_timeval, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { timeval_t t; static char buf[sizeof(timeval_fmt) + 3 * sizeof(t)]; @@ -96,7 +96,7 @@ MPERS_PRINTER_DECL(const char *, sprint_timeval, } MPERS_PRINTER_DECL(void, print_itimerval, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { timeval_t t[2]; @@ -119,7 +119,7 @@ print_timeval32_t(const timeval32_t *t) } void -print_timeval32(struct tcb *const tcp, const kernel_ureg_t addr) +print_timeval32(struct tcb *const tcp, const kernel_ulong_t addr) { timeval32_t t; @@ -130,7 +130,7 @@ print_timeval32(struct tcb *const tcp, const kernel_ureg_t addr) } void -print_timeval32_pair(struct tcb *const tcp, const kernel_ureg_t addr) +print_timeval32_pair(struct tcb *const tcp, const kernel_ulong_t addr) { timeval32_t t[2]; @@ -145,7 +145,7 @@ print_timeval32_pair(struct tcb *const tcp, const kernel_ureg_t addr) } void -print_itimerval32(struct tcb *const tcp, const kernel_ureg_t addr) +print_itimerval32(struct tcb *const tcp, const kernel_ulong_t addr) { timeval32_t t[2]; @@ -160,7 +160,7 @@ print_itimerval32(struct tcb *const tcp, const kernel_ureg_t addr) } const char * -sprint_timeval32(struct tcb *const tcp, const kernel_ureg_t addr) +sprint_timeval32(struct tcb *const tcp, const kernel_ulong_t addr) { timeval32_t t; static char buf[sizeof(timeval_fmt) + 3 * sizeof(t)]; diff --git a/print_timex.c b/print_timex.c index c6fd732e..5d0c478e 100644 --- a/print_timex.c +++ b/print_timex.c @@ -41,7 +41,7 @@ typedef struct timex struct_timex; #include "xlat/adjtimex_status.h" MPERS_PRINTER_DECL(int, print_timex, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { struct_timex tx; diff --git a/printrusage.c b/printrusage.c index df5b4583..0a6a3c34 100644 --- a/printrusage.c +++ b/printrusage.c @@ -38,7 +38,7 @@ typedef struct rusage rusage_t; #include MPERS_DEFS MPERS_PRINTER_DECL(void, printrusage, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { rusage_t ru; @@ -75,7 +75,7 @@ MPERS_PRINTER_DECL(void, printrusage, #ifdef ALPHA void -printrusage32(struct tcb *const tcp, const kernel_ureg_t addr) +printrusage32(struct tcb *const tcp, const kernel_ulong_t addr) { struct rusage32 { timeval32_t ru_utime; /* user time used */ diff --git a/printsiginfo.c b/printsiginfo.c index 70e392bc..7bbb4214 100644 --- a/printsiginfo.c +++ b/printsiginfo.c @@ -239,7 +239,7 @@ printsiginfo(const siginfo_t *sip) } MPERS_PRINTER_DECL(void, printsiginfo_at, - struct tcb *const tcp, const kernel_ureg_t addr) + struct tcb *const tcp, const kernel_ulong_t addr) { siginfo_t si; @@ -255,7 +255,7 @@ print_siginfo_t(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) } MPERS_PRINTER_DECL(void, print_siginfo_array, struct tcb *const tcp, - const kernel_ureg_t addr, const kernel_ureg_t len) + const kernel_ulong_t addr, const kernel_ulong_t len) { siginfo_t si; diff --git a/process.c b/process.c index 4347b4c1..2589839a 100644 --- a/process.c +++ b/process.c @@ -57,7 +57,7 @@ static const struct xlat struct_user_offsets[] = { }; static void -print_user_offset_addr(const kernel_ureg_t addr) +print_user_offset_addr(const kernel_ulong_t addr) { const struct xlat *x; @@ -74,7 +74,7 @@ print_user_offset_addr(const kernel_ureg_t addr) } else { --x; tprintf("%s + %" PRI_kru, - x->str, addr - (kernel_ureg_t) x->val); + x->str, addr - (kernel_ulong_t) x->val); } } else { tprints(x->str); @@ -83,10 +83,10 @@ print_user_offset_addr(const kernel_ureg_t addr) SYS_FUNC(ptrace) { - const kernel_ureg_t request = tcp->u_arg[0]; + const kernel_ulong_t request = tcp->u_arg[0]; const int pid = tcp->u_arg[1]; - const kernel_ureg_t addr = tcp->u_arg[2]; - const kernel_ureg_t data = tcp->u_arg[3]; + const kernel_ulong_t addr = tcp->u_arg[2]; + const kernel_ulong_t data = tcp->u_arg[3]; if (entering(tcp)) { /* request */ diff --git a/process_vm.c b/process_vm.c index 3bc09320..5c2ba4d9 100644 --- a/process_vm.c +++ b/process_vm.c @@ -34,9 +34,9 @@ SYS_FUNC(process_vm_readv) /* arg 1: pid */ tprintf("%d, ", (int) tcp->u_arg[0]); } else { - kernel_ureg_t local_iovcnt = tcp->u_arg[2]; - kernel_ureg_t remote_iovcnt = tcp->u_arg[4]; - kernel_ureg_t flags = tcp->u_arg[5]; + kernel_ulong_t local_iovcnt = tcp->u_arg[2]; + kernel_ulong_t remote_iovcnt = tcp->u_arg[4]; + kernel_ulong_t flags = tcp->u_arg[5]; /* arg 2: local iov */ tprint_iov_upto(tcp, local_iovcnt, tcp->u_arg[1], @@ -56,9 +56,9 @@ SYS_FUNC(process_vm_readv) SYS_FUNC(process_vm_writev) { - kernel_ureg_t local_iovcnt = tcp->u_arg[2]; - kernel_ureg_t remote_iovcnt = tcp->u_arg[4]; - kernel_ureg_t flags = tcp->u_arg[5]; + kernel_ulong_t local_iovcnt = tcp->u_arg[2]; + kernel_ulong_t remote_iovcnt = tcp->u_arg[4]; + kernel_ulong_t flags = tcp->u_arg[5]; /* arg 1: pid */ tprintf("%d, ", (int) tcp->u_arg[0]); diff --git a/ptp.c b/ptp.c index f01f9c4c..951a2b40 100644 --- a/ptp.c +++ b/ptp.c @@ -34,7 +34,7 @@ int ptp_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { if (!verbose(tcp)) return RVAL_DECODED; diff --git a/quota.c b/quota.c index bf2f4215..19f391f7 100644 --- a/quota.c +++ b/quota.c @@ -171,7 +171,7 @@ struct fs_quota_statv { zero_extend_signed_to_ull((where).field)) static int -decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ureg_t data) +decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) { switch (cmd) { case Q_QUOTAOFF: diff --git a/resource.c b/resource.c index c1dce0e1..61c877e4 100644 --- a/resource.c +++ b/resource.c @@ -49,7 +49,7 @@ sprint_rlim64(uint64_t lim) } static void -print_rlimit64(struct tcb *const tcp, const kernel_ureg_t addr) +print_rlimit64(struct tcb *const tcp, const kernel_ulong_t addr) { struct rlimit_64 { uint64_t rlim_cur; @@ -80,7 +80,7 @@ sprint_rlim32(uint32_t lim) } static void -print_rlimit32(struct tcb *const tcp, const kernel_ureg_t addr) +print_rlimit32(struct tcb *const tcp, const kernel_ulong_t addr) { struct rlimit_32 { uint32_t rlim_cur; @@ -94,7 +94,7 @@ print_rlimit32(struct tcb *const tcp, const kernel_ureg_t addr) } static void -decode_rlimit(struct tcb *const tcp, const kernel_ureg_t addr) +decode_rlimit(struct tcb *const tcp, const kernel_ulong_t addr) { /* * i386 is the only personality on X86_64 and X32 diff --git a/rtc.c b/rtc.c index 915bb09e..2906255e 100644 --- a/rtc.c +++ b/rtc.c @@ -52,7 +52,7 @@ print_rtc_time(struct tcb *tcp, const struct rtc_time *rt) } static void -decode_rtc_time(struct tcb *const tcp, const kernel_ureg_t addr) +decode_rtc_time(struct tcb *const tcp, const kernel_ulong_t addr) { struct rtc_time rt; @@ -61,7 +61,7 @@ decode_rtc_time(struct tcb *const tcp, const kernel_ureg_t addr) } static void -decode_rtc_wkalrm(struct tcb *const tcp, const kernel_ureg_t addr) +decode_rtc_wkalrm(struct tcb *const tcp, const kernel_ulong_t addr) { struct rtc_wkalrm wk; @@ -73,7 +73,7 @@ decode_rtc_wkalrm(struct tcb *const tcp, const kernel_ureg_t addr) } static void -decode_rtc_pll_info(struct tcb *const tcp, const kernel_ureg_t addr) +decode_rtc_pll_info(struct tcb *const tcp, const kernel_ulong_t addr) { struct_rtc_pll_info pll; @@ -85,7 +85,7 @@ decode_rtc_pll_info(struct tcb *const tcp, const kernel_ureg_t addr) } MPERS_PRINTER_DECL(int, rtc_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 RTC_ALM_READ: diff --git a/sched.c b/sched.c index a9ff689e..90242615 100644 --- a/sched.c +++ b/sched.c @@ -39,7 +39,7 @@ SYS_FUNC(sched_getscheduler) if (entering(tcp)) { tprintf("%d", (int) tcp->u_arg[0]); } else if (!syserror(tcp)) { - tcp->auxstr = xlookup(schedulers, (kernel_ureg_t) tcp->u_rval); + tcp->auxstr = xlookup(schedulers, (kernel_ulong_t) tcp->u_rval); if (tcp->auxstr != NULL) return RVAL_STR; } @@ -94,7 +94,7 @@ SYS_FUNC(sched_rr_get_interval) } static void -print_sched_attr(struct tcb *const tcp, const kernel_ureg_t addr, +print_sched_attr(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size) { struct { diff --git a/scsi.c b/scsi.c index 71fd2e2c..b34ae679 100644 --- a/scsi.c +++ b/scsi.c @@ -51,7 +51,7 @@ print_uchar(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) } static void -print_sg_io_buffer(struct tcb *const tcp, const kernel_ureg_t addr, +print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned int len) { unsigned char buf; @@ -61,7 +61,7 @@ print_sg_io_buffer(struct tcb *const tcp, const kernel_ureg_t addr, } static int -print_sg_io_v3_req(struct tcb *const tcp, const kernel_ureg_t arg) +print_sg_io_v3_req(struct tcb *const tcp, const kernel_ulong_t arg) { struct sg_io_hdr sg_io; @@ -96,7 +96,7 @@ print_sg_io_v3_req(struct tcb *const tcp, const kernel_ureg_t arg) } static void -print_sg_io_v3_res(struct tcb *const tcp, const kernel_ureg_t arg) +print_sg_io_v3_res(struct tcb *const tcp, const kernel_ulong_t arg) { struct sg_io_hdr sg_io; @@ -135,7 +135,7 @@ print_sg_io_v3_res(struct tcb *const tcp, const kernel_ureg_t arg) #ifdef HAVE_LINUX_BSG_H static int -print_sg_io_v4_req(struct tcb *const tcp, const kernel_ureg_t arg) +print_sg_io_v4_req(struct tcb *const tcp, const kernel_ulong_t arg) { struct sg_io_v4 sg_io; @@ -173,7 +173,7 @@ print_sg_io_v4_req(struct tcb *const tcp, const kernel_ureg_t arg) } static void -print_sg_io_v4_res(struct tcb *const tcp, const kernel_ureg_t arg) +print_sg_io_v4_res(struct tcb *const tcp, const kernel_ulong_t arg) { struct sg_io_v4 sg_io; uint32_t din_len; @@ -211,14 +211,14 @@ print_sg_io_v4_res(struct tcb *const tcp, const kernel_ureg_t arg) #else /* !HAVE_LINUX_BSG_H */ static int -print_sg_io_v4_req(struct tcb *const tcp, const kernel_ureg_t arg) +print_sg_io_v4_req(struct tcb *const tcp, const kernel_ulong_t arg) { tprints("...}"); return RVAL_DECODED | 1; } static void -print_sg_io_v4_res(struct tcb *const tcp, const kernel_ureg_t arg) +print_sg_io_v4_res(struct tcb *const tcp, const kernel_ulong_t arg) { } @@ -226,7 +226,7 @@ print_sg_io_v4_res(struct tcb *const tcp, const kernel_ureg_t arg) static int print_sg_io_req(struct tcb *const tcp, const uint32_t iid, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { tprintf("{'%c', ", iid); @@ -244,7 +244,7 @@ print_sg_io_req(struct tcb *const tcp, const uint32_t iid, static void print_sg_io_res(struct tcb *const tcp, const uint32_t iid, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { switch (iid) { case 'S': @@ -258,7 +258,7 @@ print_sg_io_res(struct tcb *const tcp, const uint32_t iid, int scsi_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { uint32_t iid; diff --git a/seccomp.c b/seccomp.c index 811b2710..f778a6c4 100644 --- a/seccomp.c +++ b/seccomp.c @@ -172,7 +172,7 @@ print_bpf_filter(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) } void -print_seccomp_fprog(struct tcb *const tcp, const kernel_ureg_t addr, +print_seccomp_fprog(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned short len) { if (abbrev(tcp)) { @@ -189,7 +189,7 @@ print_seccomp_fprog(struct tcb *const tcp, const kernel_ureg_t addr, #include "seccomp_fprog.h" void -print_seccomp_filter(struct tcb *const tcp, const kernel_ureg_t addr) +print_seccomp_filter(struct tcb *const tcp, const kernel_ulong_t addr) { struct seccomp_fprog fprog; @@ -202,7 +202,7 @@ print_seccomp_filter(struct tcb *const tcp, const kernel_ureg_t addr) static void decode_seccomp_set_mode_strict(const unsigned int flags, - const kernel_ureg_t addr) + const kernel_ulong_t addr) { tprintf("%u, ", flags); printaddr(addr); diff --git a/sigaltstack.c b/sigaltstack.c index bc60aef5..03a40099 100644 --- a/sigaltstack.c +++ b/sigaltstack.c @@ -41,7 +41,7 @@ #include "xlat/sigaltstack_flags.h" static void -print_stack_t(struct tcb *const tcp, const kernel_ureg_t addr) +print_stack_t(struct tcb *const tcp, const kernel_ulong_t addr) { stack_t ss; @@ -52,7 +52,7 @@ print_stack_t(struct tcb *const tcp, const kernel_ureg_t addr) printaddr(ptr_to_kulong(ss.ss_sp)); tprints(", ss_flags="); printflags(sigaltstack_flags, ss.ss_flags, "SS_???"); - tprintf(", ss_size=%" PRI_kru "}", (kernel_ureg_t) ss.ss_size); + tprintf(", ss_size=%" PRI_kru "}", (kernel_ulong_t) ss.ss_size); } SYS_FUNC(sigaltstack) diff --git a/signal.c b/signal.c index c40466fe..ee96b629 100644 --- a/signal.c +++ b/signal.c @@ -115,13 +115,13 @@ */ static const char * -get_sa_handler_str(kernel_ureg_t handler) +get_sa_handler_str(kernel_ulong_t handler) { return xlookup(sa_handler_values, handler); } static void -print_sa_handler(kernel_ureg_t handler) +print_sa_handler(kernel_ulong_t handler) { const char *sa_handler_str = get_sa_handler_str(handler); @@ -242,8 +242,8 @@ printsignal(int nr) } static void -print_sigset_addr_len_limit(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t len, const unsigned int min_len) +print_sigset_addr_len_limit(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len, const unsigned int min_len) { /* * Here len is usually equal to NSIG / 8 or current_wordsize. @@ -260,8 +260,8 @@ print_sigset_addr_len_limit(struct tcb *const tcp, const kernel_ureg_t addr, } void -print_sigset_addr_len(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t len) +print_sigset_addr_len(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len) { print_sigset_addr_len_limit(tcp, addr, len, current_wordsize); } @@ -306,7 +306,7 @@ struct old_sigaction32 { }; static void -decode_old_sigaction(struct tcb *const tcp, const kernel_ureg_t addr) +decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) { struct old_sigaction sa; @@ -497,7 +497,7 @@ struct new_sigaction32 }; static void -decode_new_sigaction(struct tcb *const tcp, const kernel_ureg_t addr) +decode_new_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) { struct new_sigaction sa; @@ -598,7 +598,7 @@ SYS_FUNC(rt_sigsuspend) static void print_sigqueueinfo(struct tcb *const tcp, const int sig, - const kernel_ureg_t addr) + const kernel_ulong_t addr) { printsignal(sig); tprints(", "); diff --git a/sock.c b/sock.c index 1af98941..48f843fa 100644 --- a/sock.c +++ b/sock.c @@ -51,7 +51,7 @@ print_ifname(const char *ifname) static void print_ifreq(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg, const struct ifreq *const ifr) + const kernel_ulong_t arg, const struct ifreq *const ifr) { switch (code) { case SIOCSIFADDR: @@ -132,7 +132,7 @@ print_ifc_len(int len) } static int -decode_ifconf(struct tcb *const tcp, const kernel_ureg_t addr) +decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr) { struct ifconf ifc; @@ -195,7 +195,7 @@ decode_ifconf(struct tcb *const tcp, const kernel_ureg_t addr) } int -sock_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ureg_t arg) +sock_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) { struct ifreq ifr; diff --git a/sockaddr.c b/sockaddr.c index 104049a2..174108ca 100644 --- a/sockaddr.c +++ b/sockaddr.c @@ -279,7 +279,7 @@ print_sockaddr(struct tcb *tcp, const void *const buf, const int addrlen) } int -decode_sockaddr(struct tcb *const tcp, const kernel_ureg_t addr, int addrlen) +decode_sockaddr(struct tcb *const tcp, const kernel_ulong_t addr, int addrlen) { if (addrlen < 2) { printaddr(addr); diff --git a/stat.c b/stat.c index 718ac5d1..28bd15ef 100644 --- a/stat.c +++ b/stat.c @@ -29,7 +29,7 @@ #include "stat.h" static void -decode_struct_stat(struct tcb *const tcp, const kernel_ureg_t addr) +decode_struct_stat(struct tcb *const tcp, const kernel_ulong_t addr) { struct strace_stat st; diff --git a/stat64.c b/stat64.c index 16d33c6d..09d203dc 100644 --- a/stat64.c +++ b/stat64.c @@ -29,7 +29,7 @@ #include "stat.h" static void -decode_struct_stat64(struct tcb *const tcp, const kernel_ureg_t addr) +decode_struct_stat64(struct tcb *const tcp, const kernel_ulong_t addr) { struct strace_stat st; diff --git a/syscall.c b/syscall.c index d19777e8..6e41c461 100644 --- a/syscall.c +++ b/syscall.c @@ -361,7 +361,7 @@ decode_socket_subcall(struct tcb *tcp) if (call < 1 || call >= SYS_socket_nsubcalls) return; - const kernel_scno_t scno = SYS_socket_subcall + call; + const kernel_ulong_t scno = SYS_socket_subcall + call; const unsigned int nargs = sysent[scno].nargs; uint64_t buf[nargs]; @@ -507,8 +507,8 @@ dumpio(struct tcb *tcp) * Shuffle syscall numbers so that we don't have huge gaps in syscall table. * The shuffling should be an involution: shuffle_scno(shuffle_scno(n)) == n. */ -static kernel_scno_t -shuffle_scno(kernel_scno_t scno) +static kernel_ulong_t +shuffle_scno(kernel_ulong_t scno) { #if defined(ARM) || defined(AARCH64) /* So far only 32-bit ARM needs this */ if (scno < ARM_FIRST_SHUFFLED_SYSCALL) @@ -558,7 +558,7 @@ clear_regs(void) static int get_syscall_args(struct tcb *); static int get_syscall_result(struct tcb *); static int arch_get_scno(struct tcb *tcp); -static int arch_set_scno(struct tcb *, kernel_scno_t); +static int arch_set_scno(struct tcb *, kernel_ulong_t); static void get_error(struct tcb *, const bool); static int arch_set_error(struct tcb *); @@ -1048,7 +1048,7 @@ print_pc(struct tcb *tcp) #if defined ARCH_PC_REG # define ARCH_GET_PC 0 #elif defined ARCH_PC_PEEK_ADDR - kernel_ureg_t pc; + kernel_ulong_t pc; # define ARCH_PC_REG pc # define ARCH_GET_PC upeek(tcp->pid, ARCH_PC_PEEK_ADDR, &pc) #else @@ -1060,7 +1060,7 @@ print_pc(struct tcb *tcp) else tprintf(current_wordsize == 4 ? "[%08" PRI_krx "] " : "[%016" PRI_krx "] ", - (kernel_ureg_t) ARCH_PC_REG); + (kernel_ulong_t) ARCH_PC_REG); } #include "getregs_old.h" @@ -1190,7 +1190,7 @@ set_regs(pid_t pid) struct sysent_buf { struct tcb *tcp; struct_sysent ent; - char buf[sizeof("syscall_%lu") + sizeof(kernel_scno_t) * 3]; + char buf[sizeof("syscall_%lu") + sizeof(kernel_ulong_t) * 3]; }; static void @@ -1278,7 +1278,7 @@ get_syscall_result(struct tcb *tcp) #endif const char * -syscall_name(kernel_scno_t scno) +syscall_name(kernel_ulong_t scno) { #if defined X32_PERSONALITY_NUMBER && defined __X32_SYSCALL_BIT if (current_personality == X32_PERSONALITY_NUMBER) diff --git a/term.c b/term.c index 73f00d06..dcac3ccd 100644 --- a/term.c +++ b/term.c @@ -38,7 +38,7 @@ #include "xlat/modem_flags.h" static void -decode_termios(struct tcb *const tcp, const kernel_ureg_t addr) +decode_termios(struct tcb *const tcp, const kernel_ulong_t addr) { struct termios tios; int i; @@ -74,7 +74,7 @@ decode_termios(struct tcb *const tcp, const kernel_ureg_t addr) } static void -decode_termio(struct tcb *const tcp, const kernel_ureg_t addr) +decode_termio(struct tcb *const tcp, const kernel_ulong_t addr) { struct termio tio; int i; @@ -116,7 +116,7 @@ decode_termio(struct tcb *const tcp, const kernel_ureg_t addr) } static void -decode_winsize(struct tcb *const tcp, const kernel_ureg_t addr) +decode_winsize(struct tcb *const tcp, const kernel_ulong_t addr) { struct winsize ws; @@ -132,7 +132,7 @@ decode_winsize(struct tcb *const tcp, const kernel_ureg_t addr) #ifdef TIOCGSIZE static void -decode_ttysize(struct tcb *const tcp, const kernel_ureg_t addr) +decode_ttysize(struct tcb *const tcp, const kernel_ulong_t addr) { struct ttysize ts; @@ -148,7 +148,7 @@ decode_ttysize(struct tcb *const tcp, const kernel_ureg_t addr) #endif static void -decode_modem_flags(struct tcb *const tcp, const kernel_ureg_t addr) +decode_modem_flags(struct tcb *const tcp, const kernel_ulong_t addr) { int i; @@ -165,7 +165,7 @@ decode_modem_flags(struct tcb *const tcp, const kernel_ureg_t addr) int term_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { switch (code) { /* struct termios */ diff --git a/time.c b/time.c index c208c292..6c542f63 100644 --- a/time.c +++ b/time.c @@ -33,7 +33,7 @@ #include static void -print_timezone(struct tcb *const tcp, const kernel_ureg_t addr) +print_timezone(struct tcb *const tcp, const kernel_ulong_t addr) { struct timezone tz; @@ -167,11 +167,11 @@ SYS_FUNC(osf_setitimer) #include "xlat/adjtimex_state.h" static int -do_adjtimex(struct tcb *const tcp, const kernel_ureg_t addr) +do_adjtimex(struct tcb *const tcp, const kernel_ulong_t addr) { if (print_timex(tcp, addr)) return 0; - tcp->auxstr = xlookup(adjtimex_state, (kernel_ureg_t) tcp->u_rval); + tcp->auxstr = xlookup(adjtimex_state, (kernel_ulong_t) tcp->u_rval); if (tcp->auxstr) return RVAL_STR; return 0; diff --git a/ubi.c b/ubi.c index 4d46a3cd..b4706552 100644 --- a/ubi.c +++ b/ubi.c @@ -41,7 +41,7 @@ int ubi_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { if (!verbose(tcp)) return RVAL_DECODED; diff --git a/uid.c b/uid.c index 35048813..80d81ce4 100644 --- a/uid.c +++ b/uid.c @@ -89,7 +89,7 @@ SYS_FUNC(setuid) static void get_print_uid(struct tcb *const tcp, const char *const prefix, - const kernel_ureg_t addr) + const kernel_ulong_t addr) { uid_t uid; @@ -166,7 +166,7 @@ print_gid(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) static void print_groups(struct tcb *const tcp, const unsigned int len, - const kernel_ureg_t addr) + const kernel_ulong_t addr) { static unsigned long ngroups_max; if (!ngroups_max) diff --git a/upeek.c b/upeek.c index fbcbd380..01a12d35 100644 --- a/upeek.c +++ b/upeek.c @@ -35,7 +35,7 @@ #include "ptrace.h" int -upeek(int pid, unsigned long off, kernel_ureg_t *res) +upeek(int pid, unsigned long off, kernel_ulong_t *res) { long val; diff --git a/upoke.c b/upoke.c index 7a211467..dda0b8d7 100644 --- a/upoke.c +++ b/upoke.c @@ -29,7 +29,7 @@ #include "ptrace.h" int -upoke(int pid, unsigned long off, kernel_ureg_t val) +upoke(int pid, unsigned long off, kernel_ulong_t val) { if (ptrace(PTRACE_POKEUSER, pid, off, val)) { if (errno != ESRCH) diff --git a/userfaultfd.c b/userfaultfd.c index 4be01d14..aeeb3eab 100644 --- a/userfaultfd.c +++ b/userfaultfd.c @@ -56,7 +56,7 @@ tprintf_uffdio_range(const struct uffdio_range *range) int uffdio_ioctl(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { switch (code) { case UFFDIO_API: { diff --git a/util.c b/util.c index f1e552ed..249efee9 100644 --- a/util.c +++ b/util.c @@ -472,7 +472,7 @@ printaddr_klu(const kernel_ulong_t addr) #define DEF_PRINTNUM(name, type) \ bool \ -printnum_ ## name(struct tcb *const tcp, const kernel_ureg_t addr, \ +printnum_ ## name(struct tcb *const tcp, const kernel_ulong_t addr, \ const char *const fmt) \ { \ type num; \ @@ -486,7 +486,7 @@ printnum_ ## name(struct tcb *const tcp, const kernel_ureg_t addr, \ #define DEF_PRINTPAIR(name, type) \ bool \ -printpair_ ## name(struct tcb *const tcp, const kernel_ureg_t addr, \ +printpair_ ## name(struct tcb *const tcp, const kernel_ulong_t addr, \ const char *const fmt) \ { \ type pair[2]; \ @@ -508,7 +508,7 @@ DEF_PRINTPAIR(int64, uint64_t) #if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 bool -printnum_long_int(struct tcb *const tcp, const kernel_ureg_t addr, +printnum_long_int(struct tcb *const tcp, const kernel_ulong_t addr, const char *const fmt_long, const char *const fmt_int) { if (current_wordsize > sizeof(int)) { @@ -815,7 +815,7 @@ print_quoted_string(const char *str, unsigned int size, * If path length exceeds `n', append `...' to the output. */ void -printpathn(struct tcb *const tcp, const kernel_ureg_t addr, unsigned int n) +printpathn(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int n) { char path[PATH_MAX + 1]; int nul_seen; @@ -842,7 +842,7 @@ printpathn(struct tcb *const tcp, const kernel_ureg_t addr, unsigned int n) } void -printpath(struct tcb *const tcp, const kernel_ureg_t addr) +printpath(struct tcb *const tcp, const kernel_ulong_t addr) { /* Size must correspond to char path[] size in printpathn */ printpathn(tcp, addr, PATH_MAX); @@ -857,8 +857,8 @@ printpath(struct tcb *const tcp, const kernel_ureg_t addr) * or QUOTE_0_TERMINATED bit is set and the string length exceeds `len'. */ void -printstr_ex(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t len, const unsigned int user_style) +printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len, const unsigned int user_style) { static char *str = NULL; static char *outstr; @@ -915,8 +915,8 @@ printstr_ex(struct tcb *const tcp, const kernel_ureg_t addr, } void -dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ureg_t addr, - kernel_ureg_t data_size) +dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ulong_t addr, + kernel_ulong_t data_size) { #if SUPPORTED_PERSONALITIES > 1 union { @@ -948,7 +948,7 @@ dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ureg_t addr, } if (umoven(tcp, addr, size, iov) >= 0) { for (i = 0; i < len; i++) { - kernel_ureg_t iov_len = iov_iov_len(i); + kernel_ulong_t iov_len = iov_iov_len(i); if (iov_len > data_size) iov_len = data_size; if (!iov_len) @@ -968,7 +968,7 @@ dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ureg_t addr, } void -dumpstr(struct tcb *const tcp, const kernel_ureg_t addr, const int len) +dumpstr(struct tcb *const tcp, const kernel_ulong_t addr, const int len) { static int strsize = -1; static unsigned char *str; @@ -1080,11 +1080,11 @@ static bool process_vm_readv_not_supported = 1; static ssize_t vm_read_mem(const pid_t pid, void *const laddr, - const kernel_ureg_t raddr, const size_t len) + const kernel_ulong_t raddr, const size_t len) { const unsigned long truncated_raddr = raddr; - if (raddr != (kernel_ureg_t) truncated_raddr) { + if (raddr != (kernel_ulong_t) truncated_raddr) { errno = EIO; return -1; } @@ -1106,7 +1106,7 @@ vm_read_mem(const pid_t pid, void *const laddr, * at address `addr' to our space at `our_addr' */ int -umoven(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len, +umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, void *const our_addr) { char *laddr = our_addr; @@ -1214,7 +1214,7 @@ umoven(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len, } int -umoven_or_printaddr(struct tcb *const tcp, const kernel_ureg_t addr, +umoven_or_printaddr(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned int len, void *const our_addr) { if (!addr || !verbose(tcp) || (exiting(tcp) && syserror(tcp)) || @@ -1227,7 +1227,7 @@ umoven_or_printaddr(struct tcb *const tcp, const kernel_ureg_t addr, int umoven_or_printaddr_ignore_syserror(struct tcb *const tcp, - const kernel_ureg_t addr, + const kernel_ulong_t addr, const unsigned int len, void *const our_addr) { @@ -1251,7 +1251,7 @@ umoven_or_printaddr_ignore_syserror(struct tcb *const tcp, * we never write past laddr[len-1]). */ int -umovestr(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len, char *laddr) +umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *laddr) { const unsigned long x01010101 = (unsigned long) 0x0101010101010101ULL; const unsigned long x80808080 = (unsigned long) 0x8080808080808080ULL; @@ -1429,12 +1429,12 @@ umovestr(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len, char *ladd */ bool print_array(struct tcb *const tcp, - const kernel_ureg_t start_addr, + const kernel_ulong_t start_addr, const size_t nmemb, void *const elem_buf, const size_t elem_size, int (*const umoven_func)(struct tcb *, - kernel_ureg_t, + kernel_ulong_t, unsigned int, void *), bool (*const print_func)(struct tcb *, @@ -1454,17 +1454,17 @@ print_array(struct tcb *const tcp, } const size_t size = nmemb * elem_size; - const kernel_ureg_t end_addr = start_addr + size; + const kernel_ulong_t end_addr = start_addr + size; if (end_addr <= start_addr || size / elem_size != nmemb) { printaddr(start_addr); return false; } - const kernel_ureg_t abbrev_end = + const kernel_ulong_t abbrev_end = (abbrev(tcp) && max_strlen < nmemb) ? start_addr + elem_size * max_strlen : end_addr; - kernel_ureg_t cur; + kernel_ulong_t cur; for (cur = start_addr; cur < end_addr; cur += elem_size) { if (cur != start_addr) diff --git a/v4l2.c b/v4l2.c index 628ac3ad..637e8788 100644 --- a/v4l2.c +++ b/v4l2.c @@ -133,7 +133,7 @@ print_pixelformat(uint32_t fourcc) #include "xlat/v4l2_device_capabilities_flags.h" static int -print_v4l2_capability(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg) { struct v4l2_capability caps; @@ -170,7 +170,7 @@ print_v4l2_capability(struct tcb *const tcp, const kernel_ureg_t arg) #include "xlat/v4l2_format_description_flags.h" static int -print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg) { struct v4l2_fmtdesc f; @@ -283,7 +283,7 @@ print_v4l2_format_fmt(const char *prefix, const struct_v4l2_format *f) } static int -print_v4l2_format(struct tcb *const tcp, const kernel_ureg_t arg, +print_v4l2_format(struct tcb *const tcp, const kernel_ulong_t arg, const bool is_get) { struct_v4l2_format f; @@ -310,7 +310,7 @@ print_v4l2_format(struct tcb *const tcp, const kernel_ureg_t arg, #include "xlat/v4l2_memories.h" static int -print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ulong_t arg) { struct v4l2_requestbuffers reqbufs; @@ -339,7 +339,7 @@ print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ureg_t arg) static int print_v4l2_buffer(struct tcb *const tcp, const unsigned int code, - const kernel_ureg_t arg) + const kernel_ulong_t arg) { struct_v4l2_buffer b; @@ -380,7 +380,7 @@ print_v4l2_buffer(struct tcb *const tcp, const unsigned int code, } static int -print_v4l2_framebuffer(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_framebuffer(struct tcb *const tcp, const kernel_ulong_t arg) { struct_v4l2_framebuffer b; @@ -396,7 +396,7 @@ print_v4l2_framebuffer(struct tcb *const tcp, const kernel_ureg_t arg) } static int -print_v4l2_buf_type(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_buf_type(struct tcb *const tcp, const kernel_ulong_t arg) { int type; @@ -413,7 +413,7 @@ print_v4l2_buf_type(struct tcb *const tcp, const kernel_ureg_t arg) #include "xlat/v4l2_capture_modes.h" static int -print_v4l2_streamparm(struct tcb *const tcp, const kernel_ureg_t arg, +print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg, const bool is_get) { struct v4l2_streamparm s; @@ -478,7 +478,7 @@ print_v4l2_streamparm(struct tcb *const tcp, const kernel_ureg_t arg, } static int -print_v4l2_standard(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_standard(struct tcb *const tcp, const kernel_ulong_t arg) { struct_v4l2_standard s; @@ -505,7 +505,7 @@ print_v4l2_standard(struct tcb *const tcp, const kernel_ureg_t arg) #include "xlat/v4l2_input_types.h" static int -print_v4l2_input(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_input(struct tcb *const tcp, const kernel_ulong_t arg) { struct_v4l2_input i; @@ -532,7 +532,7 @@ print_v4l2_input(struct tcb *const tcp, const kernel_ureg_t arg) #include "xlat/v4l2_control_ids.h" static int -print_v4l2_control(struct tcb *const tcp, const kernel_ureg_t arg, +print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg, const bool is_get) { struct v4l2_control c; @@ -561,7 +561,7 @@ print_v4l2_control(struct tcb *const tcp, const kernel_ureg_t arg, #include "xlat/v4l2_control_flags.h" static int -print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg) { struct v4l2_queryctrl c; @@ -608,7 +608,7 @@ print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ureg_t arg) } static int -print_v4l2_cropcap(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_cropcap(struct tcb *const tcp, const kernel_ulong_t arg) { struct v4l2_cropcap c; @@ -633,7 +633,7 @@ print_v4l2_cropcap(struct tcb *const tcp, const kernel_ureg_t arg) } static int -print_v4l2_crop(struct tcb *const tcp, const kernel_ureg_t arg, +print_v4l2_crop(struct tcb *const tcp, const kernel_ulong_t arg, const bool is_get) { struct v4l2_crop c; @@ -680,7 +680,7 @@ print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void * #include "xlat/v4l2_control_classes.h" static int -print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ureg_t arg, +print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg, const bool is_get) { struct_v4l2_ext_controls c; @@ -730,7 +730,7 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ureg_t arg, # include "xlat/v4l2_framesize_types.h" static int -print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg) { struct v4l2_frmsizeenum s; @@ -770,7 +770,7 @@ print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ureg_t arg) # include "xlat/v4l2_frameinterval_types.h" static int -print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg) { struct v4l2_frmivalenum f; @@ -809,7 +809,7 @@ print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ureg_t arg) #ifdef VIDIOC_CREATE_BUFS static int -print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ureg_t arg) +print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ulong_t arg) { struct_v4l2_create_buffers b; @@ -840,7 +840,7 @@ print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ureg_t arg) #endif /* VIDIOC_CREATE_BUFS */ MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp, - const unsigned int code, const kernel_ureg_t arg) + const unsigned int code, const kernel_ulong_t arg) { if (!verbose(tcp)) return RVAL_DECODED; diff --git a/wait.c b/wait.c index 401cae2a..58dba8e4 100644 --- a/wait.c +++ b/wait.c @@ -118,7 +118,7 @@ printstatus(int status) static int printwaitn(struct tcb *const tcp, - void (*const print_rusage)(struct tcb *, kernel_ureg_t)) + void (*const print_rusage)(struct tcb *, kernel_ulong_t)) { if (entering(tcp)) { /* On Linux, kernel-side pid_t is typedef'ed to int diff --git a/xattr.c b/xattr.c index f6f9d6de..32b7ded8 100644 --- a/xattr.c +++ b/xattr.c @@ -41,9 +41,9 @@ static void print_xattr_val(struct tcb *const tcp, - const kernel_ureg_t addr, - const kernel_ureg_t insize, - const kernel_ureg_t size) + const kernel_ulong_t addr, + const kernel_ulong_t insize, + const kernel_ulong_t size) { tprints(", "); @@ -101,8 +101,8 @@ SYS_FUNC(fgetxattr) } static void -print_xattr_list(struct tcb *const tcp, const kernel_ureg_t addr, - const kernel_ureg_t size) +print_xattr_list(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t size) { if (!size || syserror(tcp)) { printaddr(addr);