ipc_*: change address argument type from long to kernel_ureg_t

* ipc_msg.c (tprint_msgsnd, tprint_msgrcv, fetch_msgrcv_args): Change
address argument type from long to kernel_ureg_t.
* ipc_msgctl.c (print_msqid_ds): Likewise.
* ipc_sem.c (tprint_sembuf_array): Likewise.
* ipc_shmctl.c (print_shmid_ds): Likewise.
This commit is contained in:
Дмитрий Левин 2016-12-23 01:05:06 +00:00
parent fdcaa2fa42
commit 91b63a91ae
4 changed files with 12 additions and 10 deletions

View File

@ -57,8 +57,8 @@ SYS_FUNC(msgget)
} }
static void static void
tprint_msgsnd(struct tcb *tcp, const long addr, const unsigned long count, tprint_msgsnd(struct tcb *const tcp, const kernel_ureg_t addr,
const unsigned long flags) const unsigned long count, const unsigned long flags)
{ {
tprint_msgbuf(tcp, addr, count); tprint_msgbuf(tcp, addr, count);
printflags(ipc_msg_flags, flags, "MSG_???"); printflags(ipc_msg_flags, flags, "MSG_???");
@ -78,15 +78,16 @@ SYS_FUNC(msgsnd)
} }
static void static void
tprint_msgrcv(struct tcb *tcp, const long addr, const unsigned long count, tprint_msgrcv(struct tcb *const tcp, const kernel_ureg_t addr,
const long msgtyp) const unsigned long count, const unsigned long msgtyp)
{ {
tprint_msgbuf(tcp, addr, count); tprint_msgbuf(tcp, addr, count);
tprintf("%ld, ", msgtyp); tprintf("%ld, ", msgtyp);
} }
static int static int
fetch_msgrcv_args(struct tcb *tcp, const long addr, unsigned long *pair) fetch_msgrcv_args(struct tcb *const tcp, const kernel_ureg_t addr,
unsigned long *const pair)
{ {
if (current_wordsize == sizeof(*pair)) { if (current_wordsize == sizeof(*pair)) {
if (umoven_or_printaddr(tcp, addr, 2 * sizeof(*pair), pair)) if (umoven_or_printaddr(tcp, addr, 2 * sizeof(*pair), pair))

View File

@ -51,7 +51,7 @@ typedef struct msqid64_ds msqid_ds_t;
#include "xlat/msgctl_flags.h" #include "xlat/msgctl_flags.h"
static void static void
print_msqid_ds(struct tcb *tcp, const long addr, int cmd) print_msqid_ds(struct tcb *const tcp, const kernel_ureg_t addr, int cmd)
{ {
/* TODO: We don't properly decode old compat ipc calls. */ /* TODO: We don't properly decode old compat ipc calls. */
if (cmd & IPC_64) if (cmd & IPC_64)
@ -101,7 +101,7 @@ SYS_FUNC(msgctl)
PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???"); PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???");
tprints(", "); tprints(", ");
} else { } else {
const long addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]; const kernel_ureg_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2];
print_msqid_ds(tcp, addr, tcp->u_arg[1]); print_msqid_ds(tcp, addr, tcp->u_arg[1]);
} }
return 0; return 0;

View File

@ -57,7 +57,8 @@ print_sembuf(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
#endif #endif
static void static void
tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned int count) tprint_sembuf_array(struct tcb *const tcp, const kernel_ureg_t addr,
const unsigned int count)
{ {
#if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H #if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H
struct sembuf sb; struct sembuf sb;

View File

@ -51,7 +51,7 @@ typedef struct shmid64_ds shmid_ds_t;
#include "xlat/shmctl_flags.h" #include "xlat/shmctl_flags.h"
static void static void
print_shmid_ds(struct tcb *tcp, const long addr, int cmd) print_shmid_ds(struct tcb *const tcp, const kernel_ureg_t addr, int cmd)
{ {
/* TODO: We don't properly decode old compat ipc calls. */ /* TODO: We don't properly decode old compat ipc calls. */
if (cmd & IPC_64) if (cmd & IPC_64)
@ -101,7 +101,7 @@ SYS_FUNC(shmctl)
PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???"); PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???");
tprints(", "); tprints(", ");
} else { } else {
const long addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2]; const kernel_ureg_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2];
print_shmid_ds(tcp, addr, tcp->u_arg[1]); print_shmid_ds(tcp, addr, tcp->u_arg[1]);
} }
return 0; return 0;