Commit de8f25a1 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/assert: clarify assertion about holding the global core lock



As we are in the process of phasing out the nklock, convert
atomic_only() to requires_ugly_lock() to give a clear hint that no
more dependencies of that type should be added to the code.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent 2520e9be
......@@ -36,7 +36,7 @@
#define inband_context_only() EVL_WARN_ON_ONCE(CONTEXT, !running_inband())
/* TEMP: needed until we have gotten rid of the infamous nklock. */
#define atomic_only() WARN_ON_ONCE(!(xnlock_is_owner(&nklock) && hard_irqs_disabled()))
#define no_ugly_lock() WARN_ON_ONCE(xnlock_is_owner(&nklock))
#define requires_ugly_lock() WARN_ON_ONCE(!(xnlock_is_owner(&nklock) && hard_irqs_disabled()))
#define no_ugly_lock() WARN_ON_ONCE(xnlock_is_owner(&nklock))
#endif /* !_EVENLESS_ASSERT_H */
......@@ -212,7 +212,7 @@ static inline int evl_need_resched(struct evl_rq *rq)
/* Set self resched flag for the current scheduler. */
static inline void evl_set_self_resched(struct evl_rq *rq)
{
atomic_only();
requires_ugly_lock();
rq->status |= RQ_SCHED;
}
......
......@@ -475,7 +475,7 @@ int evl_quota_create_group(struct evl_quota_group *tg,
int tgid, nr_groups = CONFIG_EVENLESS_SCHED_QUOTA_NR_GROUPS;
struct evl_sched_quota *qs = &rq->quota;
atomic_only();
requires_ugly_lock();
tgid = find_first_zero_bit(group_map, nr_groups);
if (tgid >= nr_groups)
......@@ -514,7 +514,7 @@ int evl_quota_destroy_group(struct evl_quota_group *tg,
struct evl_thread *thread, *tmp;
union evl_sched_param param;
atomic_only();
requires_ugly_lock();
if (!list_empty(&tg->members)) {
if (!force)
......@@ -547,7 +547,7 @@ void evl_quota_set_limit(struct evl_quota_group *tg,
ktime_t old_quota = tg->quota;
u64 n;
atomic_only();
requires_ugly_lock();
if (quota_percent < 0 || quota_percent > 100) { /* Quota off. */
quota_percent = 100;
......@@ -614,7 +614,7 @@ evl_quota_find_group(struct evl_rq *rq, int tgid)
{
struct evl_quota_group *tg;
atomic_only();
requires_ugly_lock();
if (list_empty(&rq->quota.groups))
return NULL;
......@@ -632,7 +632,7 @@ int evl_quota_sum_all(struct evl_rq *rq)
{
struct evl_sched_quota *qs = &rq->quota;
atomic_only();
requires_ugly_lock();
return quota_sum_all(qs);
}
......
......@@ -275,7 +275,7 @@ void __evl_set_timer_rq(struct evl_timer *timer,
{
int cpu;
atomic_only();
requires_ugly_lock();
/*
* Figure out which CPU is best suited for managing this
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment