Re: rtcansend 32-bit

2021-11-05 Thread C Smith via Xenomai
Please review and accept this patch, which allows 32 bit apps to send and receive CAN. It is tested successfully with 32bit and 64bit compiles of utils/can/rtcansend.c / and rtcanrecv.c. The compat interface is now implemented, rtdm_get_iovec() is used and the get_sockaddr() methodology from the xd

Re: rtcansend 32-bit

2021-11-05 Thread Jan Kiszka via Xenomai
On 05.11.21 08:09, C Smith wrote: > Please review and accept this patch, which allows 32 bit apps to send > and receive CAN. It is tested successfully with 32bit and 64bit compiles > of utils/can/rtcansend.c / and rtcanrecv.c. The compat interface is now > implemented, rtdm_get_iovec() is used and

Re: rtcansend 32-bit

2021-11-05 Thread Bezdeka, Florian via Xenomai
On Fri, 2021-11-05 at 09:14 +0100, Jan Kiszka wrote: > On 05.11.21 08:09, C Smith wrote: > > Please review and accept this patch, which allows 32 bit apps to send > > and receive CAN. It is tested successfully with 32bit and 64bit compiles > > of utils/can/rtcansend.c / and rtcanrecv.c. The compat

ABI Mismatch

2021-11-05 Thread Lorenzo Battini via Xenomai
Hello support team! I am writing to you because i have a problem with the Xenomai library and my patched kernel. I patched and compiled the Linux 5.4.151 kernel using IPIPE and i built the Xenomai 3.1.1 library. Running the installed kernel and trying to use the library launching: "sudo //bin/l

Re: ABI Mismatch

2021-11-05 Thread Jan Kiszka via Xenomai
On 05.11.21 13:48, Lorenzo Battini via Xenomai wrote: > Hello support team! > > I am writing to you because i have a problem with > the Xenomai library and my patched kernel. > > I patched and compiled the Linux 5.4.151 kernel using > IPIPE and i built the Xenomai 3.1.1 library. > > Running the

Minor dovetail x86 oddity

2021-11-05 Thread Jan Kiszka via Xenomai
Hi Philippe, in this code (arch/x86/kernel/apic/vector.c) #ifdef CONFIG_SMP static struct irq_desc *__setup_vector_irq(int vector) { int isairq = vector - ISA_IRQ_VECTOR(0); /* Copy the cleanup vector if irqs are pipelined. */ if (IS_ENABLED(CONFIG_SMP) &&

Re: rtcansend 32-bit

2021-11-05 Thread C Smith via Xenomai
dm_setsockopt_args setopt_buf; > > > > > > @@ -532,7 +559,7 @@ ssize_t rtcan_raw_recvmsg(struct rtdm_fd *fd, > > > struct rtcan_socket *sock = rtdm_fd_to_private(fd); > > > struct sockaddr_can scan; > > > nanosecs_rel_t timeout; > > > -struct iovec *iov = (struct iovec *)msg->msg_iov; > > > + struct iovec iov_fast[RTDM_IOV_FASTMAX], *iov; > > > struct iovec iov_buf; > > > can_frame_t frame; > > > nanosecs_abs_t timestamp = 0; > > > @@ -584,6 +611,10 @@ ssize_t rtcan_raw_recvmsg(struct rtdm_fd *fd, > > > iov = &iov_buf; > > > } > > > > > > + ret = rtdm_get_iovec(fd, &iov, msg, iov_fast); > > > + if (ret) > > > + return ret; > > > + > > > /* Check size of buffer */ > > > if (iov->iov_len < sizeof(can_frame_t)) > > > return -EMSGSIZE; > > > @@ -768,7 +799,7 @@ ssize_t rtcan_raw_sendmsg(struct rtdm_fd *fd, > > > struct rtcan_socket *sock = rtdm_fd_to_private(fd); > > > struct sockaddr_can *scan = (struct sockaddr_can *)msg->msg_name; > > > struct sockaddr_can scan_buf; > > > -struct iovec *iov = (struct iovec *)msg->msg_iov; > > > + struct iovec iov_fast[RTDM_IOV_FASTMAX], *iov; > > > struct iovec iov_buf; > > > can_frame_t *frame; > > > can_frame_t frame_buf; > > > @@ -841,8 +872,12 @@ ssize_t rtcan_raw_sendmsg(struct rtdm_fd *fd, > > > iov = &iov_buf; > > > } > > > > > > + ret = rtdm_get_iovec(fd, &iov, msg, iov_fast); > > > + if (ret) > > > + return ret; > > > + > > > /* Check size of buffer */ > > > -if (iov->iov_len != sizeof(can_frame_t)) > > > +if (iov->iov_len != sizeof(can_frame_t)) > > > return -EMSGSIZE; > > > > > > frame = (can_frame_t *)iov->iov_base; > > > -- > > > 2.1.0 > > > > Thanks, > > Jan > > > -- next part -- A non-text attachment was scrubbed... Name: rtcan.patch.gz Type: application/gzip Size: 1730 bytes Desc: not available URL: <http://xenomai.org/pipermail/xenomai/attachments/20211105/f172ba0f/attachment.bin>

Re: rtcansend 32-bit

2021-11-05 Thread Jan Kiszka via Xenomai
On 05.11.21 19:14, C Smith wrote: > Here's an updated patch addressing mentioned issues. > I've noticed ipc/internal.h re-defines COMPAT_CASE(__op) as well. > > I don't know what gmail is doing to the inline text (this should be > plain text) so I've also attached a .gz version of the patch. > P

[PATCH 1/1] drivers/can: 32-bit userspace app support for rtcan

2021-11-05 Thread C Smith via Xenomai
Signed-off-by: C Smith --- kernel/drivers/can/rtcan_internal.h | 1 + kernel/drivers/can/rtcan_raw.c | 102 +++- 2 files changed, 67 insertions(+), 36 deletions(-) diff --git a/kernel/drivers/can/rtcan_internal.h b/kernel/drivers/can/rtcan_internal.h index