Changeset 55b77d9 in mainline for kernel/generic/src/time/timeout.c


Ignore:
Timestamp:
2011-06-17T20:39:16Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8f164724
Parents:
98caf49
Message:

Separate list_t typedef from link_t (kernel part).

  • list_t represents lists
  • Use list_first(), list_last(), list_empty() where appropriate
  • Use list_foreach() where possible
  • Replace improper uses of list_prepend() with list_insert_after()
  • Replace improper uses of list_append() with list_insert_before()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/time/timeout.c

    r98caf49 r55b77d9  
    5454{
    5555        irq_spinlock_initialize(&CPU->timeoutlock, "cpu.timeoutlock");
    56         list_initialize(&CPU->timeout_active_head);
     56        list_initialize(&CPU->timeout_active_list);
    5757}
    5858
     
    119119        timeout_t *target = NULL;
    120120        link_t *cur;
    121         for (cur = CPU->timeout_active_head.next;
    122             cur != &CPU->timeout_active_head; cur = cur->next) {
     121        for (cur = CPU->timeout_active_list.head.next;
     122            cur != &CPU->timeout_active_list.head; cur = cur->next) {
    123123                target = list_get_instance(cur, timeout_t, link);
    124124                irq_spinlock_lock(&target->lock, false);
     
    135135        /* Avoid using cur->prev directly */
    136136        link_t *prev = cur->prev;
    137         list_prepend(&timeout->link, prev);
     137        list_insert_after(&timeout->link, prev);
    138138       
    139139        /*
     
    146146         * Decrease ticks of timeout's immediate succesor by timeout->ticks.
    147147         */
    148         if (cur != &CPU->timeout_active_head) {
     148        if (cur != &CPU->timeout_active_list.head) {
    149149                irq_spinlock_lock(&target->lock, false);
    150150                target->ticks -= timeout->ticks;
     
    184184        /*
    185185         * Now we know for sure that timeout hasn't been activated yet
    186          * and is lurking in timeout->cpu->timeout_active_head queue.
     186         * and is lurking in timeout->cpu->timeout_active_list.
    187187         */
    188188       
    189189        link_t *cur = timeout->link.next;
    190         if (cur != &timeout->cpu->timeout_active_head) {
     190        if (cur != &timeout->cpu->timeout_active_list.head) {
    191191                timeout_t *tmp = list_get_instance(cur, timeout_t, link);
    192192                irq_spinlock_lock(&tmp->lock, false);
Note: See TracChangeset for help on using the changeset viewer.