Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
Mock Turtle
Commits
82c65897
Commit
82c65897
authored
Oct 14, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: make it build above Linux 5.0
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
10258176
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
mockturtle-core.c
software/kernel/mockturtle-core.c
+6
-1
mockturtle-hmq.c
software/kernel/mockturtle-hmq.c
+6
-1
No files found.
software/kernel/mockturtle-core.c
View file @
82c65897
...
...
@@ -26,6 +26,8 @@
#include <linux/tty.h>
#include <linux/platform_device.h>
#include <linux/mod_devicetable.h>
#include <linux/uaccess.h>
#include <linux/version.h>
#include <mockturtle/hw/mockturtle_cpu_csr.h>
#include <mockturtle/hw/mockturtle_queue.h>
...
...
@@ -254,11 +256,14 @@ static long trtl_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
if
(
_IOC_TYPE
(
cmd
)
!=
TRTL_IOCTL_MAGIC
)
return
-
ENOTTY
;
/* Validate user pointer */
#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE
err
=
!
access_ok
(
uarg
,
_IOC_SIZE
(
cmd
));
#else
if
(
_IOC_DIR
(
cmd
)
&
_IOC_READ
)
err
=
!
access_ok
(
VERIFY_WRITE
,
uarg
,
_IOC_SIZE
(
cmd
));
if
(
_IOC_DIR
(
cmd
)
&
_IOC_WRITE
)
err
=
!
access_ok
(
VERIFY_READ
,
uarg
,
_IOC_SIZE
(
cmd
));
#endif
if
(
err
)
return
-
EFAULT
;
...
...
software/kernel/mockturtle-hmq.c
View file @
82c65897
...
...
@@ -16,6 +16,8 @@
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/circ_buf.h>
#include <linux/uaccess.h>
#include <linux/version.h>
#include <mockturtle/hw/mockturtle_queue.h>
#include <mockturtle/hw/mockturtle_cpu_csr.h>
...
...
@@ -723,11 +725,14 @@ static long trtl_hmq_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
if
(
_IOC_TYPE
(
cmd
)
!=
TRTL_IOCTL_MAGIC
)
return
-
ENOTTY
;
/* Validate user pointer */
#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE
err
=
!
access_ok
(
uarg
,
_IOC_SIZE
(
cmd
));
#else
if
(
_IOC_DIR
(
cmd
)
&
_IOC_READ
)
err
=
!
access_ok
(
VERIFY_WRITE
,
uarg
,
_IOC_SIZE
(
cmd
));
if
(
_IOC_DIR
(
cmd
)
&
_IOC_WRITE
)
err
=
!
access_ok
(
VERIFY_READ
,
uarg
,
_IOC_SIZE
(
cmd
));
#endif
if
(
err
)
return
-
EFAULT
;
...
...
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