Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed build for Linux 6.5 kernel #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion XDMA/linux-kernel/xdma/cdev_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ int bridge_mmap(struct file *file, struct vm_area_struct *vma)
* prevent touching the pages (byte access) for swap-in,
* and prevent the pages from being swapped out
*/
vma->vm_flags |= VMEM_FLAGS;
vm_flags_set(vma, VMEM_FLAGS);

//vma->vm_flags |= VMEM_FLAGS;

/* make MMIO accessible to user space */
rv = io_remap_pfn_range(vma, vma->vm_start, phys >> PAGE_SHIFT,
vsize, vma->vm_page_prot);
Expand Down
15 changes: 14 additions & 1 deletion XDMA/linux-kernel/xdma/cdev_sgdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ static ssize_t cdev_aio_read(struct kiocb *iocb, const struct iovec *io,
return -EIOCBQUEUED;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) && LINUX_VERSION_CODE <= KERNEL_VERSION(6, 4, 0)
static ssize_t cdev_write_iter(struct kiocb *iocb, struct iov_iter *io)
{
return cdev_aio_write(iocb, io->iov, io->nr_segs, io->iov_offset);
Expand All @@ -575,6 +575,19 @@ static ssize_t cdev_read_iter(struct kiocb *iocb, struct iov_iter *io)
}
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
static ssize_t cdev_write_iter(struct kiocb *iocb, struct iov_iter *io)
{
return cdev_aio_write(iocb, io->__iov, io->nr_segs, io->iov_offset);
}

static ssize_t cdev_read_iter(struct kiocb *iocb, struct iov_iter *io)
{
return cdev_aio_read(iocb, io->__iov, io->nr_segs, io->iov_offset);
}
#endif


static int ioctl_do_perf_start(struct xdma_engine *engine, unsigned long arg)
{
int rv;
Expand Down
2 changes: 1 addition & 1 deletion XDMA/linux-kernel/xdma/xdma_cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ int xpdev_create_interfaces(struct xdma_pci_dev *xpdev)

int xdma_cdev_init(void)
{
g_xdma_class = class_create(THIS_MODULE, XDMA_NODE_NAME);
g_xdma_class = class_create(XDMA_NODE_NAME);
if (IS_ERR(g_xdma_class)) {
dbg_init(XDMA_NODE_NAME ": failed to create class");
return -EINVAL;
Expand Down