Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xenomai
xenomai4
linux-evl
Commits
5ff765fb
Commit
5ff765fb
authored
Feb 15, 2019
by
Philippe Gerum
Browse files
evl/mutex: export flushing routine
Signed-off-by:
Philippe Gerum
<
rpm@xenomai.org
>
parent
ac2a1ba8
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/evenless/mutex.h
View file @
5ff765fb
...
...
@@ -48,7 +48,7 @@ void evl_init_mutex_pp(struct evl_mutex *mutex,
atomic_t
*
fastlock
,
u32
*
ceiling_ref
);
bool
evl_destroy_mutex
(
struct
evl_mutex
*
mutex
);
void
evl_destroy_mutex
(
struct
evl_mutex
*
mutex
);
int
evl_trylock_mutex
(
struct
evl_mutex
*
mutex
);
...
...
@@ -64,6 +64,9 @@ void __evl_unlock_mutex(struct evl_mutex *mutex);
void
evl_unlock_mutex
(
struct
evl_mutex
*
mutex
);
void
evl_flush_mutex
(
struct
evl_mutex
*
mutex
,
int
reason
);
void
evl_commit_mutex_ceiling
(
struct
evl_mutex
*
mutex
);
#ifdef CONFIG_EVENLESS_DEBUG_MUTEX_INBAND
...
...
kernel/evenless/mutex.c
View file @
5ff765fb
...
...
@@ -334,31 +334,32 @@ void evl_init_mutex_pp(struct evl_mutex *mutex,
}
EXPORT_SYMBOL_GPL
(
evl_init_mutex_pp
);
bool
evl_
destroy
_mutex
(
struct
evl_mutex
*
mutex
)
void
evl_
flush
_mutex
(
struct
evl_mutex
*
mutex
,
int
reason
)
{
struct
evl_thread
*
waiter
,
*
tmp
;
unsigned
long
flags
;
bool
ret
;
xnlock_get_irqsave
(
&
nklock
,
flags
);
trace_evl_mutex_flush
(
mutex
);
trace_evl_mutex_destroy
(
mutex
);
xnlock_get_irqsave
(
&
nklock
,
flags
);
if
(
list_empty
(
&
mutex
->
wait_list
))
{
if
(
list_empty
(
&
mutex
->
wait_list
))
EVL_WARN_ON
(
CORE
,
mutex
->
flags
&
EVL_MUTEX_CLAIMED
);
ret
=
false
;
}
else
{
ret
=
true
;
else
{
list_for_each_entry_safe
(
waiter
,
tmp
,
&
mutex
->
wait_list
,
wait_next
)
evl_wakeup_thread
(
waiter
,
T_PEND
,
T_RMID
);
evl_wakeup_thread
(
waiter
,
T_PEND
,
reason
);
if
(
mutex
->
flags
&
EVL_MUTEX_CLAIMED
)
clear_pi_boost
(
mutex
,
mutex
->
owner
);
}
xnlock_put_irqrestore
(
&
nklock
,
flags
);
}
return
ret
;
void
evl_destroy_mutex
(
struct
evl_mutex
*
mutex
)
{
trace_evl_mutex_destroy
(
mutex
);
evl_flush_mutex
(
mutex
,
T_RMID
);
}
EXPORT_SYMBOL_GPL
(
evl_destroy_mutex
);
...
...
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