Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
scdaq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scouting-demonstrator
scdaq
Commits
168cd421
Commit
168cd421
authored
2 years ago
by
Petr Zejdl
Browse files
Options
Downloads
Patches
Plain Diff
Fixing the inconsistency in the variable names
parent
fb20c075
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/wz_dma.c
+5
-5
5 additions, 5 deletions
src/wz_dma.c
src/wz_dma.h
+1
-1
1 addition, 1 deletion
src/wz_dma.h
with
6 additions
and
6 deletions
src/wz_dma.c
+
5
−
5
View file @
168cd421
...
...
@@ -17,10 +17,10 @@
/*
* Open necessary devices and map DMAable memory.
* Variable us
e
r_regs_size is the size (in power of 2) of the user memory space that should be allocated for I/O communication with the hardware.
* Variable usr_regs_size is the size (in power of 2) of the user memory space that should be allocated for I/O communication with the hardware.
* Set to 0 if not necessary.
*/
int
wz_init
(
struct
wz_private
*
wz
,
size_t
us
e
r_regs_size
)
int
wz_init
(
struct
wz_private
*
wz
,
size_t
usr_regs_size
)
{
int
res
;
...
...
@@ -28,7 +28,7 @@ int wz_init(struct wz_private* wz, size_t user_regs_size)
wz
->
fd_control
=
-
1
;
wz
->
fd_memory
=
-
1
;
wz
->
fd_memory_is_allocated
=
0
;
wz
->
us
e
r_regs_size
=
us
e
r_regs_size
;
wz
->
usr_regs_size
=
usr_regs_size
;
wz
->
usr_regs
=
NULL
;
wz
->
data_buf
=
NULL
;
...
...
@@ -62,7 +62,7 @@ int wz_init(struct wz_private* wz, size_t user_regs_size)
wz
->
fd_memory_is_allocated
=
1
;
//Now mmap the user registers
if
(
us
e
r_regs_size
&&
((
wz
->
usr_regs
=
(
volatile
uint32_t
*
)
mmap
(
NULL
,
wz
->
us
e
r_regs_size
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
wz
->
fd_user
,
0
))
==
MAP_FAILED
))
{
if
(
wz
->
usr_regs_size
&&
((
wz
->
usr_regs
=
(
volatile
uint32_t
*
)
mmap
(
NULL
,
wz
->
usr_regs_size
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
wz
->
fd_user
,
0
))
==
MAP_FAILED
))
{
wz
->
usr_regs
=
NULL
;
PERROR
(
"Can't mmap user registers"
);
wz_close
(
wz
);
...
...
@@ -95,7 +95,7 @@ int wz_close(struct wz_private* wz)
munmap
((
void
*
)
wz
->
data_buf
,
TOT_BUF_LEN
);
}
if
(
wz
->
usr_regs
)
{
munmap
((
void
*
)
wz
->
usr_regs
,
wz
->
us
e
r_regs_size
);
munmap
((
void
*
)
wz
->
usr_regs
,
wz
->
usr_regs_size
);
}
if
(
wz
->
fd_memory_is_allocated
)
{
ioctl
(
wz
->
fd_memory
,
IOCTL_XDMA_WZ_FREE_BUFFERS
,
0L
);
...
...
This diff is collapsed.
Click to expand it.
src/wz_dma.h
+
1
−
1
View file @
168cd421
...
...
@@ -12,7 +12,7 @@ struct wz_private {
int
fd_control
;
int
fd_memory
;
int
fd_memory_is_allocated
;
size_t
us
e
r_regs_size
;
size_t
usr_regs_size
;
volatile
uint32_t
*
usr_regs
;
volatile
char
*
data_buf
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment