Changes in / [bd08239:313775b] in mainline


Ignore:
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/drivers/tick.c

    rbd08239 r313775b  
    4444#include <debug.h>
    4545
     46#define TICK_RESTART_TIME       50      /* Worst case estimate. */
     47
    4648/** Initialize tick and stick interrupt. */
    4749void tick_init(void)
     
    4951        /* initialize TICK interrupt */
    5052        tick_compare_reg_t compare;
    51         softint_reg_t clear;
    5253
    5354        interrupt_register(14, "tick_int", tick_interrupt);
     
    5859        tick_compare_write(compare.value);
    5960
    60         clear.value = 0;
    61         clear.tick_int = 1;
    62         clear_softint_write(clear.value);
    63 
    6461#if defined (US3) || defined (SUN4V)
    6562        /* disable STICK interrupts and clear any pending ones */
    6663        tick_compare_reg_t stick_compare;
     64        softint_reg_t clear;
    6765
    6866        stick_compare.value = stick_compare_read();
  • kernel/genarch/src/mm/asid.c

    rbd08239 r313775b  
    9797                 * inactive address space.
    9898                 */
    99                 tmp = list_first(&inactive_as_with_asid_list);
    100                 ASSERT(tmp != NULL);
     99                ASSERT(!list_empty(&inactive_as_with_asid_head));
     100                tmp = inactive_as_with_asid_head.next;
    101101                list_remove(tmp);
    102102               
  • kernel/generic/include/adt/btree.h

    rbd08239 r313775b  
    8989typedef struct {
    9090        btree_node_t *root;     /**< B-tree root node pointer. */
    91         list_t leaf_list;       /**< List of leaves. */
     91        link_t leaf_head;       /**< Leaf-level list head. */
    9292} btree_t;
    9393
  • kernel/generic/include/adt/hash_table.h

    rbd08239 r313775b  
    6868/** Hash table structure. */
    6969typedef struct {
    70         list_t *entry;
     70        link_t *entry;
    7171        size_t entries;
    7272        size_t max_keys;
  • kernel/generic/include/adt/list.h

    rbd08239 r313775b  
    11/*
    22 * Copyright (c) 2001-2004 Jakub Jermar
    3  * Copyright (c) 2011 Jiri Svoboda
    43 * All rights reserved.
    54 *
     
    4039#include <trace.h>
    4140
    42 /** Doubly linked list link. */
     41/** Doubly linked list head and link type. */
    4342typedef struct link {
    4443        struct link *prev;  /**< Pointer to the previous item in the list. */
     
    4645} link_t;
    4746
    48 /** Doubly linked list. */
    49 typedef struct list {
    50         link_t head;  /**< List head. Does not have any data. */
    51 } list_t;
    52 
    5347/** Declare and initialize statically allocated list.
    5448 *
     
    5751 */
    5852#define LIST_INITIALIZE(name) \
    59         list_t name = { \
    60                 .head = { \
    61                         .prev = &(name).head, \
    62                         .next = &(name).head \
    63                 } \
     53        link_t name = { \
     54                .prev = &name, \
     55                .next = &name \
    6456        }
    6557
     
    6860
    6961#define list_foreach(list, iterator) \
    70         for (link_t *iterator = (list).head.next; \
    71             iterator != &(list).head; iterator = iterator->next)
     62        for (link_t *iterator = (list).next; \
     63            iterator != &(list); iterator = iterator->next)
    7264
    7365/** Initialize doubly-linked circular list link
     
    8880 * Initialize doubly-linked circular list.
    8981 *
    90  * @param list Pointer to list_t structure.
    91  *
    92  */
    93 NO_TRACE static inline void list_initialize(list_t *list)
    94 {
    95         list->head.prev = &list->head;
    96         list->head.next = &list->head;
     82 * @param list Pointer to link_t structure representing the list.
     83 *
     84 */
     85NO_TRACE static inline void list_initialize(link_t *list)
     86{
     87        list->prev = list;
     88        list->next = list;
     89}
     90
     91/** Add item to the beginning of doubly-linked circular list
     92 *
     93 * Add item to the beginning of doubly-linked circular list.
     94 *
     95 * @param link Pointer to link_t structure to be added.
     96 * @param list Pointer to link_t structure representing the list.
     97 *
     98 */
     99NO_TRACE static inline void list_prepend(link_t *link, link_t *list)
     100{
     101        link->next = list->next;
     102        link->prev = list;
     103        list->next->prev = link;
     104        list->next = link;
     105}
     106
     107/** Add item to the end of doubly-linked circular list
     108 *
     109 * Add item to the end of doubly-linked circular list.
     110 *
     111 * @param link Pointer to link_t structure to be added.
     112 * @param list Pointer to link_t structure representing the list.
     113 *
     114 */
     115NO_TRACE static inline void list_append(link_t *link, link_t *list)
     116{
     117        link->prev = list->prev;
     118        link->next = list;
     119        list->prev->next = link;
     120        list->prev = link;
    97121}
    98122
     
    100124 *
    101125 */
    102 static inline void list_insert_before(link_t *lnew, link_t *lold)
    103 {
    104         lnew->next = lold;
    105         lnew->prev = lold->prev;
    106         lold->prev->next = lnew;
    107         lold->prev = lnew;
     126static inline void list_insert_before(link_t *link, link_t *list)
     127{
     128        list_append(link, list);
    108129}
    109130
     
    111132 *
    112133 */
    113 static inline void list_insert_after(link_t *lnew, link_t *lold)
    114 {
    115         lnew->prev = lold;
    116         lnew->next = lold->next;
    117         lold->next->prev = lnew;
    118         lold->next = lnew;
    119 }
    120 
    121 /** Add item to the beginning of doubly-linked circular list
    122  *
    123  * Add item to the beginning of doubly-linked circular list.
    124  *
    125  * @param link Pointer to link_t structure to be added.
    126  * @param list Pointer to list_t structure.
    127  *
    128  */
    129 NO_TRACE static inline void list_prepend(link_t *link, list_t *list)
    130 {
    131         list_insert_after(link, &list->head);
    132 }
    133 
    134 /** Add item to the end of doubly-linked circular list
    135  *
    136  * Add item to the end of doubly-linked circular list.
    137  *
    138  * @param link Pointer to link_t structure to be added.
    139  * @param list Pointer to list_t structure.
    140  *
    141  */
    142 NO_TRACE static inline void list_append(link_t *link, list_t *list)
    143 {
    144         list_insert_before(link, &list->head);
     134static inline void list_insert_after(link_t *link, link_t *list)
     135{
     136        list_prepend(list, link);
    145137}
    146138
     
    164156 * Query emptiness of doubly-linked circular list.
    165157 *
    166  * @param list Pointer to lins_t structure.
    167  *
    168  */
    169 NO_TRACE static inline int list_empty(list_t *list)
    170 {
    171         return (list->head.next == &list->head);
    172 }
    173 
    174 /** Get first item in list.
    175  *
    176  * @param list Pointer to list_t structure.
     158 * @param list Pointer to link_t structure representing the list.
     159 *
     160 */
     161NO_TRACE static inline int list_empty(link_t *list)
     162{
     163        return (list->next == list);
     164}
     165
     166/** Get head item of a list.
     167 *
     168 * @param list Pointer to link_t structure representing the list.
    177169 *
    178170 * @return Head item of the list.
     
    180172 *
    181173 */
    182 static inline link_t *list_first(list_t *list)
    183 {
    184         return ((list->head.next == &list->head) ? NULL : list->head.next);
    185 }
    186 
    187 /** Get last item in list.
    188  *
    189  * @param list Pointer to list_t structure.
    190  *
    191  * @return Head item of the list.
    192  * @return NULL if the list is empty.
    193  *
    194  */
    195 static inline link_t *list_last(list_t *list)
    196 {
    197         return ((list->head.prev == &list->head) ? NULL : list->head.prev);
     174static inline link_t *list_head(link_t *list)
     175{
     176        return ((list->next == list) ? NULL : list->next);
    198177}
    199178
     
    252231}
    253232
    254 /** Get n-th item in a list.
     233/** Get n-th item of a list.
    255234 *
    256235 * @param list Pointer to link_t structure representing the list.
     
    261240 *
    262241 */
    263 static inline link_t *list_nth(list_t *list, unsigned int n)
     242static inline link_t *list_nth(link_t *list, unsigned int n)
    264243{
    265244        unsigned int cnt = 0;
     
    275254}
    276255
    277 extern int list_member(const link_t *, const list_t *);
    278 extern void list_concat(list_t *, list_t *);
    279 extern unsigned int list_count(const list_t *);
     256extern int list_member(const link_t *, const link_t *);
     257extern void list_concat(link_t *, link_t *);
     258extern unsigned int list_count(const link_t *);
    280259
    281260#endif
  • kernel/generic/include/console/chardev.h

    rbd08239 r313775b  
    8888        /** Fields suitable for multiplexing. */
    8989        link_t link;
    90         list_t list;
     90        link_t list;
    9191       
    9292        /** Implementation of outdev operations. */
  • kernel/generic/include/console/kconsole.h

    rbd08239 r313775b  
    9191
    9292SPINLOCK_EXTERN(cmd_lock);
    93 extern list_t cmd_list;
     93extern link_t cmd_head;
    9494
    9595extern void kconsole_init(void);
  • kernel/generic/include/cpu.h

    rbd08239 r313775b  
    5959       
    6060        IRQ_SPINLOCK_DECLARE(timeoutlock);
    61         list_t timeout_active_list;
     61        link_t timeout_active_head;
    6262       
    6363        /**
  • kernel/generic/include/ipc/ipc.h

    rbd08239 r313775b  
    166166       
    167167        /** Phones connected to this answerbox. */
    168         list_t connected_phones;
     168        link_t connected_phones;
    169169        /** Received calls. */
    170         list_t calls;
    171         list_t dispatched_calls;  /* Should be hash table in the future */
     170        link_t calls;
     171        link_t dispatched_calls;  /* Should be hash table in the future */
    172172       
    173173        /** Answered calls. */
    174         list_t answers;
     174        link_t answers;
    175175       
    176176        IRQ_SPINLOCK_DECLARE(irq_lock);
    177177       
    178178        /** Notifications from IRQ handlers. */
    179         list_t irq_notifs;
     179        link_t irq_notifs;
    180180        /** IRQs with notifications to this answerbox. */
    181         list_t irq_list;
     181        link_t irq_head;
    182182} answerbox_t;
    183183
     
    243243extern void ipc_backsend_err(phone_t *, call_t *, sysarg_t);
    244244extern void ipc_answerbox_slam_phones(answerbox_t *, bool);
    245 extern void ipc_cleanup_call_list(list_t *);
     245extern void ipc_cleanup_call_list(link_t *);
    246246
    247247extern void ipc_print_task(task_id_t);
  • kernel/generic/include/mm/as.h

    rbd08239 r313775b  
    254254
    255255extern as_operations_t *as_operations;
    256 extern list_t inactive_as_with_asid_list;
     256extern link_t inactive_as_with_asid_head;
    257257
    258258extern void as_init(void);
  • kernel/generic/include/mm/buddy.h

    rbd08239 r313775b  
    7272        /** Maximal order of block which can be stored by buddy system. */
    7373        uint8_t max_order;
    74         list_t *order;
     74        link_t *order;
    7575        buddy_system_operations_t *op;
    7676        /** Pointer to be used by the implementation. */
  • kernel/generic/include/mm/slab.h

    rbd08239 r313775b  
    111111       
    112112        /* Slabs */
    113         list_t full_slabs;     /**< List of full slabs */
    114         list_t partial_slabs;  /**< List of partial slabs */
     113        link_t full_slabs;     /**< List of full slabs */
     114        link_t partial_slabs;  /**< List of partial slabs */
    115115        SPINLOCK_DECLARE(slablock);
    116116        /* Magazines */
    117         list_t magazines;  /**< List o full magazines */
     117        link_t magazines;  /**< List o full magazines */
    118118        SPINLOCK_DECLARE(maglock);
    119119       
  • kernel/generic/include/proc/scheduler.h

    rbd08239 r313775b  
    4848typedef struct {
    4949        IRQ_SPINLOCK_DECLARE(lock);
    50         list_t rq;                      /**< List of ready threads. */
    51         size_t n;                       /**< Number of threads in rq_ready. */
     50        link_t rq_head;              /**< List of ready threads. */
     51        size_t n;                    /**< Number of threads in rq_ready. */
    5252} runq_t;
    5353
  • kernel/generic/include/proc/task.h

    rbd08239 r313775b  
    7373        char name[TASK_NAME_BUFLEN];
    7474        /** List of threads contained in this task. */
    75         list_t threads;
     75        link_t th_head;
    7676        /** Address space. */
    7777        as_t *as;
     
    9494        stats_ipc_t ipc_info;   /**< IPC statistics */
    9595        /** List of synchronous answerboxes. */
    96         list_t sync_boxes;
     96        link_t sync_box_head;
    9797       
    9898#ifdef CONFIG_UDEBUG
  • kernel/generic/include/synch/waitq.h

    rbd08239 r313775b  
    6363       
    6464        /** List of sleeping threads for which there was no missed_wakeup. */
    65         list_t sleepers;
     65        link_t head;
    6666} waitq_t;
    6767
  • kernel/generic/src/adt/btree.c

    rbd08239 r313775b  
    108108void btree_create(btree_t *t)
    109109{
    110         list_initialize(&t->leaf_list);
     110        list_initialize(&t->leaf_head);
    111111        t->root = (btree_node_t *) slab_alloc(btree_node_slab, 0);
    112112        node_initialize(t->root);
    113         list_append(&t->root->leaf_link, &t->leaf_list);
     113        list_append(&t->root->leaf_link, &t->leaf_head);
    114114}
    115115
     
    588588               
    589589                if (LEAF_NODE(node)) {
    590                         list_insert_after(&rnode->leaf_link, &node->leaf_link);
     590                        list_prepend(&rnode->leaf_link, &node->leaf_link);
    591591                }
    592592               
     
    953953        ASSERT(LEAF_NODE(node));
    954954       
    955         if (node->leaf_link.prev != &t->leaf_list.head)
     955        if (node->leaf_link.prev != &t->leaf_head)
    956956                return list_get_instance(node->leaf_link.prev, btree_node_t, leaf_link);
    957957        else
     
    972972        ASSERT(LEAF_NODE(node));
    973973       
    974         if (node->leaf_link.next != &t->leaf_list.head)
     974        if (node->leaf_link.next != &t->leaf_head)
    975975                return list_get_instance(node->leaf_link.next, btree_node_t, leaf_link);
    976976        else
     
    987987        size_t i;
    988988        int depth = t->root->depth;
    989         list_t list;
     989        link_t head, *cur;
    990990       
    991991        printf("Printing B-tree:\n");
    992         list_initialize(&list);
    993         list_append(&t->root->bfs_link, &list);
     992        list_initialize(&head);
     993        list_append(&t->root->bfs_link, &head);
    994994       
    995995        /*
     
    997997         * Levels are distinguished from one another by node->depth.
    998998         */
    999         while (!list_empty(&list)) {
     999        while (!list_empty(&head)) {
    10001000                link_t *hlp;
    10011001                btree_node_t *node;
    10021002               
    1003                 hlp = list_first(&list);
    1004                 ASSERT(hlp != NULL);
     1003                hlp = head.next;
     1004                ASSERT(hlp != &head);
    10051005                node = list_get_instance(hlp, btree_node_t, bfs_link);
    10061006                list_remove(hlp);
     
    10181018                        printf("%" PRIu64 "%s", node->key[i], i < node->keys - 1 ? "," : "");
    10191019                        if (node->depth && node->subtree[i]) {
    1020                                 list_append(&node->subtree[i]->bfs_link, &list);
     1020                                list_append(&node->subtree[i]->bfs_link, &head);
    10211021                        }
    10221022                }
    10231023               
    10241024                if (node->depth && node->subtree[i])
    1025                         list_append(&node->subtree[i]->bfs_link, &list);
     1025                        list_append(&node->subtree[i]->bfs_link, &head);
    10261026               
    10271027                printf(")");
     
    10311031       
    10321032        printf("Printing list of leaves:\n");
    1033         list_foreach(t->leaf_list, cur) {
     1033        for (cur = t->leaf_head.next; cur != &t->leaf_head; cur = cur->next) {
    10341034                btree_node_t *node;
    10351035               
  • kernel/generic/src/adt/hash_table.c

    rbd08239 r313775b  
    6262        ASSERT(max_keys > 0);
    6363       
    64         h->entry = (list_t *) malloc(m * sizeof(list_t), 0);
     64        h->entry = (link_t *) malloc(m * sizeof(link_t), 0);
    6565        if (!h->entry)
    6666                panic("Cannot allocate memory for hash table.");
    6767       
    68         memsetb(h->entry, m * sizeof(list_t), 0);
     68        memsetb(h->entry, m * sizeof(link_t), 0);
    6969       
    7070        for (i = 0; i < m; i++)
     
    107107link_t *hash_table_find(hash_table_t *h, sysarg_t key[])
    108108{
     109        link_t *cur;
    109110        size_t chain;
    110111       
     
    117118        ASSERT(chain < h->entries);
    118119       
    119         list_foreach(h->entry[chain], cur) {
     120        for (cur = h->entry[chain].next; cur != &h->entry[chain]; cur = cur->next) {
    120121                if (h->op->compare(key, h->max_keys, cur)) {
    121122                        /*
     
    140141{
    141142        size_t chain;
     143        link_t *cur;
    142144       
    143145        ASSERT(h);
     
    148150       
    149151        if (keys == h->max_keys) {
    150                 link_t *cur;
    151152       
    152153                /*
     
    168169         */
    169170        for (chain = 0; chain < h->entries; chain++) {
    170                 list_foreach(h->entry[chain], cur) {
     171                for (cur = h->entry[chain].next; cur != &h->entry[chain]; cur = cur->next) {
    171172                        if (h->op->compare(key, keys, cur)) {
    172173                                link_t *hlp;
  • kernel/generic/src/adt/list.c

    rbd08239 r313775b  
    4343/** Check for membership
    4444 *
    45  * Check whether link is contained in a list.
    46  * Membership is defined as pointer equivalence.
     45 * Check whether link is contained in the list head.
     46 * The membership is defined as pointer equivalence.
    4747 *
    48  * @param link  Item to look for.
    49  * @param list  List to look in.
     48 * @param link Item to look for.
     49 * @param head List to look in.
    5050 *
    5151 * @return true if link is contained in head, false otherwise.
    5252 *
    5353 */
    54 int list_member(const link_t *link, const list_t *list)
     54int list_member(const link_t *link, const link_t *head)
    5555{
    5656        bool found = false;
    57         link_t *hlp = list->head.next;
     57        link_t *hlp = head->next;
    5858       
    59         while (hlp != &list->head) {
     59        while (hlp != head) {
    6060                if (hlp == link) {
    6161                        found = true;
     
    6868}
    6969
     70
    7071/** Concatenate two lists
    7172 *
    72  * Concatenate lists @a list1 and @a list2, producing a single
    73  * list @a list1 containing items from both (in @a list1, @a list2
    74  * order) and empty list @a list2.
     73 * Concatenate lists head1 and head2, producing a single
     74 * list head1 containing items from both (in head1, head2
     75 * order) and empty list head2.
    7576 *
    76  * @param list1         First list and concatenated output
    77  * @param list2         Second list and empty output.
     77 * @param head1 First list and concatenated output
     78 * @param head2 Second list and empty output.
    7879 *
    7980 */
    80 void list_concat(list_t *list1, list_t *list2)
     81void list_concat(link_t *head1, link_t *head2)
    8182{
    82         if (list_empty(list2))
     83        if (list_empty(head2))
    8384                return;
    8485
    85         list2->head.next->prev = list1->head.prev;
    86         list2->head.prev->next = &list1->head;
    87         list1->head.prev->next = list2->head.next;
    88         list1->head.prev = list2->head.prev;
    89         list_initialize(list2);
     86        head2->next->prev = head1->prev;
     87        head2->prev->next = head1;     
     88        head1->prev->next = head2->next;
     89        head1->prev = head2->prev;
     90        list_initialize(head2);
    9091}
    9192
  • kernel/generic/src/console/cmd.c

    rbd08239 r313775b  
    573573        spinlock_lock(&cmd_lock);
    574574       
     575        link_t *cur;
    575576        size_t len = 0;
    576         list_foreach(cmd_list, cur) {
     577        for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
    577578                cmd_info_t *hlp;
    578579                hlp = list_get_instance(cur, cmd_info_t, link);
     
    590591        }
    591592       
    592         list_foreach(cmd_list, cur) {
     593        for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
    593594                cmd_info_t *hlp;
    594595                hlp = list_get_instance(cur, cmd_info_t, link);
     
    645646int cmd_desc(cmd_arg_t *argv)
    646647{
     648        link_t *cur;
     649       
    647650        spinlock_lock(&cmd_lock);
    648651       
    649         list_foreach(cmd_list, cur) {
     652        for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
    650653                cmd_info_t *hlp;
    651654               
  • kernel/generic/src/console/console.c

    rbd08239 r313775b  
    124124static void stdout_write(outdev_t *dev, wchar_t ch, bool silent)
    125125{
    126         list_foreach(dev->list, cur) {
     126        link_t *cur;
     127       
     128        for (cur = dev->list.next; cur != &dev->list; cur = cur->next) {
    127129                outdev_t *sink = list_get_instance(cur, outdev_t, link);
    128130                if ((sink) && (sink->op->write))
     
    133135static void stdout_redraw(outdev_t *dev)
    134136{
    135         list_foreach(dev->list, cur) {
     137        link_t *cur;
     138       
     139        for (cur = dev->list.next; cur != &dev->list; cur = cur->next) {
    136140                outdev_t *sink = list_get_instance(cur, outdev_t, link);
    137141                if ((sink) && (sink->op->redraw))
  • kernel/generic/src/console/kconsole.c

    rbd08239 r313775b  
    8484
    8585SPINLOCK_INITIALIZE(cmd_lock);  /**< Lock protecting command list. */
    86 LIST_INITIALIZE(cmd_list);      /**< Command list. */
     86LIST_INITIALIZE(cmd_head);      /**< Command list. */
    8787
    8888static wchar_t history[KCONSOLE_HISTORY][MAX_CMDLINE] = {};
     
    113113bool cmd_register(cmd_info_t *cmd)
    114114{
     115        link_t *cur;
     116       
    115117        spinlock_lock(&cmd_lock);
    116118       
     
    118120         * Make sure the command is not already listed.
    119121         */
    120         list_foreach(cmd_list, cur) {
     122        for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
    121123                cmd_info_t *hlp = list_get_instance(cur, cmd_info_t, link);
    122124               
     
    151153         * Now the command can be added.
    152154         */
    153         list_append(&cmd->link, &cmd_list);
     155        list_append(&cmd->link, &cmd_head);
    154156       
    155157        spinlock_unlock(&cmd_lock);
     
    174176       
    175177        if (*startpos == NULL)
    176                 *startpos = cmd_list.head.next;
    177        
    178         for (; *startpos != &cmd_list.head; *startpos = (*startpos)->next) {
     178                *startpos = cmd_head.next;
     179       
     180        for (; *startpos != &cmd_head; *startpos = (*startpos)->next) {
    179181                cmd_info_t *hlp = list_get_instance(*startpos, cmd_info_t, link);
    180182               
     
    557559       
    558560        cmd_info_t *cmd = NULL;
    559        
    560         list_foreach(cmd_list, cur) {
     561        link_t *cur;
     562       
     563        for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
    561564                cmd_info_t *hlp = list_get_instance(cur, cmd_info_t, link);
    562565                spinlock_lock(&hlp->lock);
  • kernel/generic/src/cpu/cpu.c

    rbd08239 r313775b  
    8282                        for (j = 0; j < RQ_COUNT; j++) {
    8383                                irq_spinlock_initialize(&cpus[i].rq[j].lock, "cpus[].rq[].lock");
    84                                 list_initialize(&cpus[i].rq[j].rq);
     84                                list_initialize(&cpus[i].rq[j].rq_head);
    8585                        }
    8686                }
  • kernel/generic/src/ipc/ipc.c

    rbd08239 r313775b  
    128128        list_initialize(&box->answers);
    129129        list_initialize(&box->irq_notifs);
    130         list_initialize(&box->irq_list);
     130        list_initialize(&box->irq_head);
    131131        box->task = task;
    132132}
     
    183183         */
    184184        irq_spinlock_lock(&TASK->lock, true);
    185         list_append(&sync_box->sync_box_link, &TASK->sync_boxes);
     185        list_append(&sync_box->sync_box_link, &TASK->sync_box_head);
    186186        irq_spinlock_unlock(&TASK->lock, true);
    187187       
     
    450450                irq_spinlock_lock(&box->irq_lock, false);
    451451               
    452                 request = list_get_instance(list_first(&box->irq_notifs),
    453                     call_t, link);
     452                request = list_get_instance(box->irq_notifs.next, call_t, link);
    454453                list_remove(&request->link);
    455454               
     
    460459               
    461460                /* Handle asynchronous answers */
    462                 request = list_get_instance(list_first(&box->answers),
    463                     call_t, link);
     461                request = list_get_instance(box->answers.next, call_t, link);
    464462                list_remove(&request->link);
    465463                atomic_dec(&request->data.phone->active_calls);
     
    469467               
    470468                /* Handle requests */
    471                 request = list_get_instance(list_first(&box->calls),
    472                     call_t, link);
     469                request = list_get_instance(box->calls.next, call_t, link);
    473470                list_remove(&request->link);
    474471               
     
    497494 *
    498495 */
    499 void ipc_cleanup_call_list(list_t *lst)
     496void ipc_cleanup_call_list(link_t *lst)
    500497{
    501498        while (!list_empty(lst)) {
    502                 call_t *call = list_get_instance(list_first(lst), call_t, link);
     499                call_t *call = list_get_instance(lst->next, call_t, link);
    503500                if (call->buffer)
    504501                        free(call->buffer);
     
    529526        irq_spinlock_lock(&box->lock, true);
    530527        while (!list_empty(&box->connected_phones)) {
    531                 phone = list_get_instance(list_first(&box->connected_phones),
     528                phone = list_get_instance(box->connected_phones.next,
    532529                    phone_t, link);
    533530                if (SYNCH_FAILED(mutex_trylock(&phone->lock))) {
     
    609606        /* Wait for all answers to interrupted synchronous calls to arrive */
    610607        ipl_t ipl = interrupts_disable();
    611         while (!list_empty(&TASK->sync_boxes)) {
    612                 answerbox_t *box = list_get_instance(
    613                     list_first(&TASK->sync_boxes), answerbox_t, sync_box_link);
     608        while (!list_empty(&TASK->sync_box_head)) {
     609                answerbox_t *box = list_get_instance(TASK->sync_box_head.next,
     610                    answerbox_t, sync_box_link);
    614611               
    615612                list_remove(&box->sync_box_link);
     
    746743#endif
    747744       
     745        link_t *cur;
     746       
    748747        printf(" --- incomming calls ---\n");
    749         list_foreach(task->answerbox.calls, cur) {
     748        for (cur = task->answerbox.calls.next; cur != &task->answerbox.calls;
     749            cur = cur->next) {
    750750                call_t *call = list_get_instance(cur, call_t, link);
    751751               
     
    767767       
    768768        printf(" --- dispatched calls ---\n");
    769         list_foreach(task->answerbox.dispatched_calls, cur) {
     769        for (cur = task->answerbox.dispatched_calls.next;
     770            cur != &task->answerbox.dispatched_calls;
     771            cur = cur->next) {
    770772                call_t *call = list_get_instance(cur, call_t, link);
    771773               
     
    787789       
    788790        printf(" --- incoming answers ---\n");
    789         list_foreach(task->answerbox.answers, cur) {
     791        for (cur = task->answerbox.answers.next;
     792            cur != &task->answerbox.answers;
     793            cur = cur->next) {
    790794                call_t *call = list_get_instance(cur, call_t, link);
    791795               
  • kernel/generic/src/ipc/ipcrsc.c

    rbd08239 r313775b  
    146146call_t *get_call(sysarg_t callid)
    147147{
     148        link_t *lst;
    148149        call_t *result = NULL;
    149150       
    150151        irq_spinlock_lock(&TASK->answerbox.lock, true);
    151        
    152         list_foreach(TASK->answerbox.dispatched_calls, lst) {
     152        for (lst = TASK->answerbox.dispatched_calls.next;
     153            lst != &TASK->answerbox.dispatched_calls; lst = lst->next) {
    153154                call_t *call = list_get_instance(lst, call_t, link);
    154155                if ((sysarg_t) call == callid) {
  • kernel/generic/src/ipc/irq.c

    rbd08239 r313775b  
    200200       
    201201        hash_table_insert(&irq_uspace_hash_table, key, &irq->link);
    202         list_append(&irq->notif_cfg.link, &box->irq_list);
     202        list_append(&irq->notif_cfg.link, &box->irq_head);
    203203       
    204204        irq_spinlock_unlock(&box->irq_lock, false);
     
    282282        irq_spinlock_lock(&box->irq_lock, false);
    283283       
    284         while (!list_empty(&box->irq_list)) {
     284        while (box->irq_head.next != &box->irq_head) {
    285285                DEADLOCK_PROBE_INIT(p_irqlock);
    286286               
    287                 irq_t *irq = list_get_instance(list_first(&box->irq_list), irq_t,
     287                irq_t *irq = list_get_instance(box->irq_head.next, irq_t,
    288288                    notif_cfg.link);
    289289               
  • kernel/generic/src/mm/as.c

    rbd08239 r313775b  
    9494 *
    9595 * This lock protects:
    96  * - inactive_as_with_asid_list
     96 * - inactive_as_with_asid_head list
    9797 * - as->asid for each as of the as_t type
    9898 * - asids_allocated counter
     
    105105 * that have valid ASID.
    106106 */
    107 LIST_INITIALIZE(inactive_as_with_asid_list);
     107LIST_INITIALIZE(inactive_as_with_asid_head);
    108108
    109109/** Kernel address space. */
     
    235235        bool cond = true;
    236236        while (cond) {
    237                 ASSERT(!list_empty(&as->as_area_btree.leaf_list));
     237                ASSERT(!list_empty(&as->as_area_btree.leaf_head));
    238238               
    239239                btree_node_t *node =
    240                     list_get_instance(list_first(&as->as_area_btree.leaf_list),
     240                    list_get_instance(as->as_area_btree.leaf_head.next,
    241241                    btree_node_t, leaf_link);
    242242               
     
    602602                bool cond = true;
    603603                while (cond) {
    604                         ASSERT(!list_empty(&area->used_space.leaf_list));
     604                        ASSERT(!list_empty(&area->used_space.leaf_head));
    605605                       
    606606                        btree_node_t *node =
    607                             list_get_instance(list_last(&area->used_space.leaf_list),
     607                            list_get_instance(area->used_space.leaf_head.prev,
    608608                            btree_node_t, leaf_link);
    609609                       
     
    727727        if (--sh_info->refcount == 0) {
    728728                dealloc = true;
     729                link_t *cur;
    729730               
    730731                /*
     
    732733                 * reference from all frames found there.
    733734                 */
    734                 list_foreach(sh_info->pagemap.leaf_list, cur) {
     735                for (cur = sh_info->pagemap.leaf_head.next;
     736                    cur != &sh_info->pagemap.leaf_head; cur = cur->next) {
    735737                        btree_node_t *node
    736738                            = list_get_instance(cur, btree_node_t, leaf_link);
     
    784786         * Visit only the pages mapped by used_space B+tree.
    785787         */
    786         list_foreach(area->used_space.leaf_list, cur) {
     788        link_t *cur;
     789        for (cur = area->used_space.leaf_head.next;
     790            cur != &area->used_space.leaf_head; cur = cur->next) {
    787791                btree_node_t *node;
    788792                btree_key_t i;
     
    10611065         */
    10621066        size_t used_pages = 0;
    1063        
    1064         list_foreach(area->used_space.leaf_list, cur) {
     1067        link_t *cur;
     1068       
     1069        for (cur = area->used_space.leaf_head.next;
     1070            cur != &area->used_space.leaf_head; cur = cur->next) {
    10651071                btree_node_t *node
    10661072                    = list_get_instance(cur, btree_node_t, leaf_link);
     
    10881094        size_t frame_idx = 0;
    10891095       
    1090         list_foreach(area->used_space.leaf_list, cur) {
     1096        for (cur = area->used_space.leaf_head.next;
     1097            cur != &area->used_space.leaf_head; cur = cur->next) {
    10911098                btree_node_t *node = list_get_instance(cur, btree_node_t,
    10921099                    leaf_link);
     
    11401147        frame_idx = 0;
    11411148       
    1142         list_foreach(area->used_space.leaf_list, cur) {
     1149        for (cur = area->used_space.leaf_head.next;
     1150            cur != &area->used_space.leaf_head; cur = cur->next) {
    11431151                btree_node_t *node
    11441152                    = list_get_instance(cur, btree_node_t, leaf_link);
     
    13261334                       
    13271335                        list_append(&old_as->inactive_as_with_asid_link,
    1328                             &inactive_as_with_asid_list);
     1336                            &inactive_as_with_asid_head);
    13291337                }
    13301338               
     
    20192027       
    20202028        /* Eventually check the addresses behind each area */
    2021         list_foreach(AS->as_area_btree.leaf_list, cur) {
    2022                 if (ret != 0)
    2023                         break;
    2024 
     2029        link_t *cur;
     2030        for (cur = AS->as_area_btree.leaf_head.next;
     2031            (ret == 0) && (cur != &AS->as_area_btree.leaf_head);
     2032            cur = cur->next) {
    20252033                btree_node_t *node =
    20262034                    list_get_instance(cur, btree_node_t, leaf_link);
     
    20642072       
    20652073        size_t area_cnt = 0;
    2066        
    2067         list_foreach(as->as_area_btree.leaf_list, cur) {
     2074        link_t *cur;
     2075       
     2076        for (cur = as->as_area_btree.leaf_head.next;
     2077            cur != &as->as_area_btree.leaf_head; cur = cur->next) {
    20682078                btree_node_t *node =
    20692079                    list_get_instance(cur, btree_node_t, leaf_link);
     
    20782088        size_t area_idx = 0;
    20792089       
    2080         list_foreach(as->as_area_btree.leaf_list, cur) {
     2090        for (cur = as->as_area_btree.leaf_head.next;
     2091            cur != &as->as_area_btree.leaf_head; cur = cur->next) {
    20812092                btree_node_t *node =
    20822093                    list_get_instance(cur, btree_node_t, leaf_link);
     
    21142125       
    21152126        /* Print out info about address space areas */
    2116         list_foreach(as->as_area_btree.leaf_list, cur) {
     2127        link_t *cur;
     2128        for (cur = as->as_area_btree.leaf_head.next;
     2129            cur != &as->as_area_btree.leaf_head; cur = cur->next) {
    21172130                btree_node_t *node
    21182131                    = list_get_instance(cur, btree_node_t, leaf_link);
  • kernel/generic/src/mm/backend_anon.c

    rbd08239 r313775b  
    9797void anon_share(as_area_t *area)
    9898{
     99        link_t *cur;
     100
    99101        ASSERT(mutex_locked(&area->as->lock));
    100102        ASSERT(mutex_locked(&area->lock));
     
    104106         */
    105107        mutex_lock(&area->sh_info->lock);
    106         list_foreach(area->used_space.leaf_list, cur) {
     108        for (cur = area->used_space.leaf_head.next;
     109            cur != &area->used_space.leaf_head; cur = cur->next) {
    107110                btree_node_t *node;
    108111                unsigned int i;
  • kernel/generic/src/mm/backend_elf.c

    rbd08239 r313775b  
    139139         */
    140140        if (area->flags & AS_AREA_WRITE) {
    141                 node = list_get_instance(list_first(&area->used_space.leaf_list),
     141                node = list_get_instance(area->used_space.leaf_head.next,
    142142                    btree_node_t, leaf_link);
    143143        } else {
     
    153153         */
    154154        mutex_lock(&area->sh_info->lock);
    155         for (cur = &node->leaf_link; cur != &area->used_space.leaf_list.head;
     155        for (cur = &node->leaf_link; cur != &area->used_space.leaf_head;
    156156            cur = cur->next) {
    157157                unsigned int i;
  • kernel/generic/src/mm/buddy.c

    rbd08239 r313775b  
    8282         * Use memory after our own structure.
    8383         */
    84         b->order = (list_t *) (&b[1]);
     84        b->order = (link_t *) (&b[1]);
    8585       
    8686        for (i = 0; i <= max_order; i++)
     
    176176         * the request can be immediatelly satisfied.
    177177         */
    178         res = list_first(&b->order[i]);
    179         if (res != NULL) {
     178        if (!list_empty(&b->order[i])) {
     179                res = b->order[i].next;
    180180                list_remove(res);
    181181                b->op->mark_busy(b, res);
  • kernel/generic/src/mm/slab.c

    rbd08239 r313775b  
    317317                spinlock_lock(&cache->slablock);
    318318        } else {
    319                 slab = list_get_instance(list_first(&cache->partial_slabs),
    320                     slab_t, link);
     319                slab = list_get_instance(cache->partial_slabs.next, slab_t,
     320                    link);
    321321                list_remove(&slab->link);
    322322        }
     
    360360        if (!list_empty(&cache->magazines)) {
    361361                if (first)
    362                         cur = list_first(&cache->magazines);
     362                        cur = cache->magazines.next;
    363363                else
    364                         cur = list_last(&cache->magazines);
     364                        cur = cache->magazines.prev;
    365365               
    366366                mag = list_get_instance(cur, slab_magazine_t, link);
     
    812812       
    813813        size_t frames = 0;
    814         list_foreach(slab_cache_list, cur) {
     814        link_t *cur;
     815        for (cur = slab_cache_list.next; cur != &slab_cache_list;
     816            cur = cur->next) {
    815817                slab_cache_t *cache = list_get_instance(cur, slab_cache_t, link);
    816818                frames += _slab_reclaim(cache, flags);
     
    859861                link_t *cur;
    860862                size_t i;
    861                 for (i = 0, cur = slab_cache_list.head.next;
    862                     (i < skip) && (cur != &slab_cache_list.head);
     863                for (i = 0, cur = slab_cache_list.next;
     864                    (i < skip) && (cur != &slab_cache_list);
    863865                    i++, cur = cur->next);
    864866               
    865                 if (cur == &slab_cache_list.head) {
     867                if (cur == &slab_cache_list) {
    866868                        irq_spinlock_unlock(&slab_cache_lock, true);
    867869                        break;
     
    938940        irq_spinlock_lock(&slab_cache_lock, false);
    939941       
    940         list_foreach(slab_cache_list, cur) {
     942        link_t *cur;
     943        for (cur = slab_cache_list.next; cur != &slab_cache_list;
     944            cur = cur->next) {
    941945                slab_cache_t *slab = list_get_instance(cur, slab_cache_t, link);
    942946                if ((slab->flags & SLAB_CACHE_MAGDEFERRED) !=
  • kernel/generic/src/proc/scheduler.c

    rbd08239 r313775b  
    237237                 * Take the first thread from the queue.
    238238                 */
    239                 thread_t *thread = list_get_instance(
    240                     list_first(&CPU->rq[i].rq), thread_t, rq_link);
     239                thread_t *thread =
     240                    list_get_instance(CPU->rq[i].rq_head.next, thread_t, rq_link);
    241241                list_remove(&thread->rq_link);
    242242               
     
    273273static void relink_rq(int start)
    274274{
    275         list_t list;
    276        
    277         list_initialize(&list);
     275        link_t head;
     276       
     277        list_initialize(&head);
    278278        irq_spinlock_lock(&CPU->lock, false);
    279279       
     
    284284                       
    285285                        irq_spinlock_lock(&CPU->rq[i + 1].lock, false);
    286                         list_concat(&list, &CPU->rq[i + 1].rq);
     286                        list_concat(&head, &CPU->rq[i + 1].rq_head);
    287287                        size_t n = CPU->rq[i + 1].n;
    288288                        CPU->rq[i + 1].n = 0;
     
    292292                       
    293293                        irq_spinlock_lock(&CPU->rq[i].lock, false);
    294                         list_concat(&CPU->rq[i].rq, &list);
     294                        list_concat(&CPU->rq[i].rq_head, &head);
    295295                        CPU->rq[i].n += n;
    296296                        irq_spinlock_unlock(&CPU->rq[i].lock, false);
     
    616616                       
    617617                        /* Search rq from the back */
    618                         link_t *link = cpu->rq[rq].rq.head.prev;
    619                        
    620                         while (link != &(cpu->rq[rq].rq.head)) {
     618                        link_t *link = cpu->rq[rq].rq_head.prev;
     619                       
     620                        while (link != &(cpu->rq[rq].rq_head)) {
    621621                                thread = (thread_t *) list_get_instance(link,
    622622                                    thread_t, rq_link);
     
    740740                       
    741741                        printf("\trq[%u]: ", i);
    742                         list_foreach(cpus[cpu].rq[i].rq, cur) {
    743                                 thread_t *thread = list_get_instance(cur,
    744                                     thread_t, rq_link);
     742                        link_t *cur;
     743                        for (cur = cpus[cpu].rq[i].rq_head.next;
     744                            cur != &(cpus[cpu].rq[i].rq_head);
     745                            cur = cur->next) {
     746                                thread_t *thread = list_get_instance(cur, thread_t, rq_link);
    745747                                printf("%" PRIu64 "(%s) ", thread->tid,
    746748                                    thread_states[thread->state]);
  • kernel/generic/src/proc/task.c

    rbd08239 r313775b  
    155155        mutex_initialize(&task->futexes_lock, MUTEX_PASSIVE);
    156156       
    157         list_initialize(&task->threads);
    158         list_initialize(&task->sync_boxes);
     157        list_initialize(&task->th_head);
     158        list_initialize(&task->sync_box_head);
    159159       
    160160        ipc_answerbox_init(&task->answerbox, task);
     
    435435       
    436436        /* Current values of threads */
    437         list_foreach(task->threads, cur) {
     437        link_t *cur;
     438        for (cur = task->th_head.next; cur != &task->th_head; cur = cur->next) {
    438439                thread_t *thread = list_get_instance(cur, thread_t, th_link);
    439440               
     
    467468         */
    468469       
    469         list_foreach(task->threads, cur) {
     470        link_t *cur;
     471        for (cur = task->th_head.next; cur != &task->th_head; cur = cur->next) {
    470472                thread_t *thread = list_get_instance(cur, thread_t, th_link);
    471473                bool sleeping = false;
  • kernel/generic/src/proc/thread.c

    rbd08239 r313775b  
    260260         */
    261261       
    262         list_append(&thread->rq_link, &cpu->rq[i].rq);
     262        list_append(&thread->rq_link, &cpu->rq[i].rq_head);
    263263        cpu->rq[i].n++;
    264264        irq_spinlock_unlock(&(cpu->rq[i].lock), true);
     
    423423                atomic_inc(&task->lifecount);
    424424       
    425         list_append(&thread->th_link, &task->threads);
     425        list_append(&thread->th_link, &task->th_head);
    426426       
    427427        irq_spinlock_pass(&task->lock, &threads_lock);
  • kernel/generic/src/synch/futex.c

    rbd08239 r313775b  
    272272void futex_cleanup(void)
    273273{
     274        link_t *cur;
     275       
    274276        mutex_lock(&futex_ht_lock);
    275277        mutex_lock(&TASK->futexes_lock);
    276278
    277         list_foreach(TASK->futexes.leaf_list, cur) {
     279        for (cur = TASK->futexes.leaf_head.next;
     280            cur != &TASK->futexes.leaf_head; cur = cur->next) {
    278281                btree_node_t *node;
    279282                unsigned int i;
  • kernel/generic/src/synch/waitq.c

    rbd08239 r313775b  
    6969{
    7070        irq_spinlock_initialize(&wq->lock, "wq.lock");
    71         list_initialize(&wq->sleepers);
     71        list_initialize(&wq->head);
    7272        wq->missed_wakeups = 0;
    7373}
     
    196196        irq_spinlock_lock(&wq->lock, true);
    197197       
    198         if (!list_empty(&wq->sleepers)) {
    199                 thread_t *thread = list_get_instance(list_first(&wq->sleepers),
    200                     thread_t, wq_link);
     198        if (!list_empty(&wq->head)) {
     199                thread_t *thread = list_get_instance(wq->head.next, thread_t, wq_link);
    201200               
    202201                irq_spinlock_lock(&thread->lock, false);
     
    408407        }
    409408       
    410         list_append(&THREAD->wq_link, &wq->sleepers);
     409        list_append(&THREAD->wq_link, &wq->head);
    411410       
    412411        /*
     
    465464       
    466465loop:
    467         if (list_empty(&wq->sleepers)) {
     466        if (list_empty(&wq->head)) {
    468467                wq->missed_wakeups++;
    469468                if ((count) && (mode == WAKEUP_ALL))
     
    474473       
    475474        count++;
    476         thread_t *thread = list_get_instance(list_first(&wq->sleepers),
    477             thread_t, wq_link);
     475        thread_t *thread = list_get_instance(wq->head.next, thread_t, wq_link);
    478476       
    479477        /*
  • kernel/generic/src/sysinfo/stats.c

    rbd08239 r313775b  
    173173       
    174174        /* Walk the B+ tree and count pages */
    175         list_foreach(as->as_area_btree.leaf_list, cur) {
     175        link_t *cur;
     176        for (cur = as->as_area_btree.leaf_head.next;
     177            cur != &as->as_area_btree.leaf_head; cur = cur->next) {
    176178                btree_node_t *node =
    177179                    list_get_instance(cur, btree_node_t, leaf_link);
     
    216218       
    217219        /* Walk the B+ tree and count pages */
    218         list_foreach(as->as_area_btree.leaf_list, cur) {
     220        link_t *cur;
     221        for (cur = as->as_area_btree.leaf_head.next;
     222            cur != &as->as_area_btree.leaf_head; cur = cur->next) {
    219223                btree_node_t *node =
    220224                    list_get_instance(cur, btree_node_t, leaf_link);
  • kernel/generic/src/time/clock.c

    rbd08239 r313775b  
    163163               
    164164                link_t *cur;
    165                 while ((cur = list_first(&CPU->timeout_active_list)) != NULL) {
    166                         timeout_t *timeout = list_get_instance(cur, timeout_t,
    167                             link);
     165                while ((cur = CPU->timeout_active_head.next) != &CPU->timeout_active_head) {
     166                        timeout_t *timeout = list_get_instance(cur, timeout_t, link);
    168167                       
    169168                        irq_spinlock_lock(&timeout->lock, false);
  • kernel/generic/src/time/timeout.c

    rbd08239 r313775b  
    5454{
    5555        irq_spinlock_initialize(&CPU->timeoutlock, "cpu.timeoutlock");
    56         list_initialize(&CPU->timeout_active_list);
     56        list_initialize(&CPU->timeout_active_head);
    5757}
    5858
     
    119119        timeout_t *target = NULL;
    120120        link_t *cur;
    121         for (cur = CPU->timeout_active_list.head.next;
    122             cur != &CPU->timeout_active_list.head; cur = cur->next) {
     121        for (cur = CPU->timeout_active_head.next;
     122            cur != &CPU->timeout_active_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_insert_after(&timeout->link, prev);
     137        list_prepend(&timeout->link, prev);
    138138       
    139139        /*
     
    146146         * Decrease ticks of timeout's immediate succesor by timeout->ticks.
    147147         */
    148         if (cur != &CPU->timeout_active_list.head) {
     148        if (cur != &CPU->timeout_active_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_list.
     186         * and is lurking in timeout->cpu->timeout_active_head queue.
    187187         */
    188188       
    189189        link_t *cur = timeout->link.next;
    190         if (cur != &timeout->cpu->timeout_active_list.head) {
     190        if (cur != &timeout->cpu->timeout_active_head) {
    191191                timeout_t *tmp = list_get_instance(cur, timeout_t, link);
    192192                irq_spinlock_lock(&tmp->lock, false);
  • kernel/generic/src/udebug/udebug.c

    rbd08239 r313775b  
    406406       
    407407        /* Finish debugging of all userspace threads */
    408         list_foreach(task->threads, cur) {
     408        link_t *cur;
     409        for (cur = task->th_head.next; cur != &task->th_head; cur = cur->next) {
    409410                thread_t *thread = list_get_instance(cur, thread_t, th_link);
    410411               
  • kernel/generic/src/udebug/udebug_ops.c

    rbd08239 r313775b  
    196196        /* Set udebug.active on all of the task's userspace threads. */
    197197       
    198         list_foreach(TASK->threads, cur) {
     198        link_t *cur;
     199        for (cur = TASK->th_head.next; cur != &TASK->th_head; cur = cur->next) {
    199200                thread_t *thread = list_get_instance(cur, thread_t, th_link);
    200201               
     
    389390       
    390391        /* FIXME: make sure the thread isn't past debug shutdown... */
    391         list_foreach(TASK->threads, cur) {
     392        link_t *cur;
     393        for (cur = TASK->th_head.next; cur != &TASK->th_head; cur = cur->next) {
    392394                thread_t *thread = list_get_instance(cur, thread_t, th_link);
    393395               
  • uspace/lib/usbhid/src/hiddescriptor.c

    rbd08239 r313775b  
    9191                usb_hid_report_t *report, usb_hid_report_path_t *cmp_path) {
    9292       
    93         link_t *path_it = report->collection_paths.next;
     93        link_t *path_it = report->collection_paths.prev->next;
    9494        usb_hid_report_path_t *path = NULL;
    9595       
     
    513513
    514514                                usb_hid_report_path_free(report_item->usage_path);
     515                                list_initialize(&report_item->usage_path->link);
    515516                                list_remove (stack.next);
    516517                                       
Note: See TracChangeset for help on using the changeset viewer.