Make CUSE usable with platforms where the size of "unsigned long" is

different from the size of a pointer.
This commit is contained in:
Hans Petter Selasky 2015-12-22 09:55:44 +00:00
parent 9fb69c9d9d
commit beebd9aac8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292594
3 changed files with 10 additions and 10 deletions

View file

@ -711,8 +711,8 @@ cuse_copy_out(const void *src, void *user_dst, int len)
if (pe->is_local) {
memcpy(user_dst, src, len);
} else {
info.local_ptr = (unsigned long)src;
info.peer_ptr = (unsigned long)user_dst;
info.local_ptr = (uintptr_t)src;
info.peer_ptr = (uintptr_t)user_dst;
info.length = len;
error = ioctl(f_cuse, CUSE_IOCTL_WRITE_DATA, &info);
@ -744,8 +744,8 @@ cuse_copy_in(const void *user_src, void *dst, int len)
if (pe->is_local) {
memcpy(dst, user_src, len);
} else {
info.local_ptr = (unsigned long)dst;
info.peer_ptr = (unsigned long)user_src;
info.local_ptr = (uintptr_t)dst;
info.peer_ptr = (uintptr_t)user_src;
info.length = len;
error = ioctl(f_cuse, CUSE_IOCTL_READ_DATA, &info);

View file

@ -511,7 +511,7 @@ cuse_client_is_closing(struct cuse_client *pcc)
static void
cuse_client_send_command_locked(struct cuse_client_command *pccmd,
unsigned long data_ptr, unsigned long arg, int fflags, int ioflag)
uintptr_t data_ptr, unsigned long arg, int fflags, int ioflag)
{
unsigned long cuse_fflags = 0;
struct cuse_server *pcs;
@ -1547,7 +1547,7 @@ cuse_client_read(struct cdev *dev, struct uio *uio, int ioflag)
cuse_lock();
cuse_client_send_command_locked(pccmd,
(unsigned long)uio->uio_iov->iov_base,
(uintptr_t)uio->uio_iov->iov_base,
(unsigned long)(unsigned int)len, pcc->fflags, ioflag);
error = cuse_client_receive_command_locked(pccmd, 0, 0);
@ -1607,7 +1607,7 @@ cuse_client_write(struct cdev *dev, struct uio *uio, int ioflag)
cuse_lock();
cuse_client_send_command_locked(pccmd,
(unsigned long)uio->uio_iov->iov_base,
(uintptr_t)uio->uio_iov->iov_base,
(unsigned long)(unsigned int)len, pcc->fflags, ioflag);
error = cuse_client_receive_command_locked(pccmd, 0, 0);

View file

@ -40,8 +40,8 @@
struct cuse_dev;
struct cuse_data_chunk {
unsigned long local_ptr;
unsigned long peer_ptr;
uintptr_t local_ptr;
uintptr_t peer_ptr;
unsigned long length;
};
@ -54,7 +54,7 @@ struct cuse_command {
struct cuse_dev *dev;
unsigned long fflags;
uintptr_t per_file_handle;
unsigned long data_pointer;
uintptr_t data_pointer;
unsigned long argument;
unsigned long command; /* see CUSE_CMD_XXX */
};