Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
legacy-vme64x-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
legacy-vme64x-core
Commits
b5b30d82
Commit
b5b30d82
authored
Mar 17, 2022
by
A. Hahn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vme_dma: enable kernel 4+ support
parent
78396fe9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
vme_dma.c
drv/driver/vme_dma.c
+13
-2
No files found.
drv/driver/vme_dma.c
View file @
b5b30d82
...
...
@@ -73,8 +73,12 @@ static int sgl_fill_user_pages(struct page **pages, unsigned long uaddr,
/* Get user pages for the DMA transfer */
down_read
(
&
current
->
mm
->
mmap_sem
);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
ret
=
get_user_pages
(
current
,
current
->
mm
,
uaddr
,
nr_pages
,
rw
,
0
,
pages
,
NULL
);
pages
,
NULL
);
#else
ret
=
get_user_pages
(
uaddr
,
nr_pages
,
FOLL_WRITE
,
pages
,
NULL
);
#endif
up_read
(
&
current
->
mm
->
mmap_sem
);
return
ret
;
...
...
@@ -131,7 +135,11 @@ static int sgl_map_user_pages(struct scatterlist *sgl,
if
(
rc
>=
0
&&
rc
<
nr_pages
)
{
/* Some pages were pinned, release these */
for
(
i
=
0
;
i
<
rc
;
i
++
)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
page_cache_release
(
pages
[
i
]);
#else
put_page
(
pages
[
i
]);
#endif
rc
=
-
ENOMEM
;
goto
out_free
;
}
...
...
@@ -192,8 +200,11 @@ static void sgl_unmap_user_pages(struct scatterlist *sgl,
if
(
dirty
&&
!
PageReserved
(
page
))
SetPageDirty
(
page
);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
page_cache_release
(
page
);
#else
put_page
(
page
);
#endif
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment