summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cesar/cp/av/sta/mgr/src/sta_mgr.c2
-rw-r--r--cesar/cp/conn/src/conn.c2
-rw-r--r--cesar/cp/conn/src/link.c2
-rw-r--r--cesar/lib/list.h38
-rw-r--r--cesar/lib/src/list.c16
-rw-r--r--cesar/lib/src/slab.c4
-rw-r--r--cesar/lib/src/trace.c4
-rw-r--r--cesar/lib/test/list/src/test_list.c17
-rw-r--r--cesar/mac/ca/src/ca.c9
-rw-r--r--cesar/mac/common/src/store.c2
-rw-r--r--cesar/mac/common/src/tonemap.c2
11 files changed, 50 insertions, 48 deletions
diff --git a/cesar/cp/av/sta/mgr/src/sta_mgr.c b/cesar/cp/av/sta/mgr/src/sta_mgr.c
index 5b0009a072..cba9b9de25 100644
--- a/cesar/cp/av/sta/mgr/src/sta_mgr.c
+++ b/cesar/cp/av/sta/mgr/src/sta_mgr.c
@@ -116,7 +116,7 @@ cp_av_sta_mgr_release_station (cp_t *ctx, cp_tei_t tei)
dbg_assert (sta);
list_init_node (&sta->release_node);
- list_push (&ctx->sta_mgr.release_sta_list, &sta->release_node);
+ list_push_back (&ctx->sta_mgr.release_sta_list, &sta->release_node);
/* Set the station tei_lease_ms to 5 min as indicated in the HPAV
* specification. */
diff --git a/cesar/cp/conn/src/conn.c b/cesar/cp/conn/src/conn.c
index 178e4e920e..82832cf7c3 100644
--- a/cesar/cp/conn/src/conn.c
+++ b/cesar/cp/conn/src/conn.c
@@ -80,7 +80,7 @@ cp_conn_add_conn(cp_t *ctx, cp_conn_t *conn)
conn->conn_info.cid,
conn->conn_info.cspec.f_cinfo.user_priority);
- list_push(&ctx->conn_mgr.conns, &conn->node);
+ list_push_back(&ctx->conn_mgr.conns, &conn->node);
}
void
diff --git a/cesar/cp/conn/src/link.c b/cesar/cp/conn/src/link.c
index ddc7664009..b7a876ee2f 100644
--- a/cesar/cp/conn/src/link.c
+++ b/cesar/cp/conn/src/link.c
@@ -53,7 +53,7 @@ cp_link_push_ble(cp_link_t *link, u16 ble, u16 et_atu)
new->et_atu = et_atu;
list_init_node(&new->node);
- list_push(&link->list_ble, &new->node);
+ list_push_back(&link->list_ble, &new->node);
}
void
diff --git a/cesar/lib/list.h b/cesar/lib/list.h
index 042236ac65..b85db10c12 100644
--- a/cesar/lib/list.h
+++ b/cesar/lib/list.h
@@ -104,36 +104,36 @@ bool
list_empty (list_t *list);
/**
- * Push a node to the end of a list.
+ * Push a node to the back (end) of a list.
* \param list the list
* \param node the node to push
*/
void
-list_push (list_t *list, list_node_t *node);
+list_push_back (list_t *list, list_node_t *node);
/**
- * Unshift a node to the begin of a list.
+ * Push a node to the front of a list.
* \param list the list
- * \param node the node to unshift
+ * \param node the node to push
*/
void
-list_unshift (list_t *list, list_node_t *node);
+list_push_front (list_t *list, list_node_t *node);
/**
- * Pop a node from the end of a list.
+ * Pop a node from the back (end) of a list.
* \param list the list
* \return the popped node
*/
list_node_t *
-list_pop (list_t *list);
+list_pop_back (list_t *list);
/**
- * Shift a node from the begin of a list.
+ * Pop a node from the front of a list.
* \param list the list
- * \return the shifted node
+ * \return the popped node
*/
list_node_t *
-list_shift (list_t *list);
+list_pop_front (list_t *list);
/**
* Remove a node from a list.
@@ -153,26 +153,26 @@ void
list_insert (list_t *list, list_node_t *before, list_node_t *node);
/**
- * Push a range [first, last) to a end of a list.
+ * Push a range [first, last) to the back (end) of a list.
* \param to list to push to
* \param from list to remove from
* \param first first node to push
* \param last node after the last one to push
*/
void
-list_push_range (list_t *to, list_t *from,
- list_node_t *first, list_node_t *last);
+list_push_back_range (list_t *to, list_t *from,
+ list_node_t *first, list_node_t *last);
/**
- * Unshift a range [first, last) to a begin of a list.
- * \param to list to unshift to
+ * Push a range [first, last) to the front of a list.
+ * \param to list to push to
* \param from list to remove from
- * \param first first node to unshift
- * \param last node after the last one to unshift
+ * \param first first node to push
+ * \param last node after the last one to push
*/
void
-list_unshift_range (list_t *to, list_t *from,
- list_node_t *first, list_node_t *last);
+list_push_front_range (list_t *to, list_t *from,
+ list_node_t *first, list_node_t *last);
/**
* Insert a range [first, last) to a list
diff --git a/cesar/lib/src/list.c b/cesar/lib/src/list.c
index 61771b2c53..7b01155244 100644
--- a/cesar/lib/src/list.c
+++ b/cesar/lib/src/list.c
@@ -77,7 +77,7 @@ list_empty (list_t *list)
}
void
-list_push (list_t *list, list_node_t *node)
+list_push_back (list_t *list, list_node_t *node)
{
dbg_assert (list);
dbg_assert (node && node->next == node && node->prev == node);
@@ -88,7 +88,7 @@ list_push (list_t *list, list_node_t *node)
}
void
-list_unshift (list_t *list, list_node_t *node)
+list_push_front (list_t *list, list_node_t *node)
{
dbg_assert (list);
dbg_assert (node && node->next == node && node->prev == node);
@@ -99,7 +99,7 @@ list_unshift (list_t *list, list_node_t *node)
}
list_node_t *
-list_pop (list_t *list)
+list_pop_back (list_t *list)
{
list_node_t *node;
dbg_assert (list && !list_empty (list));
@@ -112,7 +112,7 @@ list_pop (list_t *list)
}
list_node_t *
-list_shift (list_t *list)
+list_pop_front (list_t *list)
{
list_node_t *node;
dbg_assert (list && !list_empty (list));
@@ -148,16 +148,16 @@ list_insert (list_t *list, list_node_t *before, list_node_t *node)
}
void
-list_push_range (list_t *to, list_t *from,
- list_node_t *first, list_node_t *last)
+list_push_back_range (list_t *to, list_t *from,
+ list_node_t *first, list_node_t *last)
{
dbg_assert (to);
list_insert_range (to, from, &to->nil, first, last);
}
void
-list_unshift_range (list_t *to, list_t *from,
- list_node_t *first, list_node_t *last)
+list_push_front_range (list_t *to, list_t *from,
+ list_node_t *first, list_node_t *last)
{
dbg_assert (to);
list_insert_range (to, from, to->nil.next, first, last);
diff --git a/cesar/lib/src/slab.c b/cesar/lib/src/slab.c
index 058a07671a..c3aa987d61 100644
--- a/cesar/lib/src/slab.c
+++ b/cesar/lib/src/slab.c
@@ -156,7 +156,7 @@ slab_grow (slab_cache_t *cache)
}
o->next = NULL;
/* Add to partial. */
- list_push (&cache->partial, &s->node);
+ list_push_back (&cache->partial, &s->node);
/* Done. */
return s;
}
@@ -275,7 +275,7 @@ slab_free_ (void *object __FL)
((slab_object_t *) object)->next = d->free;
d->free = object;
/* Add to partial tail. */
- list_push (&cache->partial, &s->node);
+ list_push_back (&cache->partial, &s->node);
}
}
diff --git a/cesar/lib/src/trace.c b/cesar/lib/src/trace.c
index da880d7639..0bf168fa16 100644
--- a/cesar/lib/src/trace.c
+++ b/cesar/lib/src/trace.c
@@ -288,7 +288,7 @@ trace_buffer_add (trace_buffer_t *buf, const char *name, uint drop_level,
i = i->next;
} while (1);
/* Add it to context. */
- list_push (&ctx->buffers, &buf->node);
+ list_push_back (&ctx->buffers, &buf->node);
}
void
@@ -320,7 +320,7 @@ trace_buffer_add_bare (trace_buffer_t *buf, const char *name,
for (p = data; p != data + size; p++)
*p = TRACE_UNINITIALISED;
/* Add it to context. */
- list_push (&ctx->buffers, &buf->node);
+ list_push_back (&ctx->buffers, &buf->node);
}
void
diff --git a/cesar/lib/test/list/src/test_list.c b/cesar/lib/test/list/src/test_list.c
index af02728069..902d97a908 100644
--- a/cesar/lib/test/list/src/test_list.c
+++ b/cesar/lib/test/list/src/test_list.c
@@ -50,7 +50,7 @@ list_basic_test_case (test_t t)
j = lib_rnd_uniform (rnd, NB_LISTS);
items[i].list = j;
items[i].pos = lists_item_nb[j]++;
- list_push (&lists[j], &items[i].node);
+ list_push_back (&lists[j], &items[i].node);
}
/* Test loop. */
test_begin (t, "remove and insert")
@@ -151,10 +151,11 @@ list_basic_test_case (test_t t)
list_insert_range (dst_list, src_list, dst_after, first,
list_next (last));
else if (dst_begin)
- list_unshift_range (dst_list, src_list, first, list_next
- (last));
+ list_push_front_range (dst_list, src_list, first,
+ list_next (last));
else
- list_push_range (dst_list, src_list, first, list_next (last));
+ list_push_back_range (dst_list, src_list, first,
+ list_next (last));
}
else
{
@@ -164,18 +165,18 @@ list_basic_test_case (test_t t)
else
{
if (src_begin)
- n = list_shift (src_list);
+ n = list_pop_front (src_list);
else
- n = list_pop (src_list);
+ n = list_pop_back (src_list);
dbg_assert (n == first);
}
/* ...and insert. */
if (dst_center)
list_insert (dst_list, dst_after, first);
else if (dst_begin)
- list_unshift (dst_list, first);
+ list_push_front (dst_list, first);
else
- list_push (dst_list, first);
+ list_push_back (dst_list, first);
}
/* Update pos fields of moved nodes. */
for (n = first, pos = dst_pos; n != list_next (last);
diff --git a/cesar/mac/ca/src/ca.c b/cesar/mac/ca/src/ca.c
index 3a51ee36e4..25c0caf46f 100644
--- a/cesar/mac/ca/src/ca.c
+++ b/cesar/mac/ca/src/ca.c
@@ -138,11 +138,11 @@ ca_mfs_update_common (ca_t *ctx, mfs_tx_t *mfs, bool locked)
if (new_state != CA_MFS_STATE_PRIO_QUEUED || locked)
list_remove (&ctx->prio[mfs->cap], &mfs->ca_link);
if (new_state == CA_MFS_STATE_PRIO_QUEUED && locked)
- list_push (&ctx->prio[mfs->cap], &mfs->ca_link);
+ list_push_back (&ctx->prio[mfs->cap], &mfs->ca_link);
}
else if (new_state == CA_MFS_STATE_PRIO_QUEUED)
{
- list_push (&ctx->prio[mfs->cap], &mfs->ca_link);
+ list_push_back (&ctx->prio[mfs->cap], &mfs->ca_link);
}
/* Done. */
mfs->ca_state = new_state;
@@ -189,7 +189,7 @@ ca_mfs_hold_common (ca_t *ctx, mfs_tx_t *mfs, bool locked)
list_remove (&ctx->prio[mfs->cap], &mfs->ca_link);
/* Add to hold list. */
mfs->ca_state = CA_MFS_STATE_HELD;
- list_push (&ctx->held, &mfs->ca_link);
+ list_push_back (&ctx->held, &mfs->ca_link);
/* Unlock. */
if (!locked) arch_isr_unlock (flags);
/* The current ACCESS may have changed. */
@@ -222,7 +222,8 @@ ca_mfs_next_beacon_period (ca_t *ctx)
/* Unhold MFS. */
while (!list_empty (&ctx->held))
{
- mfs_tx_t *mfs = PARENT_OF (mfs_tx_t, ca_link, list_pop (&ctx->held));
+ mfs_tx_t *mfs = PARENT_OF (mfs_tx_t, ca_link,
+ list_pop_back (&ctx->held));
mfs->ca_state = CA_MFS_STATE_UNKNOWN;
ca_mfs_update_locked (ctx, mfs);
}
diff --git a/cesar/mac/common/src/store.c b/cesar/mac/common/src/store.c
index 2c1a0a6ad4..9f4634ce8e 100644
--- a/cesar/mac/common/src/store.c
+++ b/cesar/mac/common/src/store.c
@@ -266,7 +266,7 @@ mac_store_mfs_unassociated_add_ (mac_store_t *ctx, bool tx, bool bcast,
mfs_tx_init_unassociated (&mfs->tx, bcast, mme, lid, tei);
blk_addref_ (mfs __fl);
arch_dsr_lock ();
- list_push (&ctx->unassociated, &mfs->common.store_unassociated_link);
+ list_push_back (&ctx->unassociated, &mfs->common.store_unassociated_link);
arch_dsr_unlock ();
return mfs;
}
diff --git a/cesar/mac/common/src/tonemap.c b/cesar/mac/common/src/tonemap.c
index 0cde1fdbd3..109eccd7ef 100644
--- a/cesar/mac/common/src/tonemap.c
+++ b/cesar/mac/common/src/tonemap.c
@@ -146,7 +146,7 @@ tonemap_release (tonemaps_t *tms, u8 tmi,
/* Put the tonemap in the release list and get it out of the
* station set. */
- list_push (tm_release_list, &tm->release_link);
+ list_push_back (tm_release_list, &tm->release_link);
tm->released = TONEMAP_RELEASE_TIMER_S;
tms->tm[tmi] = NULL;
}