Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
022ced36
Commit
022ced36
authored
9 years ago
by
Julian Oes
Browse files
Options
Downloads
Patches
Plain Diff
shmem: don't do locking for now
The locking seems to be broken, therefore refrain from using it.
parent
070e71ed
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/platforms/posix/px4_layer/shmem_posix.c
+12
-3
12 additions, 3 deletions
src/platforms/posix/px4_layer/shmem_posix.c
src/platforms/qurt/px4_layer/shmem_qurt.c
+7
-0
7 additions, 0 deletions
src/platforms/qurt/px4_layer/shmem_qurt.c
with
19 additions
and
3 deletions
src/platforms/posix/px4_layer/shmem_posix.c
+
12
−
3
View file @
022ced36
...
...
@@ -102,9 +102,12 @@ static void *map_memory(off_t target)
int
get_shmem_lock
(
const
char
*
caller_file_name
,
int
caller_line_number
)
{
// TODO FIXME: just say this went through
return
0
;
int
i
=
0
;
/*ioctl calls cmpxchg*/
/*
TODO: make this comment so somebody can understand it:
ioctl calls cmpxchg
*/
while
(
ioctl
(
mem_fd
,
LOCK_MEM
)
!=
0
)
{
usleep
(
10000
);
//sleep for 10 msec
...
...
@@ -117,13 +120,19 @@ int get_shmem_lock(const char *caller_file_name, int caller_line_number)
}
}
PX4_INFO
(
"got a lock!"
);
return
0
;
//got the lock
}
void
release_shmem_lock
(
void
)
{
ioctl
(
mem_fd
,
UNLOCK_MEM
);
// TODO FIXME: just say this went through
return
;
int
ret
=
ioctl
(
mem_fd
,
UNLOCK_MEM
);
if
(
ret
!=
0
)
{
PX4_INFO
(
"unlock failed, ret: %d, errno %d"
,
ret
,
errno
);
}
}
void
init_shared_memory
(
void
)
...
...
This diff is collapsed.
Click to expand it.
src/platforms/qurt/px4_layer/shmem_qurt.c
+
7
−
0
View file @
022ced36
...
...
@@ -76,6 +76,9 @@ static void *map_memory(off_t target)
int
get_shmem_lock
(
const
char
*
caller_file_name
,
int
caller_line_number
)
{
// TODO: don't do this for now
return
0
;
unsigned
char
*
lock
=
(
unsigned
char
*
)(
MAP_ADDRESS
+
LOCK_OFFSET
);
unsigned
int
i
=
0
;
...
...
@@ -101,6 +104,10 @@ int get_shmem_lock(const char *caller_file_name, int caller_line_number)
void
release_shmem_lock
(
void
)
{
// TODO: don't do this either
PX4_INFO
(
"unlocking"
);
return
;
unsigned
char
*
lock
=
(
unsigned
char
*
)(
MAP_ADDRESS
+
LOCK_OFFSET
);
*
lock
=
1
;
...
...
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