Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dma_ip_drivers
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
dma_ip_drivers
Commits
a1d510f4
Unverified
Commit
a1d510f4
authored
Oct 07, 2020
by
Karen Xie
Committed by
GitHub
Oct 07, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #79 from sasfermat/pr/fix-rhel-builds
XDMA: fix build for Centos and RHEL
parents
b3e6af5e
514986c5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
15 deletions
+38
-15
XDMA/linux-kernel/libxdma/libxdma.c
XDMA/linux-kernel/libxdma/libxdma.c
+8
-8
XDMA/linux-kernel/libxdma/libxdma.h
XDMA/linux-kernel/libxdma/libxdma.h
+27
-4
XDMA/linux-kernel/xdma/cdev_ctrl.c
XDMA/linux-kernel/xdma/cdev_ctrl.c
+1
-1
XDMA/linux-kernel/xdma/cdev_sgdma.c
XDMA/linux-kernel/xdma/cdev_sgdma.c
+1
-1
XDMA/linux-kernel/xdma/cdev_xvc.c
XDMA/linux-kernel/xdma/cdev_xvc.c
+1
-1
No files found.
XDMA/linux-kernel/libxdma/libxdma.c
View file @
a1d510f4
...
...
@@ -56,7 +56,7 @@ MODULE_PARM_DESC(desc_blen_max,
#define XDMA_PERF_NUM_DESC 128
/* Kernel version adaptative code */
#if
KERNEL_VERSION(4, 19, 0) <= LINUX_VERSION_COD
E
#if
HAS_SWAKE_UP_ON
E
/* since 4.18, using simple wait queues is not recommended
* except for realtime constraint (see swait.h comments)
* and will likely be removed in future kernel versions
...
...
@@ -64,7 +64,7 @@ MODULE_PARM_DESC(desc_blen_max,
#define xlx_wake_up swake_up_one
#define xlx_wait_event_interruptible_timeout \
swait_event_interruptible_timeout_exclusive
#elif
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#elif
HAS_SWAKE_UP
#define xlx_wake_up swake_up
#define xlx_wait_event_interruptible_timeout \
swait_event_interruptible_timeout
...
...
@@ -724,7 +724,7 @@ static struct xdma_transfer *engine_start(struct xdma_engine *engine)
dbg_tfr
(
"ioread32(0x%p) (dummy read flushes writes).
\n
"
,
&
engine
->
regs
->
status
);
#if
KERNEL_VERSION(5, 1, 0) >= LINUX_VERSION_CODE
#if
HAS_MMIOWB
mmiowb
();
#endif
...
...
@@ -3176,7 +3176,7 @@ static int transfer_init(struct xdma_engine *engine,
/* lock the engine state */
spin_lock_irqsave
(
&
engine
->
lock
,
flags
);
/* initialize wait queue */
#if
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
#if
HAS_SWAKE_UP
init_swait_queue_head
(
&
xfer
->
wq
);
#else
init_waitqueue_head
(
&
xfer
->
wq
);
...
...
@@ -3246,7 +3246,7 @@ static int transfer_init_cyclic(struct xdma_engine *engine,
memset
(
xfer
,
0
,
sizeof
(
*
xfer
));
/* initialize wait queue */
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
init_swait_queue_head
(
&
xfer
->
wq
);
#else
init_waitqueue_head
(
&
xfer
->
wq
);
...
...
@@ -4025,7 +4025,7 @@ int xdma_performance_submit(struct xdma_dev *xdev, struct xdma_engine *engine)
transfer
->
cyclic
=
1
;
/* initialize wait queue */
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
init_swait_queue_head
(
&
transfer
->
wq
);
#else
init_waitqueue_head
(
&
transfer
->
wq
);
...
...
@@ -4105,7 +4105,7 @@ static struct xdma_dev *alloc_dev_instance(struct pci_dev *pdev)
spin_lock_init
(
&
engine
->
lock
);
mutex_init
(
&
engine
->
desc_lock
);
INIT_LIST_HEAD
(
&
engine
->
transfer_list
);
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
init_swait_queue_head
(
&
engine
->
shutdown_wq
);
init_swait_queue_head
(
&
engine
->
xdma_perf_wq
);
#else
...
...
@@ -4119,7 +4119,7 @@ static struct xdma_dev *alloc_dev_instance(struct pci_dev *pdev)
spin_lock_init
(
&
engine
->
lock
);
mutex_init
(
&
engine
->
desc_lock
);
INIT_LIST_HEAD
(
&
engine
->
transfer_list
);
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
init_swait_queue_head
(
&
engine
->
shutdown_wq
);
init_swait_queue_head
(
&
engine
->
xdma_perf_wq
);
#else
...
...
XDMA/linux-kernel/libxdma/libxdma.h
View file @
a1d510f4
...
...
@@ -31,9 +31,32 @@
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/workqueue.h>
#if KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
/* Add compatibility checking for RHEL versions */
#if defined(RHEL_RELEASE_CODE)
# define ACCESS_OK_2_ARGS (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 0))
#else
# define ACCESS_OK_2_ARGS (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0))
#endif
#if defined(RHEL_RELEASE_CODE)
# define HAS_MMIOWB (RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(8, 0))
#else
# define HAS_MMIOWB (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 1, 0))
#endif
#if defined(RHEL_RELEASE_CODE)
# define HAS_SWAKE_UP_ONE (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 0))
# define HAS_SWAKE_UP (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 0))
#else
# define HAS_SWAKE_UP_ONE (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
# define HAS_SWAKE_UP (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
#endif
#if HAS_SWAKE_UP
#include <linux/swait.h>
#endif
/*
* if the config bar is fixed, the driver does not neeed to search through
* all of the bars
...
...
@@ -418,7 +441,7 @@ struct xdma_transfer {
int
desc_num
;
/* number of descriptors in transfer */
int
desc_index
;
/* index for 1st desc. in transfer */
enum
dma_data_direction
dir
;
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
struct
swait_queue_head
wq
;
#else
wait_queue_head_t
wq
;
/* wait queue for transfer completion */
...
...
@@ -504,7 +527,7 @@ struct xdma_engine {
dma_addr_t
poll_mode_bus
;
/* bus addr for descriptor writeback */
/* Members associated with interrupt mode support */
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
struct
swait_queue_head
shutdown_wq
;
#else
wait_queue_head_t
shutdown_wq
;
/* wait queue for shutdown sync */
...
...
@@ -523,7 +546,7 @@ struct xdma_engine {
/* for performance test support */
struct
xdma_performance_ioctl
*
xdma_perf
;
/* perf test control */
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
struct
swait_queue_head
xdma_perf_wq
;
#else
wait_queue_head_t
xdma_perf_wq
;
/* Perf test sync */
...
...
XDMA/linux-kernel/xdma/cdev_ctrl.c
View file @
a1d510f4
...
...
@@ -24,7 +24,7 @@
#include "xdma_cdev.h"
#include "cdev_ctrl.h"
#if
KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE
#if
ACCESS_OK_2_ARGS
#define xlx_access_ok(X, Y, Z) access_ok(Y, Z)
#else
#define xlx_access_ok(X, Y, Z) access_ok(X, Y, Z)
...
...
XDMA/linux-kernel/xdma/cdev_sgdma.c
View file @
a1d510f4
...
...
@@ -611,7 +611,7 @@ static int ioctl_do_perf_start(struct xdma_engine *engine, unsigned long arg)
enable_perf
(
engine
);
dbg_perf
(
"transfer_size = %d
\n
"
,
engine
->
xdma_perf
->
transfer_size
);
/* initialize wait queue */
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
init_swait_queue_head
(
&
engine
->
xdma_perf_wq
);
#else
init_waitqueue_head
(
&
engine
->
xdma_perf_wq
);
...
...
XDMA/linux-kernel/xdma/cdev_xvc.c
View file @
a1d510f4
...
...
@@ -213,7 +213,7 @@ static long xvc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
pr_info
(
"copy back tdo_buf failed: %d/%u.
\n
"
,
rv
,
total_bytes
);
unlock:
#if
KERNEL_VERSION(5, 1, 0) >= LINUX_VERSION_CODE
#if
HAS_MMIOWB
mmiowb
();
#endif
spin_unlock
(
&
xcdev
->
lock
);
...
...
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