Ticket #292: patch_list_t

File patch_list_t, 79.5 KB (added by shm, 13 years ago)

list_t patch

Line 
1diff -rup HelenOS-0.4.3/uspace/app/edit/sheet.c HelenOS-0.4.3.new/uspace/app/edit/sheet.c
2--- HelenOS-0.4.3/uspace/app/edit/sheet.c 2011-03-26 16:30:19.000000000 +0100
3+++ HelenOS-0.4.3.new/uspace/app/edit/sheet.c 2011-04-02 20:04:36.000000000 +0200
4@@ -120,8 +120,8 @@ int sheet_insert(sheet_t *sh, spt_t *pos
5
6 /* Adjust tags. */
7
8- link = sh->tags_head.next;
9- while (link != &sh->tags_head) {
10+ link = sh->tags_head.head.next;
11+ while (link != &sh->tags_head.head) {
12 tag = list_get_instance(link, tag_t, link);
13
14 if (tag->b_off > pos->b_off)
15@@ -161,8 +161,8 @@ int sheet_delete(sheet_t *sh, spt_t *spo
16 sh->text_size -= sz;
17
18 /* Adjust tags. */
19- link = sh->tags_head.next;
20- while (link != &sh->tags_head) {
21+ link = sh->tags_head.head.next;
22+ while (link != &sh->tags_head.head) {
23 tag = list_get_instance(link, tag_t, link);
24
25 if (tag->b_off >= epos->b_off)
26diff -rup HelenOS-0.4.3/uspace/app/edit/sheet.h HelenOS-0.4.3.new/uspace/app/edit/sheet.h
27--- HelenOS-0.4.3/uspace/app/edit/sheet.h 2011-03-26 16:30:19.000000000 +0100
28+++ HelenOS-0.4.3.new/uspace/app/edit/sheet.h 2011-04-02 20:04:03.000000000 +0200
29@@ -1,5 +1,6 @@
30 /*
31 * Copyright (c) 2009 Jiri Svoboda
32+ * Copyright (c) 2011 Mateusz Kocielski
33 * All rights reserved.
34 *
35 * Redistribution and use in source and binary forms, with or without
36@@ -56,7 +57,7 @@ typedef struct {
37 size_t dbuf_size;
38 char *data;
39
40- link_t tags_head;
41+ list_t tags_head;
42 } sheet_t;
43
44 /** Character cell coordinates
45diff -rup HelenOS-0.4.3/uspace/app/sbi/src/intmap_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/intmap_t.h
46--- HelenOS-0.4.3/uspace/app/sbi/src/intmap_t.h 2011-03-26 16:30:19.000000000 +0100
47+++ HelenOS-0.4.3.new/uspace/app/sbi/src/intmap_t.h 2011-04-02 20:13:23.000000000 +0200
48@@ -37,7 +37,7 @@ typedef struct {
49 } map_elem_t;
50
51 typedef struct intmap {
52- list_t elem; /* of (map_elem_t *) */
53+ list_head_t elem; /* of (map_elem_t *) */
54 } intmap_t;
55
56 #endif
57diff -rup HelenOS-0.4.3/uspace/app/sbi/src/list.c HelenOS-0.4.3.new/uspace/app/sbi/src/list.c
58--- HelenOS-0.4.3/uspace/app/sbi/src/list.c 2011-03-26 16:30:19.000000000 +0100
59+++ HelenOS-0.4.3.new/uspace/app/sbi/src/list.c 2011-04-02 20:13:23.000000000 +0200
60@@ -44,13 +44,13 @@ static list_node_t *list_node_new(void *
61 static void list_node_delete(list_node_t *node);
62 static void list_node_insert_between(list_node_t *n, list_node_t *a, list_node_t *b);
63 static void list_node_unlink(list_node_t *n);
64-static bool_t list_node_present(list_t *list, list_node_t *node);
65+static bool_t list_node_present(list_head_t *list, list_node_t *node);
66
67 /** Initialize list.
68 *
69 * @param list List to initialize.
70 */
71-void list_init(list_t *list)
72+void list_init(list_head_t *list)
73 {
74 list->head.prev = &list->head;
75 list->head.next = &list->head;
76@@ -60,7 +60,7 @@ void list_init(list_t *list)
77 *
78 * @param list List to deinitialize.
79 */
80-void list_fini(list_t *list)
81+void list_fini(list_head_t *list)
82 {
83 assert(list_is_empty(list));
84
85@@ -75,7 +75,7 @@ void list_fini(list_t *list)
86 * @param list Linked list.
87 * @param data Data for the new node.
88 */
89-void list_append(list_t *list, void *data)
90+void list_append(list_head_t *list, void *data)
91 {
92 list_node_t *node;
93
94@@ -90,7 +90,7 @@ void list_append(list_t *list, void *dat
95 * @param list Linked list.
96 * @param data Data for the new node.
97 */
98-void list_prepend(list_t *list, void *data)
99+void list_prepend(list_head_t *list, void *data)
100 {
101 list_node_t *node;
102
103@@ -107,7 +107,7 @@ void list_prepend(list_t *list, void *da
104 * @param list Linked list.
105 * @param node List node to remove.
106 */
107-void list_remove(list_t *list, list_node_t *node)
108+void list_remove(list_head_t *list, list_node_t *node)
109 {
110 /* Check whether node is in the list as claimed. */
111 assert(list_node_present(list, node));
112@@ -121,7 +121,7 @@ void list_remove(list_t *list, list_node
113 * @param list Linked list.
114 * @return First node of the list or @c NULL if the list is empty.
115 */
116-list_node_t *list_first(list_t *list)
117+list_node_t *list_first(list_head_t *list)
118 {
119 list_node_t *node;
120
121@@ -136,7 +136,7 @@ list_node_t *list_first(list_t *list)
122 * @param list Linked list.
123 * @return Last node of the list or @c NULL if the list is empty.
124 */
125-list_node_t *list_last(list_t *list)
126+list_node_t *list_last(list_head_t *list)
127 {
128 list_node_t *node;
129
130@@ -152,7 +152,7 @@ list_node_t *list_last(list_t *list)
131 * @param node Node whose successor we are interested in.
132 * @return Following list node or @c NULL if @a node is last.
133 */
134-list_node_t *list_next(list_t *list, list_node_t *node)
135+list_node_t *list_next(list_head_t *list, list_node_t *node)
136 {
137 (void) list;
138 assert(list != NULL);
139@@ -167,7 +167,7 @@ list_node_t *list_next(list_t *list, lis
140 * @param node Node whose predecessor we are interested in.
141 * @return Preceding list node or @c NULL if @a node is last.
142 */
143-list_node_t *list_prev(list_t *list, list_node_t *node)
144+list_node_t *list_prev(list_head_t *list, list_node_t *node)
145 {
146 (void) list;
147 assert(list != NULL);
148@@ -181,7 +181,7 @@ list_node_t *list_prev(list_t *list, lis
149 * @param list Linked list.
150 * @return @c b_true if list is empty, @c b_false otherwise.
151 */
152-bool_t list_is_empty(list_t *list)
153+bool_t list_is_empty(list_head_t *list)
154 {
155 return (list_first(list) == NULL);
156 }
157@@ -285,7 +285,7 @@ static void list_node_unlink(list_node_t
158 * @param node Node.
159 * @return @c b_true if @a node is part of @a list, @c b_false otherwise.
160 */
161-static bool_t list_node_present(list_t *list, list_node_t *node)
162+static bool_t list_node_present(list_head_t *list, list_node_t *node)
163 {
164 list_node_t *m;
165
166diff -rup HelenOS-0.4.3/uspace/app/sbi/src/list.h HelenOS-0.4.3.new/uspace/app/sbi/src/list.h
167--- HelenOS-0.4.3/uspace/app/sbi/src/list.h 2011-03-26 16:30:19.000000000 +0100
168+++ HelenOS-0.4.3.new/uspace/app/sbi/src/list.h 2011-04-02 20:13:23.000000000 +0200
169@@ -32,17 +32,17 @@
170 #include "mytypes.h"
171 #include "compat.h"
172
173-void list_init(list_t *list);
174-void list_fini(list_t *list);
175-void list_append(list_t *list, void *data);
176-void list_prepend(list_t *list, void *data);
177-void list_remove(list_t *list, list_node_t *node);
178+void list_init(list_head_t *list);
179+void list_fini(list_head_t *list);
180+void list_append(list_head_t *list, void *data);
181+void list_prepend(list_head_t *list, void *data);
182+void list_remove(list_head_t *list, list_node_t *node);
183
184-list_node_t *list_first(list_t *list);
185-list_node_t *list_last(list_t *list);
186-list_node_t *list_next(list_t *list, list_node_t *node);
187-list_node_t *list_prev(list_t *list, list_node_t *node);
188-bool_t list_is_empty(list_t *list);
189+list_node_t *list_first(list_head_t *list);
190+list_node_t *list_last(list_head_t *list);
191+list_node_t *list_next(list_head_t *list, list_node_t *node);
192+list_node_t *list_prev(list_head_t *list, list_node_t *node);
193+bool_t list_is_empty(list_head_t *list);
194
195 void list_node_setdata(list_node_t *node, void *data);
196
197diff -rup HelenOS-0.4.3/uspace/app/sbi/src/list_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/list_t.h
198--- HelenOS-0.4.3/uspace/app/sbi/src/list_t.h 2011-03-26 16:30:19.000000000 +0100
199+++ HelenOS-0.4.3.new/uspace/app/sbi/src/list_t.h 2011-04-02 20:13:23.000000000 +0200
200@@ -37,6 +37,6 @@ typedef struct list_node {
201 typedef struct list {
202 /** Empty head (no data) */
203 list_node_t head;
204-} list_t;
205+} list_head_t;
206
207 #endif
208diff -rup HelenOS-0.4.3/uspace/app/sbi/src/rdata_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/rdata_t.h
209--- HelenOS-0.4.3/uspace/app/sbi/src/rdata_t.h 2011-03-26 16:30:19.000000000 +0100
210+++ HelenOS-0.4.3.new/uspace/app/sbi/src/rdata_t.h 2011-04-02 20:13:23.000000000 +0200
211@@ -219,7 +219,7 @@ typedef struct {
212 rdata_deleg_t *object_d;
213
214 /** Arguments (indices) */
215- list_t args; /* of rdata_item_t */
216+ list_head_t args; /* of rdata_item_t */
217 } rdata_aprop_indexed_t;
218
219 typedef enum {
220diff -rup HelenOS-0.4.3/uspace/app/sbi/src/run.c HelenOS-0.4.3.new/uspace/app/sbi/src/run.c
221--- HelenOS-0.4.3/uspace/app/sbi/src/run.c 2011-03-26 16:30:19.000000000 +0100
222+++ HelenOS-0.4.3.new/uspace/app/sbi/src/run.c 2011-04-02 20:13:23.000000000 +0200
223@@ -101,7 +101,7 @@ void run_program(run_t *run, stree_progr
224 stree_fun_t *main_fun;
225 rdata_var_t *main_obj;
226 stree_ident_t *fake_ident;
227- list_t main_args;
228+ list_head_t main_args;
229 run_proc_ar_t *proc_ar;
230 rdata_item_t *res;
231
232@@ -1181,12 +1181,12 @@ void run_proc_ar_destroy(run_t *run, run
233 * @param arg_vals List of value items (rdata_item_t *) -- real
234 * argument values
235 */
236-void run_proc_ar_set_args(run_t *run, run_proc_ar_t *proc_ar, list_t *arg_vals)
237+void run_proc_ar_set_args(run_t *run, run_proc_ar_t *proc_ar, list_head_t *arg_vals)
238 {
239 stree_ctor_t *ctor;
240 stree_fun_t *fun;
241 stree_prop_t *prop;
242- list_t *args;
243+ list_head_t *args;
244 stree_proc_arg_t *varg;
245 stree_symbol_t *outer_symbol;
246
247diff -rup HelenOS-0.4.3/uspace/app/sbi/src/run_expr.c HelenOS-0.4.3.new/uspace/app/sbi/src/run_expr.c
248--- HelenOS-0.4.3/uspace/app/sbi/src/run_expr.c 2011-03-26 16:30:19.000000000 +0100
249+++ HelenOS-0.4.3.new/uspace/app/sbi/src/run_expr.c 2011-04-02 20:13:23.000000000 +0200
250@@ -92,7 +92,7 @@ static void run_new_array(run_t *run, st
251 static void run_new_object(run_t *run, stree_new_t *new_op,
252 tdata_item_t *titem, rdata_item_t **res);
253
254-static void run_object_ctor(run_t *run, rdata_var_t *obj, list_t *arg_vals);
255+static void run_object_ctor(run_t *run, rdata_var_t *obj, list_head_t *arg_vals);
256
257 static void run_access(run_t *run, stree_access_t *access, rdata_item_t **res);
258 static void run_access_item(run_t *run, stree_access_t *access,
259@@ -111,16 +111,16 @@ static void run_access_symbol(run_t *run
260 rdata_item_t *arg, rdata_item_t **res);
261
262 static void run_call(run_t *run, stree_call_t *call, rdata_item_t **res);
263-static void run_call_args(run_t *run, list_t *args, list_t *arg_vals);
264-static void run_destroy_arg_vals(list_t *arg_vals);
265+static void run_call_args(run_t *run, list_head_t *args, list_head_t *arg_vals);
266+static void run_destroy_arg_vals(list_head_t *arg_vals);
267
268 static void run_index(run_t *run, stree_index_t *index, rdata_item_t **res);
269 static void run_index_array(run_t *run, stree_index_t *index,
270- rdata_item_t *base, list_t *args, rdata_item_t **res);
271+ rdata_item_t *base, list_head_t *args, rdata_item_t **res);
272 static void run_index_object(run_t *run, stree_index_t *index,
273- rdata_item_t *base, list_t *args, rdata_item_t **res);
274+ rdata_item_t *base, list_head_t *args, rdata_item_t **res);
275 static void run_index_string(run_t *run, stree_index_t *index,
276- rdata_item_t *base, list_t *args, rdata_item_t **res);
277+ rdata_item_t *base, list_head_t *args, rdata_item_t **res);
278 static void run_assign(run_t *run, stree_assign_t *assign, rdata_item_t **res);
279 static void run_as(run_t *run, stree_as_t *as_op, rdata_item_t **res);
280 static void run_box(run_t *run, stree_box_t *box, rdata_item_t **res);
281@@ -1510,7 +1510,7 @@ static void run_new_object(run_t *run, s
282 {
283 stree_csi_t *csi;
284 rdata_item_t *obj_i;
285- list_t arg_vals;
286+ list_head_t arg_vals;
287
288 #ifdef DEBUG_RUN_TRACE
289 printf("Create new object.\n");
290@@ -1999,7 +1999,7 @@ static void run_call(run_t *run, stree_c
291 {
292 rdata_item_t *rdeleg, *rdeleg_vi;
293 rdata_deleg_t *deleg_v;
294- list_t arg_vals;
295+ list_head_t arg_vals;
296
297 stree_fun_t *fun;
298 run_proc_ar_t *proc_ar;
299@@ -2095,7 +2095,7 @@ cleanup:
300 * @param arg_vals Address of uninitialized list to store argument values
301 * (list of rdata_item_t).
302 */
303-static void run_call_args(run_t *run, list_t *args, list_t *arg_vals)
304+static void run_call_args(run_t *run, list_head_t *args, list_head_t *arg_vals)
305 {
306 list_node_t *arg_n;
307 stree_expr_t *arg;
308@@ -2138,7 +2138,7 @@ error:
309 * @param arg_vals List of evaluated arguments (value items,
310 * rdata_item_t).
311 */
312-static void run_destroy_arg_vals(list_t *arg_vals)
313+static void run_destroy_arg_vals(list_head_t *arg_vals)
314 {
315 list_node_t *val_n;
316 rdata_item_t *val_i;
317@@ -2174,7 +2174,7 @@ static void run_index(run_t *run, stree_
318 stree_expr_t *arg;
319 rdata_item_t *rarg_i, *rarg_vi;
320 var_class_t vc;
321- list_t arg_vals;
322+ list_head_t arg_vals;
323 list_node_t *val_n;
324 rdata_item_t *val_i;
325
326@@ -2270,7 +2270,7 @@ cleanup:
327 * @param res Place to store result
328 */
329 static void run_index_array(run_t *run, stree_index_t *index,
330- rdata_item_t *base, list_t *args, rdata_item_t **res)
331+ rdata_item_t *base, list_head_t *args, rdata_item_t **res)
332 {
333 list_node_t *node;
334 rdata_array_t *array;
335@@ -2370,7 +2370,7 @@ static void run_index_array(run_t *run,
336 * @param res Place to store result
337 */
338 static void run_index_object(run_t *run, stree_index_t *index,
339- rdata_item_t *base, list_t *args, rdata_item_t **res)
340+ rdata_item_t *base, list_head_t *args, rdata_item_t **res)
341 {
342 rdata_item_t *ritem;
343 rdata_address_t *address;
344@@ -2458,7 +2458,7 @@ static void run_index_object(run_t *run,
345 * @param res Place to store result
346 */
347 static void run_index_string(run_t *run, stree_index_t *index,
348- rdata_item_t *base, list_t *args, rdata_item_t **res)
349+ rdata_item_t *base, list_head_t *args, rdata_item_t **res)
350 {
351 list_node_t *node;
352 rdata_string_t *string;
353@@ -2907,7 +2907,7 @@ void run_new_csi_inst(run_t *run, stree_
354 * @param obj Object to run constructor on
355 * @param arg_vals Argument values (list of rdata_item_t)
356 */
357-static void run_object_ctor(run_t *run, rdata_var_t *obj, list_t *arg_vals)
358+static void run_object_ctor(run_t *run, rdata_var_t *obj, list_head_t *arg_vals)
359 {
360 stree_ident_t *ctor_ident;
361 stree_symbol_t *csi_sym;
362diff -rup HelenOS-0.4.3/uspace/app/sbi/src/run.h HelenOS-0.4.3.new/uspace/app/sbi/src/run.h
363--- HelenOS-0.4.3/uspace/app/sbi/src/run.h 2011-03-26 16:30:19.000000000 +0100
364+++ HelenOS-0.4.3.new/uspace/app/sbi/src/run.h 2011-04-02 20:13:23.000000000 +0200
365@@ -55,7 +55,7 @@ rdata_var_t *run_fun_sobject_find(run_t
366
367 void run_value_item_to_var(rdata_item_t *item, rdata_var_t **var);
368 void run_proc_ar_set_args(run_t *run, run_proc_ar_t *proc_ar,
369- list_t *arg_vals);
370+ list_head_t *arg_vals);
371 void run_proc_ar_set_setter_arg(run_t *run, run_proc_ar_t *proc_ar,
372 rdata_item_t *arg_val);
373 void run_proc_ar_create(run_t *run, rdata_var_t *obj, stree_proc_t *proc,
374diff -rup HelenOS-0.4.3/uspace/app/sbi/src/run_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/run_t.h
375--- HelenOS-0.4.3/uspace/app/sbi/src/run_t.h 2011-03-26 16:30:19.000000000 +0100
376+++ HelenOS-0.4.3.new/uspace/app/sbi/src/run_t.h 2011-04-02 20:13:23.000000000 +0200
377@@ -58,7 +58,7 @@ typedef struct run_proc_ar {
378 struct stree_proc *proc;
379
380 /** Block activation records */
381- list_t block_ar; /* of run_block_ar_t */
382+ list_head_t block_ar; /* of run_block_ar_t */
383
384 /** Procedure return value or @c NULL if not set. */
385 struct rdata_item *retval;
386@@ -91,7 +91,7 @@ typedef enum {
387 */
388 typedef struct run_thread_ar {
389 /** Function activation records */
390- list_t proc_ar; /* of run_proc_ar_t */
391+ list_head_t proc_ar; /* of run_proc_ar_t */
392
393 /** Bailout mode */
394 run_bailout_mode_t bo_mode;
395diff -rup HelenOS-0.4.3/uspace/app/sbi/src/stree_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/stree_t.h
396--- HelenOS-0.4.3/uspace/app/sbi/src/stree_t.h 2011-03-26 16:30:19.000000000 +0100
397+++ HelenOS-0.4.3.new/uspace/app/sbi/src/stree_t.h 2011-04-02 20:13:23.000000000 +0200
398@@ -161,7 +161,7 @@ typedef struct {
399 struct stree_texpr *texpr;
400
401 /** Constructor arguments */
402- list_t ctor_args; /* of stree_expr_t */
403+ list_head_t ctor_args; /* of stree_expr_t */
404 } stree_new_t;
405
406 /** Member access operation */
407@@ -184,7 +184,7 @@ typedef struct {
408 struct stree_expr *fun;
409
410 /** Arguments */
411- list_t args; /* of stree_expr_t */
412+ list_head_t args; /* of stree_expr_t */
413 } stree_call_t;
414
415 typedef enum {
416@@ -210,7 +210,7 @@ typedef struct {
417 struct stree_expr *base;
418
419 /** Arguments (indices) */
420- list_t args; /* of stree_expr_t */
421+ list_head_t args; /* of stree_expr_t */
422 } stree_index_t;
423
424 /** @c as conversion operation */
425@@ -333,7 +333,7 @@ typedef struct {
426 struct stree_texpr *gtype;
427
428 /** (Formal) type arguments */
429- list_t targs; /* of stree_texpr_t */
430+ list_head_t targs; /* of stree_texpr_t */
431 } stree_tapply_t;
432
433 /** Type index operation */
434@@ -351,7 +351,7 @@ typedef struct {
435 int n_args;
436
437 /** Arguments (extents) */
438- list_t args; /* of stree_expr_t */
439+ list_head_t args; /* of stree_expr_t */
440 } stree_tindex_t;
441
442 /** Type expression class */
443@@ -386,7 +386,7 @@ typedef struct stree_texpr {
444 /** Statement block */
445 typedef struct stree_block {
446 /** List of statements in the block */
447- list_t stats; /* of stree_stat_t */
448+ list_head_t stats; /* of stree_stat_t */
449 } stree_block_t;
450
451 /** Variable declaration */
452@@ -417,7 +417,7 @@ typedef struct {
453 /** If statement */
454 typedef struct {
455 /** If and elif clauses */
456- list_t if_clauses; /* of stree_if_clause_t */
457+ list_head_t if_clauses; /* of stree_if_clause_t */
458
459 /** Else block */
460 stree_block_t *else_block;
461@@ -426,7 +426,7 @@ typedef struct {
462 /** @c when clause */
463 typedef struct {
464 /** List of expressions -- cases -- for this clause */
465- list_t exprs; /* of stree_expr_t */
466+ list_head_t exprs; /* of stree_expr_t */
467 stree_block_t *block;
468 } stree_when_t;
469
470@@ -436,7 +436,7 @@ typedef struct {
471 stree_expr_t *expr;
472
473 /** When clauses */
474- list_t when_clauses; /* of stree_when_t */
475+ list_head_t when_clauses; /* of stree_when_t */
476
477 /** Else block */
478 stree_block_t *else_block;
479@@ -475,7 +475,7 @@ typedef struct {
480 /** With-try-except-finally (WEF) statement */
481 typedef struct {
482 stree_block_t *with_block;
483- list_t except_clauses; /* of stree_except_t */
484+ list_head_t except_clauses; /* of stree_except_t */
485 stree_block_t *finally_block;
486 } stree_wef_t;
487
488@@ -531,7 +531,7 @@ typedef struct {
489 stree_texpr_t *type;
490
491 /* Attributes */
492- list_t attr; /* of stree_arg_attr_t */
493+ list_head_t attr; /* of stree_arg_attr_t */
494 } stree_proc_arg_t;
495
496 /** Function signature.
497@@ -541,7 +541,7 @@ typedef struct {
498 */
499 typedef struct {
500 /** Formal parameters */
501- list_t args; /* of stree_proc_arg_t */
502+ list_head_t args; /* of stree_proc_arg_t */
503
504 /** Variadic argument or @c NULL if none. */
505 stree_proc_arg_t *varg;
506@@ -618,7 +618,7 @@ typedef struct stree_enum {
507 struct stree_symbol *symbol;
508
509 /** List of enum members */
510- list_t members; /* of stree_embr_t */
511+ list_head_t members; /* of stree_embr_t */
512
513 /** Type item describing the enum */
514 struct tdata_item *titem;
515@@ -661,7 +661,7 @@ typedef struct stree_prop {
516 stree_proc_arg_t *setter_arg;
517
518 /** Formal parameters (for indexed properties) */
519- list_t args; /* of stree_proc_arg_t */
520+ list_head_t args; /* of stree_proc_arg_t */
521
522 /** Variadic argument or @c NULL if none. */
523 stree_proc_arg_t *varg;
524@@ -722,25 +722,25 @@ typedef struct stree_csi {
525 stree_ident_t *name;
526
527 /** List of type arguments */
528- list_t targ; /* of stree_targ_t */
529+ list_head_t targ; /* of stree_targ_t */
530
531 /** Symbol for this CSI */
532 struct stree_symbol *symbol;
533
534 /** Type expressions referencing inherited CSIs. */
535- list_t inherit; /* of stree_texpr_t */
536+ list_head_t inherit; /* of stree_texpr_t */
537
538 /** Base CSI. Only available when ancr_state == ws_visited. */
539 struct stree_csi *base_csi;
540
541 /** Types of implemented or accumulated interfaces. */
542- list_t impl_if_ti; /* of tdata_item_t */
543+ list_head_t impl_if_ti; /* of tdata_item_t */
544
545 /** Node state for ancr walks. */
546 walk_state_t ancr_state;
547
548 /** List of CSI members */
549- list_t members; /* of stree_csimbr_t */
550+ list_head_t members; /* of stree_csimbr_t */
551 } stree_csi_t;
552
553 typedef enum {
554@@ -762,7 +762,7 @@ typedef struct {
555 /** Module */
556 typedef struct stree_module {
557 /** List of module members */
558- list_t members; /* of stree_modm_t */
559+ list_head_t members; /* of stree_modm_t */
560 } stree_module_t;
561
562 /** Symbol attribute class */
563@@ -818,7 +818,7 @@ typedef struct stree_symbol {
564 stree_csi_t *outer_csi;
565
566 /** Symbol attributes */
567- list_t attr; /* of stree_symbol_attr_t */
568+ list_head_t attr; /* of stree_symbol_attr_t */
569 } stree_symbol_t;
570
571 /** Program */
572diff -rup HelenOS-0.4.3/uspace/app/sbi/src/strtab.c HelenOS-0.4.3.new/uspace/app/sbi/src/strtab.c
573--- HelenOS-0.4.3/uspace/app/sbi/src/strtab.c 2011-03-26 16:30:19.000000000 +0100
574+++ HelenOS-0.4.3.new/uspace/app/sbi/src/strtab.c 2011-04-02 20:13:23.000000000 +0200
575@@ -45,7 +45,7 @@
576
577 #include "strtab.h"
578
579-static list_t str_list;
580+static list_head_t str_list;
581
582 /** Initialize string table. */
583 void strtab_init(void)
584diff -rup HelenOS-0.4.3/uspace/app/sbi/src/stype.c HelenOS-0.4.3.new/uspace/app/sbi/src/stype.c
585--- HelenOS-0.4.3/uspace/app/sbi/src/stype.c 2011-03-26 16:30:19.000000000 +0100
586+++ HelenOS-0.4.3.new/uspace/app/sbi/src/stype.c 2011-04-02 20:13:23.000000000 +0200
587@@ -2121,7 +2121,7 @@ stree_proc_arg_t *stype_proc_args_lookup
588 stree_fun_t *fun;
589 stree_prop_t *prop;
590
591- list_t *args;
592+ list_head_t *args;
593 list_node_t *arg_node;
594 stree_proc_arg_t *varg;
595 stree_proc_arg_t *arg;
596diff -rup HelenOS-0.4.3/uspace/app/sbi/src/stype_expr.c HelenOS-0.4.3.new/uspace/app/sbi/src/stype_expr.c
597--- HelenOS-0.4.3/uspace/app/sbi/src/stype_expr.c 2011-03-26 16:30:19.000000000 +0100
598+++ HelenOS-0.4.3.new/uspace/app/sbi/src/stype_expr.c 2011-04-02 20:13:23.000000000 +0200
599@@ -112,8 +112,8 @@ static void stype_access_tebase(stype_t
600
601 static void stype_call(stype_t *stype, stree_call_t *call,
602 tdata_item_t **rtitem);
603-static void stype_call_args(stype_t *stype, cspan_t *cspan, list_t *farg_tis,
604- tdata_item_t *fvarg_ti, list_t *args);
605+static void stype_call_args(stype_t *stype, cspan_t *cspan, list_head_t *farg_tis,
606+ tdata_item_t *fvarg_ti, list_head_t *args);
607
608 static void stype_index(stype_t *stype, stree_index_t *index,
609 tdata_item_t **rtitem);
610@@ -1420,8 +1420,8 @@ static void stype_call(stype_t *stype, s
611 * @param farg_tis Formal argument types (list of tdata_item_t)
612 * @param args Real arguments (list of stree_expr_t)
613 */
614-static void stype_call_args(stype_t *stype, cspan_t *cspan, list_t *farg_tis,
615- tdata_item_t *fvarg_ti, list_t *args)
616+static void stype_call_args(stype_t *stype, cspan_t *cspan, list_head_t *farg_tis,
617+ tdata_item_t *fvarg_ti, list_head_t *args)
618 {
619 list_node_t *fargt_n;
620 tdata_item_t *farg_ti;
621diff -rup HelenOS-0.4.3/uspace/app/sbi/src/stype_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/stype_t.h
622--- HelenOS-0.4.3/uspace/app/sbi/src/stype_t.h 2011-03-26 16:30:19.000000000 +0100
623+++ HelenOS-0.4.3.new/uspace/app/sbi/src/stype_t.h 2011-04-02 20:13:24.000000000 +0200
624@@ -52,7 +52,7 @@ typedef struct run_proc_vr {
625 struct stree_proc *proc;
626
627 /** Block activation records */
628- list_t block_vr; /* of run_block_ar_t */
629+ list_head_t block_vr; /* of run_block_ar_t */
630
631 /** Number of active breakable statements (for break checking). */
632 int bstat_cnt;
633diff -rup HelenOS-0.4.3/uspace/app/sbi/src/tdata_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/tdata_t.h
634--- HelenOS-0.4.3/uspace/app/sbi/src/tdata_t.h 2011-03-26 16:30:19.000000000 +0100
635+++ HelenOS-0.4.3.new/uspace/app/sbi/src/tdata_t.h 2011-04-02 20:13:24.000000000 +0200
636@@ -64,7 +64,7 @@ typedef struct {
637 struct stree_csi *csi;
638
639 /** (Real) type arguments */
640- list_t targs; /* of tdata_item_t */
641+ list_head_t targs; /* of tdata_item_t */
642 } tdata_object_t;
643
644 /** Array type. */
645@@ -76,7 +76,7 @@ typedef struct {
646 int rank;
647
648 /** Extents */
649- list_t extents; /* of stree_expr_t */
650+ list_head_t extents; /* of stree_expr_t */
651 } tdata_array_t;
652
653 /** Function signature type.
654@@ -85,7 +85,7 @@ typedef struct {
655 */
656 typedef struct {
657 /** Types of fixed arguments. */
658- list_t arg_ti; /* of tdata_item_t */
659+ list_head_t arg_ti; /* of tdata_item_t */
660
661 /** Type of variadic argument */
662 struct tdata_item *varg_ti;
663diff -rup HelenOS-0.4.3/uspace/app/tester/mm/malloc1.c HelenOS-0.4.3.new/uspace/app/tester/mm/malloc1.c
664--- HelenOS-0.4.3/uspace/app/tester/mm/malloc1.c 2011-03-26 16:30:19.000000000 +0100
665+++ HelenOS-0.4.3.new/uspace/app/tester/mm/malloc1.c 2011-04-02 20:16:22.000000000 +0200
666@@ -2,6 +2,7 @@
667 * Copyright (c) 2009 Martin Decky
668 * Copyright (c) 2009 Tomas Bures
669 * Copyright (c) 2009 Lubomir Bulej
670+ * Copyright (c) 2011 Mateusz Kocielski
671 * All rights reserved.
672 *
673 * Redistribution and use in source and binary forms, with or without
674@@ -342,7 +343,7 @@ static int test_overlap(void *addr, size
675 link_t *entry;
676 bool fnd = false;
677
678- for (entry = mem_blocks.next; entry != &mem_blocks; entry = entry->next) {
679+ for (entry = mem_blocks.head.next; entry != &mem_blocks.head; entry = entry->next) {
680 if (overlap_match(entry, addr, size)) {
681 fnd = true;
682 break;
683@@ -505,12 +506,12 @@ static void check_block(mem_block_t blk)
684 }
685
686
687-static link_t *list_get_nth(link_t *list, unsigned int i)
688+static link_t *list_get_nth(list_t *list, unsigned int i)
689 {
690 unsigned int cnt = 0;
691 link_t *entry;
692
693- for (entry = list->next; entry != list; entry = entry->next) {
694+ for (entry = list->head.next; entry != &list->head; entry = entry->next) {
695 if (cnt == i)
696 return entry;
697
698diff -rup HelenOS-0.4.3/uspace/lib/block/libblock.c HelenOS-0.4.3.new/uspace/lib/block/libblock.c
699--- HelenOS-0.4.3/uspace/lib/block/libblock.c 2011-03-26 16:30:19.000000000 +0100
700+++ HelenOS-0.4.3.new/uspace/lib/block/libblock.c 2011-04-02 20:02:36.000000000 +0200
701@@ -1,6 +1,7 @@
702 /*
703 * Copyright (c) 2008 Jakub Jermar
704 * Copyright (c) 2008 Martin Decky
705+ * Copyright (c) 2011 Mateusz Kocielski
706 * All rights reserved.
707 *
708 * Redistribution and use in source and binary forms, with or without
709@@ -68,7 +69,7 @@ typedef struct {
710 unsigned block_count; /**< Total number of blocks. */
711 unsigned blocks_cached; /**< Number of cached blocks. */
712 hash_table_t block_hash;
713- link_t free_head;
714+ list_t free_head;
715 enum cache_mode mode;
716 } cache_t;
717
718@@ -96,7 +97,7 @@ static devcon_t *devcon_search(devmap_ha
719 link_t *cur;
720
721 fibril_mutex_lock(&dcl_lock);
722- for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) {
723+ for (cur = dcl_head.head.next; cur != &dcl_head.head; cur = cur->next) {
724 devcon_t *devcon = list_get_instance(cur, devcon_t, link);
725 if (devcon->devmap_handle == devmap_handle) {
726 fibril_mutex_unlock(&dcl_lock);
727@@ -132,7 +133,7 @@ static int devcon_add(devmap_handle_t de
728 devcon->cache = NULL;
729
730 fibril_mutex_lock(&dcl_lock);
731- for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) {
732+ for (cur = dcl_head.head.next; cur != &dcl_head.head; cur = cur->next) {
733 devcon_t *d = list_get_instance(cur, devcon_t, link);
734 if (d->devmap_handle == devmap_handle) {
735 fibril_mutex_unlock(&dcl_lock);
736@@ -328,7 +329,7 @@ int block_cache_fini(devmap_handle_t dev
737 * bother with the cache and block locks because we are single-threaded.
738 */
739 while (!list_empty(&cache->free_head)) {
740- block_t *b = list_get_instance(cache->free_head.next,
741+ block_t *b = list_get_instance(cache->free_head.head.next,
742 block_t, free_link);
743
744 list_remove(&b->free_link);
745@@ -453,7 +454,7 @@ recycle:
746 rc = ENOMEM;
747 goto out;
748 }
749- l = cache->free_head.next;
750+ l = cache->free_head.head.next;
751 b = list_get_instance(l, block_t, free_link);
752
753 fibril_mutex_lock(&b->lock);
754diff -rup HelenOS-0.4.3/uspace/lib/c/generic/adt/hash_table.c HelenOS-0.4.3.new/uspace/lib/c/generic/adt/hash_table.c
755--- HelenOS-0.4.3/uspace/lib/c/generic/adt/hash_table.c 2011-03-26 16:30:19.000000000 +0100
756+++ HelenOS-0.4.3.new/uspace/lib/c/generic/adt/hash_table.c 2011-04-02 19:52:56.000000000 +0200
757@@ -1,5 +1,6 @@
758 /*
759 * Copyright (c) 2008 Jakub Jermar
760+ * Copyright (c) 2011 Mateusz Kocielski
761 * All rights reserved.
762 *
763 * Redistribution and use in source and binary forms, with or without
764@@ -60,11 +61,11 @@ int hash_table_create(hash_table_t *h, h
765 assert(op && op->hash && op->compare);
766 assert(max_keys > 0);
767
768- h->entry = malloc(m * sizeof(link_t));
769+ h->entry = malloc(m * sizeof(list_t));
770 if (!h->entry)
771 return false;
772
773- memset((void *) h->entry, 0, m * sizeof(link_t));
774+ memset((void *) h->entry, 0, m * sizeof(list_t));
775
776 hash_count_t i;
777 for (i = 0; i < m; i++)
778@@ -123,7 +124,7 @@ link_t *hash_table_find(hash_table_t *h,
779 assert(chain < h->entries);
780
781 link_t *cur;
782- for (cur = h->entry[chain].next; cur != &h->entry[chain];
783+ for (cur = h->entry[chain].head.next; cur != &h->entry[chain].head;
784 cur = cur->next) {
785 if (h->op->compare(key, h->max_keys, cur)) {
786 /*
787@@ -175,7 +176,8 @@ void hash_table_remove(hash_table_t *h,
788 */
789 hash_index_t chain;
790 for (chain = 0; chain < h->entries; chain++) {
791- for (cur = h->entry[chain].next; cur != &h->entry[chain];
792+ for (cur = h->entry[chain].head.next; cur !=
793+ &h->entry[chain].head;
794 cur = cur->next) {
795 if (h->op->compare(key, keys, cur)) {
796 link_t *hlp;
797@@ -205,7 +207,8 @@ void hash_table_apply(hash_table_t *h, v
798 link_t *cur;
799
800 for (bucket = 0; bucket < h->entries; bucket++) {
801- for (cur = h->entry[bucket].next; cur != &h->entry[bucket];
802+ for (cur = h->entry[bucket].head.next; cur !=
803+ &h->entry[bucket].head;
804 cur = cur->next) {
805 f(cur, arg);
806 }
807diff -rup HelenOS-0.4.3/uspace/lib/c/generic/adt/list.c HelenOS-0.4.3.new/uspace/lib/c/generic/adt/list.c
808--- HelenOS-0.4.3/uspace/lib/c/generic/adt/list.c 2011-03-26 16:30:19.000000000 +0100
809+++ HelenOS-0.4.3.new/uspace/lib/c/generic/adt/list.c 2011-04-02 19:48:56.000000000 +0200
810@@ -1,5 +1,6 @@
811 /*
812 * Copyright (c) 2004 Jakub Jermar
813+ * Copyright (c) 2011 Mateusz Kocielski
814 * All rights reserved.
815 *
816 * Redistribution and use in source and binary forms, with or without
817@@ -46,12 +47,12 @@
818 * @return true if link is contained in head, false otherwise.
819 *
820 */
821-int list_member(const link_t *link, const link_t *head)
822+int list_member(const link_t *link, const list_t *list)
823 {
824 int found = 0;
825- link_t *hlp = head->next;
826+ link_t *hlp = list->head.next;
827
828- while (hlp != head) {
829+ while (hlp != &list->head) {
830 if (hlp == link) {
831 found = 1;
832 break;
833@@ -69,20 +70,20 @@ int list_member(const link_t *link, cons
834 * list head1 containing items from both (in head1, head2
835 * order) and empty list head2.
836 *
837- * @param head1 First list and concatenated output
838- * @param head2 Second list and empty output.
839+ * @param list1 First list and concatenated output
840+ * @param list2 Second list and empty output.
841 *
842 */
843-void list_concat(link_t *head1, link_t *head2)
844+void list_concat(list_t *list1, list_t *list2)
845 {
846- if (list_empty(head2))
847+ if (list_empty(list2))
848 return;
849
850- head2->next->prev = head1->prev;
851- head2->prev->next = head1;
852- head1->prev->next = head2->next;
853- head1->prev = head2->prev;
854- list_initialize(head2);
855+ list2->head.next->prev = list1->head.prev;
856+ list2->head.prev->next = &list1->head;
857+ list1->head.prev->next = list1->head.next;
858+ list1->head.prev = list2->head.prev;
859+ list_initialize(list2);
860 }
861
862
863@@ -95,12 +96,12 @@ void list_concat(link_t *head1, link_t *
864 * @return Number of items in the list.
865 *
866 */
867-unsigned int list_count(const link_t *link)
868+unsigned int list_count(const list_t *list)
869 {
870 unsigned int count = 0;
871- link_t *hlp = link->next;
872+ link_t *hlp = list->head.next;
873
874- while (hlp != link) {
875+ while (hlp != &list->head) {
876 count++;
877 hlp = hlp->next;
878 }
879diff -rup HelenOS-0.4.3/uspace/lib/c/generic/async.c HelenOS-0.4.3.new/uspace/lib/c/generic/async.c
880--- HelenOS-0.4.3/uspace/lib/c/generic/async.c 2011-03-26 16:30:19.000000000 +0100
881+++ HelenOS-0.4.3.new/uspace/lib/c/generic/async.c 2011-04-02 19:40:03.000000000 +0200
882@@ -1,5 +1,6 @@
883 /*
884 * Copyright (c) 2006 Ondrej Palkovsky
885+ * Copyright (c) 2011 Mateusz Kocielski
886 * All rights reserved.
887 *
888 * Redistribution and use in source and binary forms, with or without
889@@ -152,7 +153,7 @@ typedef struct {
890 client_t *client;
891
892 /** Messages that should be delivered to this fibril. */
893- link_t msg_queue;
894+ list_t msg_queue;
895
896 /** Identification of the opening call. */
897 ipc_callid_t callid;
898@@ -314,8 +315,8 @@ void async_insert_timeout(awaiter_t *wd)
899 wd->to_event.occurred = false;
900 wd->to_event.inlist = true;
901
902- link_t *tmp = timeout_list.next;
903- while (tmp != &timeout_list) {
904+ link_t *tmp = timeout_list.head.next;
905+ while (tmp != &timeout_list.head) {
906 awaiter_t *cur
907 = list_get_instance(tmp, awaiter_t, to_event.link);
908
909@@ -325,7 +326,7 @@ void async_insert_timeout(awaiter_t *wd)
910 tmp = tmp->next;
911 }
912
913- list_append(&wd->to_event.link, tmp);
914+ list_append(&wd->to_event.link, &timeout_list);
915 }
916
917 /** Try to route a call to an appropriate connection fibril.
918@@ -515,7 +516,7 @@ ipc_callid_t async_get_call_timeout(ipc_
919 }
920 }
921
922- msg_t *msg = list_get_instance(conn->msg_queue.next, msg_t, link);
923+ msg_t *msg = list_get_instance(conn->msg_queue.head.next, msg_t, link);
924 list_remove(&msg->link);
925
926 ipc_callid_t callid = msg->callid;
927@@ -622,7 +623,7 @@ static int connection_fibril(void *arg)
928 */
929 while (!list_empty(&FIBRIL_connection->msg_queue)) {
930 msg_t *msg =
931- list_get_instance(FIBRIL_connection->msg_queue.next, msg_t,
932+ list_get_instance(FIBRIL_connection->msg_queue.head.next, msg_t,
933 link);
934
935 list_remove(&msg->link);
936@@ -749,8 +750,8 @@ static void handle_expired_timeouts(void
937
938 futex_down(&async_futex);
939
940- link_t *cur = timeout_list.next;
941- while (cur != &timeout_list) {
942+ link_t *cur = timeout_list.head.next;
943+ while (cur != &timeout_list.head) {
944 awaiter_t *waiter =
945 list_get_instance(cur, awaiter_t, to_event.link);
946
947@@ -797,7 +798,8 @@ static int async_manager_worker(void)
948
949 suseconds_t timeout;
950 if (!list_empty(&timeout_list)) {
951- awaiter_t *waiter = list_get_instance(timeout_list.next,
952+ awaiter_t *waiter =
953+ list_get_instance(timeout_list.head.next,
954 awaiter_t, to_event.link);
955
956 struct timeval tv;
957diff -rup HelenOS-0.4.3/uspace/lib/c/generic/async_sess.c HelenOS-0.4.3.new/uspace/lib/c/generic/async_sess.c
958--- HelenOS-0.4.3/uspace/lib/c/generic/async_sess.c 2011-03-26 16:30:19.000000000 +0100
959+++ HelenOS-0.4.3.new/uspace/lib/c/generic/async_sess.c 2011-04-02 19:44:03.000000000 +0200
960@@ -1,5 +1,6 @@
961 /*
962 * Copyright (c) 2010 Jakub Jermar
963+ * Copyright (c) 2011 Mateusz Kocielski
964 * All rights reserved.
965 *
966 * Redistribution and use in source and binary forms, with or without
967@@ -194,7 +195,7 @@ void async_session_destroy(async_sess_t
968
969 /* Tear down all data connections. */
970 while (!list_empty(&sess->conn_head)) {
971- conn = list_get_instance(sess->conn_head.next, conn_node_t,
972+ conn = list_get_instance(sess->conn_head.head.next, conn_node_t,
973 sess_link);
974
975 list_remove(&conn->sess_link);
976@@ -231,7 +232,7 @@ int async_exchange_begin(async_sess_t *s
977 /*
978 * There are inactive connections in the session.
979 */
980- conn = list_get_instance(sess->conn_head.next, conn_node_t,
981+ conn = list_get_instance(sess->conn_head.head.next, conn_node_t,
982 sess_link);
983 list_remove(&conn->sess_link);
984 list_remove(&conn->global_link);
985@@ -254,7 +255,7 @@ retry:
986 * try to close some of the currently inactive
987 * connections in other sessions and try again.
988 */
989- conn = list_get_instance(inactive_conn_head.next,
990+ conn = list_get_instance(inactive_conn_head.head.next,
991 conn_node_t, global_link);
992 list_remove(&conn->global_link);
993 list_remove(&conn->sess_link);
994diff -rup HelenOS-0.4.3/uspace/lib/c/generic/devman.c HelenOS-0.4.3.new/uspace/lib/c/generic/devman.c
995--- HelenOS-0.4.3/uspace/lib/c/generic/devman.c 2011-03-26 16:30:19.000000000 +0100
996+++ HelenOS-0.4.3.new/uspace/lib/c/generic/devman.c 2011-04-02 18:54:33.000000000 +0200
997@@ -138,11 +138,11 @@ static int devman_send_match_id(int phon
998
999 static int devman_send_match_ids(int phone, match_id_list_t *match_ids)
1000 {
1001- link_t *link = match_ids->ids.next;
1002+ link_t *link = match_ids->ids.head.next;
1003 match_id_t *match_id = NULL;
1004 int ret = EOK;
1005
1006- while (link != &match_ids->ids) {
1007+ while (link != &match_ids->ids.head) {
1008 match_id = list_get_instance(link, match_id_t, link);
1009 ret = devman_send_match_id(phone, match_id);
1010 if (ret != EOK) {
1011diff -rup HelenOS-0.4.3/uspace/lib/c/generic/fibril.c HelenOS-0.4.3.new/uspace/lib/c/generic/fibril.c
1012--- HelenOS-0.4.3/uspace/lib/c/generic/fibril.c 2011-03-26 16:30:19.000000000 +0100
1013+++ HelenOS-0.4.3.new/uspace/lib/c/generic/fibril.c 2011-04-02 19:16:14.000000000 +0200
1014@@ -1,6 +1,7 @@
1015 /*
1016 * Copyright (c) 2006 Ondrej Palkovsky
1017 * Copyright (c) 2007 Jakub Jermar
1018+ * Copyright (c) 2010 Mateusz Kocielski
1019 * All rights reserved.
1020 *
1021 * Redistribution and use in source and binary forms, with or without
1022@@ -221,7 +222,7 @@ int fibril_switch(fibril_switch_type_t s
1023 /* Choose a new fibril to run */
1024 fibril_t *dstf;
1025 if ((stype == FIBRIL_TO_MANAGER) || (stype == FIBRIL_FROM_DEAD)) {
1026- dstf = list_get_instance(manager_list.next, fibril_t, link);
1027+ dstf = list_get_instance(manager_list.head.next, fibril_t, link);
1028 if (serialization_count && stype == FIBRIL_TO_MANAGER) {
1029 serialized_threads++;
1030 srcf->flags |= FIBRIL_SERIALIZED;
1031@@ -232,11 +233,11 @@ int fibril_switch(fibril_switch_type_t s
1032 dstf->clean_after_me = srcf;
1033 } else {
1034 if (!list_empty(&serialized_list)) {
1035- dstf = list_get_instance(serialized_list.next, fibril_t,
1036+ dstf = list_get_instance(serialized_list.head.next, fibril_t,
1037 link);
1038 serialized_threads--;
1039 } else {
1040- dstf = list_get_instance(ready_list.next, fibril_t,
1041+ dstf = list_get_instance(ready_list.head.next, fibril_t,
1042 link);
1043 }
1044 }
1045@@ -325,7 +326,7 @@ void fibril_remove_manager(void)
1046 futex_down(&fibril_futex);
1047
1048 if (!list_empty(&manager_list))
1049- list_remove(manager_list.next);
1050+ list_remove(manager_list.head.next);
1051
1052 futex_up(&fibril_futex);
1053 }
1054diff -rup HelenOS-0.4.3/uspace/lib/c/generic/fibril_synch.c HelenOS-0.4.3.new/uspace/lib/c/generic/fibril_synch.c
1055--- HelenOS-0.4.3/uspace/lib/c/generic/fibril_synch.c 2011-03-26 16:30:19.000000000 +0100
1056+++ HelenOS-0.4.3.new/uspace/lib/c/generic/fibril_synch.c 2011-04-02 19:26:36.000000000 +0200
1057@@ -147,7 +147,7 @@ static void _fibril_mutex_unlock_unsafe(
1058 fibril_t *f;
1059
1060 assert(!list_empty(&fm->waiters));
1061- tmp = fm->waiters.next;
1062+ tmp = fm->waiters.head.next;
1063 wdp = list_get_instance(tmp, awaiter_t, wu_event.link);
1064 wdp->active = true;
1065 wdp->wu_event.inlist = false;
1066@@ -277,7 +277,7 @@ static void _fibril_rwlock_common_unlock
1067 frw->oi.owned_by = NULL;
1068
1069 while (!list_empty(&frw->waiters)) {
1070- link_t *tmp = frw->waiters.next;
1071+ link_t *tmp = frw->waiters.head.next;
1072 awaiter_t *wdp;
1073 fibril_t *f;
1074
1075@@ -420,7 +420,7 @@ static void _fibril_condvar_wakeup_commo
1076
1077 futex_down(&async_futex);
1078 while (!list_empty(&fcv->waiters)) {
1079- tmp = fcv->waiters.next;
1080+ tmp = fcv->waiters.head.next;
1081 wdp = list_get_instance(tmp, awaiter_t, wu_event.link);
1082 list_remove(&wdp->wu_event.link);
1083 wdp->wu_event.inlist = false;
1084diff -rup HelenOS-0.4.3/uspace/lib/c/generic/io/io.c HelenOS-0.4.3.new/uspace/lib/c/generic/io/io.c
1085--- HelenOS-0.4.3/uspace/lib/c/generic/io/io.c 2011-03-26 16:30:19.000000000 +0100
1086+++ HelenOS-0.4.3.new/uspace/lib/c/generic/io/io.c 2011-04-02 19:27:47.000000000 +0200
1087@@ -1,5 +1,6 @@
1088 /*
1089 * Copyright (c) 2005 Martin Decky
1090+ * Copyright (c) 2011 Mateusz Kocielski
1091 * All rights reserved.
1092 *
1093 * Redistribution and use in source and binary forms, with or without
1094@@ -124,12 +125,12 @@ void __stdio_init(int filc, fdi_node_t *
1095
1096 void __stdio_done(void)
1097 {
1098- link_t *link = files.next;
1099+ link_t *link = files.head.next;
1100
1101- while (link != &files) {
1102+ while (link != &files.head) {
1103 FILE *file = list_get_instance(link, FILE, link);
1104 fclose(file);
1105- link = files.next;
1106+ link = files.head.next;
1107 }
1108 }
1109
1110diff -rup HelenOS-0.4.3/uspace/lib/c/generic/ipc.c HelenOS-0.4.3.new/uspace/lib/c/generic/ipc.c
1111--- HelenOS-0.4.3/uspace/lib/c/generic/ipc.c 2011-03-26 16:30:19.000000000 +0100
1112+++ HelenOS-0.4.3.new/uspace/lib/c/generic/ipc.c 2011-04-02 19:29:28.000000000 +0200
1113@@ -457,7 +457,7 @@ static void dispatch_queued_calls(void)
1114
1115 while (!list_empty(&queued_calls)) {
1116 async_call_t *call =
1117- list_get_instance(queued_calls.next, async_call_t, list);
1118+ list_get_instance(queued_calls.head.next, async_call_t, list);
1119 ipc_callid_t callid =
1120 ipc_call_async_internal(call->u.msg.phoneid, &call->u.msg.data);
1121
1122@@ -510,7 +510,7 @@ static void handle_answer(ipc_callid_t c
1123 futex_down(&ipc_futex);
1124
1125 link_t *item;
1126- for (item = dispatched_calls.next; item != &dispatched_calls;
1127+ for (item = dispatched_calls.head.next; item != &dispatched_calls.head;
1128 item = item->next) {
1129 async_call_t *call =
1130 list_get_instance(item, async_call_t, list);
1131diff -rup HelenOS-0.4.3/uspace/lib/c/include/adt/hash_table.h HelenOS-0.4.3.new/uspace/lib/c/include/adt/hash_table.h
1132--- HelenOS-0.4.3/uspace/lib/c/include/adt/hash_table.h 2011-03-26 16:30:19.000000000 +0100
1133+++ HelenOS-0.4.3.new/uspace/lib/c/include/adt/hash_table.h 2011-04-02 19:51:33.000000000 +0200
1134@@ -73,7 +73,7 @@ typedef struct {
1135
1136 /** Hash table structure. */
1137 typedef struct {
1138- link_t *entry;
1139+ list_t *entry;
1140 hash_count_t entries;
1141 hash_count_t max_keys;
1142 hash_table_operations_t *op;
1143diff -rup HelenOS-0.4.3/uspace/lib/c/include/adt/list.h HelenOS-0.4.3.new/uspace/lib/c/include/adt/list.h
1144--- HelenOS-0.4.3/uspace/lib/c/include/adt/list.h 2011-03-26 16:30:19.000000000 +0100
1145+++ HelenOS-0.4.3.new/uspace/lib/c/include/adt/list.h 2011-04-02 19:14:57.000000000 +0200
1146@@ -1,5 +1,6 @@
1147 /*
1148 * Copyright (c) 2001-2004 Jakub Jermar
1149+ * Copyright (c) 2011 Mateusz Kocielski
1150 * All rights reserved.
1151 *
1152 * Redistribution and use in source and binary forms, with or without
1153@@ -37,19 +38,23 @@
1154
1155 #include <unistd.h>
1156
1157-/** Doubly linked list head and link type. */
1158+/** Doubly linked list link type. */
1159 typedef struct link {
1160 struct link *prev; /**< Pointer to the previous item in the list. */
1161 struct link *next; /**< Pointer to the next item in the list. */
1162 } link_t;
1163
1164+/** Doubly linked list head type. */
1165+typedef struct {
1166+ struct link head;
1167+} list_t;
1168+
1169 /** Declare and initialize statically allocated list.
1170 *
1171 * @param name Name of the new statically allocated list.
1172 */
1173-#define LIST_INITIALIZE(name) link_t name = { \
1174- .prev = &name, \
1175- .next = &name \
1176+#define LIST_INITIALIZE(name) list_t name = { \
1177+ .head = { .prev = &name.head, .next = &name.head } \
1178 }
1179
1180 /** Initialize doubly-linked circular list link
1181@@ -70,10 +75,10 @@ static inline void link_initialize(link_
1182 *
1183 * @param head Pointer to link_t structure representing head of the list.
1184 */
1185-static inline void list_initialize(link_t *head)
1186+static inline void list_initialize(list_t *list)
1187 {
1188- head->prev = head;
1189- head->next = head;
1190+ list->head.prev = &list->head;
1191+ list->head.next = &list->head;
1192 }
1193
1194 /** Add item to the beginning of doubly-linked circular list
1195@@ -81,14 +86,14 @@ static inline void list_initialize(link_
1196 * Add item to the beginning of doubly-linked circular list.
1197 *
1198 * @param link Pointer to link_t structure to be added.
1199- * @param head Pointer to link_t structure representing head of the list.
1200+ * @param list Pointer to list_t structure representing head of the list.
1201 */
1202-static inline void list_prepend(link_t *link, link_t *head)
1203+static inline void list_prepend(link_t *link, list_t *list)
1204 {
1205- link->next = head->next;
1206- link->prev = head;
1207- head->next->prev = link;
1208- head->next = link;
1209+ link->next = list->head.next;
1210+ link->prev = &list->head;
1211+ list->head.next->prev = link;
1212+ list->head.next = link;
1213 }
1214
1215 /** Add item to the end of doubly-linked circular list
1216@@ -96,26 +101,32 @@ static inline void list_prepend(link_t *
1217 * Add item to the end of doubly-linked circular list.
1218 *
1219 * @param link Pointer to link_t structure to be added.
1220- * @param head Pointer to link_t structure representing head of the list.
1221+ * @param list Pointer to list_t structure representing head of the list.
1222 */
1223-static inline void list_append(link_t *link, link_t *head)
1224+static inline void list_append(link_t *link, list_t *list)
1225 {
1226- link->prev = head->prev;
1227- link->next = head;
1228- head->prev->next = link;
1229- head->prev = link;
1230+ link->prev = list->head.prev;
1231+ link->next = &list->head;
1232+ list->head.prev->next = link;
1233+ list->head.prev = link;
1234 }
1235
1236 /** Insert item before another item in doubly-linked circular list. */
1237 static inline void list_insert_before(link_t *l, link_t *r)
1238 {
1239- list_append(l, r);
1240-}
1241+ r->prev->next = l;
1242+ l->prev = r->prev;
1243+ r->prev = l;
1244+ l->next = r;
1245+}
1246
1247 /** Insert item after another item in doubly-linked circular list. */
1248 static inline void list_insert_after(link_t *r, link_t *l)
1249 {
1250- list_prepend(l, r);
1251+ l->next->prev = r;
1252+ r->next = l->next;
1253+ l->next = r;
1254+ r->prev = l;
1255 }
1256
1257 /** Remove item from doubly-linked circular list
1258@@ -137,9 +148,9 @@ static inline void list_remove(link_t *l
1259 *
1260 * @param head Pointer to link_t structure representing head of the list.
1261 */
1262-static inline int list_empty(link_t *head)
1263+static inline int list_empty(list_t *list)
1264 {
1265- return ((head->next == head) ? 1 : 0);
1266+ return ((list->head.next == &list->head) ? 1 : 0);
1267 }
1268
1269
1270@@ -191,9 +202,9 @@ static inline void headless_list_concat(
1271
1272 #define list_get_instance(link, type, member) ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member))))
1273
1274-extern int list_member(const link_t *link, const link_t *head);
1275-extern void list_concat(link_t *head1, link_t *head2);
1276-extern unsigned int list_count(const link_t *link);
1277+extern int list_member(const link_t *link, const list_t *head);
1278+extern void list_concat(list_t *head1, list_t *head2);
1279+extern unsigned int list_count(const list_t *link);
1280
1281 #endif
1282
1283diff -rup HelenOS-0.4.3/uspace/lib/c/include/async_sess.h HelenOS-0.4.3.new/uspace/lib/c/include/async_sess.h
1284--- HelenOS-0.4.3/uspace/lib/c/include/async_sess.h 2011-03-26 16:30:19.000000000 +0100
1285+++ HelenOS-0.4.3.new/uspace/lib/c/include/async_sess.h 2011-04-02 19:43:03.000000000 +0200
1286@@ -1,5 +1,6 @@
1287 /*
1288 * Copyright (c) 2010 Jakub Jermar
1289+ * Copyright (c) 2011 Mateusz Kocielski
1290 * All rights reserved.
1291 *
1292 * Redistribution and use in source and binary forms, with or without
1293@@ -40,7 +41,7 @@
1294 typedef struct {
1295 int sess_phone; /**< Phone for cloning off the connections. */
1296 sysarg_t connect_arg1; /**< Argument for CONNECT_ME_TO. */
1297- link_t conn_head; /**< List of open data connections. */
1298+ list_t conn_head; /**< List of open data connections. */
1299 link_t sess_link; /**< Link in global list of open sessions. */
1300 } async_sess_t;
1301
1302diff -rup HelenOS-0.4.3/uspace/lib/c/include/fibril_synch.h HelenOS-0.4.3.new/uspace/lib/c/include/fibril_synch.h
1303--- HelenOS-0.4.3/uspace/lib/c/include/fibril_synch.h 2011-03-26 16:30:19.000000000 +0100
1304+++ HelenOS-0.4.3.new/uspace/lib/c/include/fibril_synch.h 2011-04-02 19:26:04.000000000 +0200
1305@@ -1,5 +1,6 @@
1306 /*
1307 * Copyright (c) 2009 Jakub Jermar
1308+ * Copyright (c) 2011 Mateusz Kocielski
1309 * All rights reserved.
1310 *
1311 * Redistribution and use in source and binary forms, with or without
1312@@ -44,7 +45,7 @@
1313 typedef struct {
1314 fibril_owner_info_t oi; /* Keep this the first thing. */
1315 int counter;
1316- link_t waiters;
1317+ list_t waiters;
1318 } fibril_mutex_t;
1319
1320 #define FIBRIL_MUTEX_INITIALIZER(name) \
1321@@ -54,8 +55,10 @@ typedef struct {
1322 }, \
1323 .counter = 1, \
1324 .waiters = { \
1325- .prev = &name.waiters, \
1326- .next = &name.waiters, \
1327+ .head = { \
1328+ .prev = &name.waiters.head, \
1329+ .next = &name.waiters.head, \
1330+ }, \
1331 } \
1332 }
1333
1334@@ -66,7 +69,7 @@ typedef struct {
1335 fibril_owner_info_t oi; /* Keep this the first thing. */
1336 unsigned writers;
1337 unsigned readers;
1338- link_t waiters;
1339+ list_t waiters;
1340 } fibril_rwlock_t;
1341
1342 #define FIBRIL_RWLOCK_INITIALIZER(name) \
1343@@ -77,8 +80,10 @@ typedef struct {
1344 .readers = 0, \
1345 .writers = 0, \
1346 .waiters = { \
1347- .prev = &name.waiters, \
1348- .next = &name.waiters, \
1349+ .head = { \
1350+ .prev = &name.waiters.head, \
1351+ .next = &name.waiters.head, \
1352+ } \
1353 } \
1354 }
1355
1356@@ -86,14 +91,16 @@ typedef struct {
1357 fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name)
1358
1359 typedef struct {
1360- link_t waiters;
1361+ list_t waiters;
1362 } fibril_condvar_t;
1363
1364 #define FIBRIL_CONDVAR_INITIALIZER(name) \
1365 { \
1366 .waiters = { \
1367- .next = &name.waiters, \
1368- .prev = &name.waiters, \
1369+ .head = { \
1370+ .next = &name.waiters.head, \
1371+ .prev = &name.waiters.head, \
1372+ } \
1373 } \
1374 }
1375
1376diff -rup HelenOS-0.4.3/uspace/lib/c/include/ipc/devman.h HelenOS-0.4.3.new/uspace/lib/c/include/ipc/devman.h
1377--- HelenOS-0.4.3/uspace/lib/c/include/ipc/devman.h 2011-03-26 16:30:19.000000000 +0100
1378+++ HelenOS-0.4.3.new/uspace/lib/c/include/ipc/devman.h 2011-04-02 18:59:10.000000000 +0200
1379@@ -1,5 +1,7 @@
1380 /*
1381 * Copyright (c) 2010 Lenka Trochtova
1382+ * Copyright (c) 2011 Mateusz Kocielski
1383+ *
1384 * All rights reserved.
1385 *
1386 * Redistribution and use in source and binary forms, with or without
1387@@ -56,7 +58,7 @@ typedef enum {
1388 typedef struct match_id {
1389 /** Pointers to next and previous ids.
1390 */
1391- link_t link;
1392+ link_t link;
1393 /** Id of device model.
1394 */
1395 const char *id;
1396@@ -71,7 +73,7 @@ typedef struct match_id {
1397 * according to match scores in descending order.
1398 */
1399 typedef struct match_id_list {
1400- link_t ids;
1401+ list_t ids;
1402 } match_id_list_t;
1403
1404 static inline match_id_t *create_match_id(void)
1405@@ -94,9 +96,9 @@ static inline void delete_match_id(match
1406 static inline void add_match_id(match_id_list_t *ids, match_id_t *id)
1407 {
1408 match_id_t *mid = NULL;
1409- link_t *link = ids->ids.next;
1410+ link_t *link = ids->ids.head.next;
1411
1412- while (link != &ids->ids) {
1413+ while (link != &ids->ids.head) {
1414 mid = list_get_instance(link, match_id_t,link);
1415 if (mid->score < id->score) {
1416 break;
1417@@ -118,7 +120,7 @@ static inline void clean_match_ids(match
1418 match_id_t *id;
1419
1420 while(!list_empty(&ids->ids)) {
1421- link = ids->ids.next;
1422+ link = ids->ids.head.next;
1423 list_remove(link);
1424 id = list_get_instance(link, match_id_t, link);
1425 delete_match_id(id);
1426diff -rup HelenOS-0.4.3/uspace/lib/drv/generic/driver.c HelenOS-0.4.3.new/uspace/lib/drv/generic/driver.c
1427--- HelenOS-0.4.3/uspace/lib/drv/generic/driver.c 2011-03-26 16:30:19.000000000 +0100
1428+++ HelenOS-0.4.3.new/uspace/lib/drv/generic/driver.c 2011-04-02 20:02:16.000000000 +0200
1429@@ -1,6 +1,7 @@
1430 /*
1431 * Copyright (c) 2010 Lenka Trochtova
1432 * Copyright (c) 2011 Jiri Svoboda
1433+ * Copyright (c) 2011 Mateusz Kocielski
1434 * All rights reserved.
1435 *
1436 * Redistribution and use in source and binary forms, with or without
1437@@ -139,10 +140,10 @@ find_interrupt_context_by_id(interrupt_c
1438 {
1439 fibril_mutex_lock(&list->mutex);
1440
1441- link_t *link = list->contexts.next;
1442+ link_t *link = list->contexts.head.next;
1443 interrupt_context_t *ctx;
1444
1445- while (link != &list->contexts) {
1446+ while (link != &list->contexts.head) {
1447 ctx = list_get_instance(link, interrupt_context_t, link);
1448 if (ctx->id == id) {
1449 fibril_mutex_unlock(&list->mutex);
1450@@ -160,10 +161,10 @@ find_interrupt_context(interrupt_context
1451 {
1452 fibril_mutex_lock(&list->mutex);
1453
1454- link_t *link = list->contexts.next;
1455+ link_t *link = list->contexts.head.next;
1456 interrupt_context_t *ctx;
1457
1458- while (link != &list->contexts) {
1459+ while (link != &list->contexts.head) {
1460 ctx = list_get_instance(link, interrupt_context_t, link);
1461 if (ctx->irq == irq && ctx->dev == dev) {
1462 fibril_mutex_unlock(&list->mutex);
1463@@ -229,14 +230,14 @@ static void remove_from_functions_list(d
1464 fibril_mutex_unlock(&functions_mutex);
1465 }
1466
1467-static ddf_fun_t *driver_get_function(link_t *functions, devman_handle_t handle)
1468+static ddf_fun_t *driver_get_function(list_t *functions, devman_handle_t handle)
1469 {
1470 ddf_fun_t *fun = NULL;
1471
1472 fibril_mutex_lock(&functions_mutex);
1473- link_t *link = functions->next;
1474+ link_t *link = functions->head.next;
1475
1476- while (link != functions) {
1477+ while (link != &functions->head) {
1478 fun = list_get_instance(link, ddf_fun_t, link);
1479 if (fun->handle == handle) {
1480 fibril_mutex_unlock(&functions_mutex);
1481diff -rup HelenOS-0.4.3/uspace/lib/drv/include/ddf/interrupt.h HelenOS-0.4.3.new/uspace/lib/drv/include/ddf/interrupt.h
1482--- HelenOS-0.4.3/uspace/lib/drv/include/ddf/interrupt.h 2011-03-26 16:30:19.000000000 +0100
1483+++ HelenOS-0.4.3.new/uspace/lib/drv/include/ddf/interrupt.h 2011-04-02 20:00:01.000000000 +0200
1484@@ -1,5 +1,6 @@
1485 /*
1486 * Copyright (c) 2010 Lenka Trochtova
1487+ * Copyright (c) 2011 Mateusz Kocielski
1488 * All rights reserved.
1489 *
1490 * Redistribution and use in source and binary forms, with or without
1491@@ -59,7 +60,7 @@ typedef struct interrupt_context {
1492
1493 typedef struct interrupt_context_list {
1494 int curr_id;
1495- link_t contexts;
1496+ list_t contexts;
1497 fibril_mutex_t mutex;
1498 } interrupt_context_list_t;
1499
1500diff -rup HelenOS-0.4.3/uspace/srv/devman/devman.c HelenOS-0.4.3.new/uspace/srv/devman/devman.c
1501--- HelenOS-0.4.3/uspace/srv/devman/devman.c 2011-03-26 16:30:19.000000000 +0100
1502+++ HelenOS-0.4.3.new/uspace/srv/devman/devman.c 2011-04-02 20:36:22.000000000 +0200
1503@@ -1,5 +1,6 @@
1504 /*
1505 * Copyright (c) 2010 Lenka Trochtova
1506+ * Copyright (c) 2011 Mateusz Kocielski
1507 * All rights reserved.
1508 *
1509 * Redistribution and use in source and binary forms, with or without
1510@@ -459,8 +460,8 @@ driver_t *find_best_match_driver(driver_
1511
1512 fibril_mutex_lock(&drivers_list->drivers_mutex);
1513
1514- link_t *link = drivers_list->drivers.next;
1515- while (link != &drivers_list->drivers) {
1516+ link_t *link = drivers_list->drivers.head.next;
1517+ while (link != &drivers_list->drivers.head) {
1518 drv = list_get_instance(link, driver_t, drivers);
1519 score = get_match_score(drv, node);
1520 if (score > best_score) {
1521@@ -533,8 +534,8 @@ driver_t *find_driver(driver_list_t *drv
1522
1523 fibril_mutex_lock(&drv_list->drivers_mutex);
1524
1525- link = drv_list->drivers.next;
1526- while (link != &drv_list->drivers) {
1527+ link = drv_list->drivers.head.next;
1528+ while (link != &drv_list->drivers.head) {
1529 drv = list_get_instance(link, driver_t, drivers);
1530 if (str_cmp(drv->name, drv_name) == 0) {
1531 res = drv;
1532@@ -587,8 +588,8 @@ static void pass_devices_to_driver(drive
1533 * Go through devices list as long as there is some device
1534 * that has not been passed to the driver.
1535 */
1536- link = driver->devices.next;
1537- while (link != &driver->devices) {
1538+ link = driver->devices.head.next;
1539+ while (link != &driver->devices.head) {
1540 dev = list_get_instance(link, dev_node_t, driver_devices);
1541 if (dev->passed_to_driver) {
1542 link = link->next;
1543@@ -625,7 +626,7 @@ static void pass_devices_to_driver(drive
1544 /*
1545 * Restart the cycle to go through all devices again.
1546 */
1547- link = driver->devices.next;
1548+ link = driver->devices.head.next;
1549 }
1550
1551 async_hangup(phone);
1552@@ -881,7 +882,7 @@ dev_node_t *create_dev_node(void)
1553 memset(res, 0, sizeof(dev_node_t));
1554 list_initialize(&res->functions);
1555 link_initialize(&res->driver_devices);
1556- link_initialize(&res->devman_dev);
1557+ link_initialize(&res->devman_dev.head);
1558 }
1559
1560 return res;
1561@@ -949,8 +950,8 @@ fun_node_t *create_fun_node(void)
1562 link_initialize(&res->dev_functions);
1563 list_initialize(&res->match_ids.ids);
1564 list_initialize(&res->classes);
1565- link_initialize(&res->devman_fun);
1566- link_initialize(&res->devmap_fun);
1567+ link_initialize(&res->devman_fun.head);
1568+ link_initialize(&res->devmap_fun.head);
1569 }
1570
1571 return res;
1572@@ -1059,7 +1060,7 @@ bool insert_dev_node(dev_tree_t *tree, d
1573 /* Add the node to the handle-to-node map. */
1574 dev->handle = ++tree->current_handle;
1575 unsigned long key = dev->handle;
1576- hash_table_insert(&tree->devman_devices, &key, &dev->devman_dev);
1577+ hash_table_insert(&tree->devman_devices, &key, &dev->devman_dev.head);
1578
1579 /* Add the node to the list of its parent's children. */
1580 printf("insert_dev_node: dev=%p, dev->pfun := %p\n", dev, pfun);
1581@@ -1103,7 +1104,7 @@ bool insert_fun_node(dev_tree_t *tree, f
1582 /* Add the node to the handle-to-node map. */
1583 fun->handle = ++tree->current_handle;
1584 unsigned long key = fun->handle;
1585- hash_table_insert(&tree->devman_functions, &key, &fun->devman_fun);
1586+ hash_table_insert(&tree->devman_functions, &key, &fun->devman_fun.head);
1587
1588 /* Add the node to the list of its parent's children. */
1589 fun->dev = dev;
1590@@ -1169,9 +1170,9 @@ fun_node_t *find_node_child(fun_node_t *
1591 fun_node_t *fun;
1592 link_t *link;
1593
1594- link = pfun->child->functions.next;
1595+ link = pfun->child->functions.head.next;
1596
1597- while (link != &pfun->child->functions) {
1598+ while (link != &pfun->child->functions.head) {
1599 fun = list_get_instance(link, fun_node_t, dev_functions);
1600
1601 if (str_cmp(name, fun->name) == 0)
1602@@ -1324,9 +1325,9 @@ dev_class_t *find_dev_class_no_lock(clas
1603 const char *class_name)
1604 {
1605 dev_class_t *cl;
1606- link_t *link = class_list->classes.next;
1607+ link_t *link = class_list->classes.head.next;
1608
1609- while (link != &class_list->classes) {
1610+ while (link != &class_list->classes.head) {
1611 cl = list_get_instance(link, dev_class_t, link);
1612 if (str_cmp(cl->name, class_name) == 0) {
1613 return cl;
1614@@ -1403,7 +1404,7 @@ void tree_add_devmap_function(dev_tree_t
1615 {
1616 unsigned long key = (unsigned long) fun->devmap_handle;
1617 fibril_rwlock_write_lock(&tree->rwlock);
1618- hash_table_insert(&tree->devmap_functions, &key, &fun->devmap_fun);
1619+ hash_table_insert(&tree->devmap_functions, &key, &fun->devmap_fun.head);
1620 fibril_rwlock_write_unlock(&tree->rwlock);
1621 }
1622
1623diff -rup HelenOS-0.4.3/uspace/srv/devman/devman.h HelenOS-0.4.3.new/uspace/srv/devman/devman.h
1624--- HelenOS-0.4.3/uspace/srv/devman/devman.h 2011-03-26 16:30:19.000000000 +0100
1625+++ HelenOS-0.4.3.new/uspace/srv/devman/devman.h 2011-04-02 20:36:01.000000000 +0200
1626@@ -1,5 +1,6 @@
1627 /*
1628 * Copyright (c) 2010 Lenka Trochtova
1629+ * Copyright (c) 2011 Mateusz Kocielski
1630 * All rights reserved.
1631 *
1632 * Redistribution and use in source and binary forms, with or without
1633@@ -95,7 +96,7 @@ typedef struct driver {
1634 /** List of device ids for device-to-driver matching. */
1635 match_id_list_t match_ids;
1636 /** Pointer to the linked list of devices controlled by this driver. */
1637- link_t devices;
1638+ list_t devices;
1639
1640 /**
1641 * Fibril mutex for this driver - driver state, list of devices, phone.
1642@@ -106,7 +107,7 @@ typedef struct driver {
1643 /** The list of drivers. */
1644 typedef struct driver_list {
1645 /** List of drivers */
1646- link_t drivers;
1647+ list_t drivers;
1648 /** Fibril mutex for list of drivers. */
1649 fibril_mutex_t drivers_mutex;
1650 } driver_list_t;
1651@@ -128,7 +129,7 @@ struct dev_node {
1652 fun_node_t *pfun;
1653
1654 /** List of device functions. */
1655- link_t functions;
1656+ list_t functions;
1657 /** Driver of this device. */
1658 driver_t *drv;
1659 /** The state of the device. */
1660@@ -139,7 +140,7 @@ struct dev_node {
1661 /**
1662 * Used by the hash table of devices indexed by devman device handles.
1663 */
1664- link_t devman_dev;
1665+ list_t devman_dev;
1666
1667 /**
1668 * Whether this device was already passed to the driver.
1669@@ -169,19 +170,19 @@ struct fun_node {
1670 match_id_list_t match_ids;
1671
1672 /** The list of device classes to which this device function belongs. */
1673- link_t classes;
1674+ list_t classes;
1675 /** Devmap handle if the device function is registered by devmap. */
1676 devmap_handle_t devmap_handle;
1677
1678 /**
1679 * Used by the hash table of functions indexed by devman device handles.
1680 */
1681- link_t devman_fun;
1682+ list_t devman_fun;
1683
1684 /**
1685 * Used by the hash table of functions indexed by devmap device handles.
1686 */
1687- link_t devmap_fun;
1688+ list_t devmap_fun;
1689 };
1690
1691
1692@@ -226,7 +227,7 @@ typedef struct dev_class {
1693 * List of dev_class_info structures - one for each device registered by
1694 * this class.
1695 */
1696- link_t devices;
1697+ list_t devices;
1698
1699 /**
1700 * Default base name for the device within the class, might be overrided
1701@@ -278,7 +279,7 @@ typedef struct dev_class_info {
1702 /** The list of device classes. */
1703 typedef struct class_list {
1704 /** List of classes. */
1705- link_t classes;
1706+ list_t classes;
1707
1708 /**
1709 * Hash table of devices registered by devmapper using their class name,
1710diff -rup HelenOS-0.4.3/uspace/srv/devman/match.c HelenOS-0.4.3.new/uspace/srv/devman/match.c
1711--- HelenOS-0.4.3/uspace/srv/devman/match.c 2011-03-26 16:30:19.000000000 +0100
1712+++ HelenOS-0.4.3.new/uspace/srv/devman/match.c 2011-04-02 20:38:55.000000000 +0200
1713@@ -1,5 +1,6 @@
1714 /*
1715 * Copyright (c) 2010 Lenka Trochtova
1716+ * Copyright (c) 2011 Mateusz Kocielski
1717 * All rights reserved.
1718 *
1719 * Redistribution and use in source and binary forms, with or without
1720@@ -58,8 +59,8 @@ static int compute_match_score(match_id_
1721
1722 int get_match_score(driver_t *drv, dev_node_t *dev)
1723 {
1724- link_t *drv_head = &drv->match_ids.ids;
1725- link_t *dev_head = &dev->pfun->match_ids.ids;
1726+ list_t *drv_head = &drv->match_ids.ids;
1727+ list_t *dev_head = &dev->pfun->match_ids.ids;
1728
1729 if (list_empty(drv_head) || list_empty(dev_head))
1730 return 0;
1731@@ -69,10 +70,10 @@ int get_match_score(driver_t *drv, dev_n
1732 */
1733 int highest_score = 0;
1734
1735- link_t *drv_link = drv->match_ids.ids.next;
1736- while (drv_link != drv_head) {
1737- link_t *dev_link = dev_head->next;
1738- while (dev_link != dev_head) {
1739+ link_t *drv_link = drv->match_ids.ids.head.next;
1740+ while (drv_link != &drv_head->head) {
1741+ link_t *dev_link = dev_head->head.next;
1742+ while (dev_link != &dev_head->head) {
1743 match_id_t *drv_id = list_get_instance(drv_link, match_id_t, link);
1744 match_id_t *dev_id = list_get_instance(dev_link, match_id_t, link);
1745
1746diff -rup HelenOS-0.4.3/uspace/srv/devmap/devmap.c HelenOS-0.4.3.new/uspace/srv/devmap/devmap.c
1747--- HelenOS-0.4.3/uspace/srv/devmap/devmap.c 2011-03-26 16:30:19.000000000 +0100
1748+++ HelenOS-0.4.3.new/uspace/srv/devmap/devmap.c 2011-04-02 20:20:15.000000000 +0200
1749@@ -1,5 +1,6 @@
1750 /*
1751 * Copyright (c) 2007 Josef Cejka
1752+ * Copyright (c) 2011 Matuesz Kocielski
1753 * All rights reserved.
1754 *
1755 * Redistribution and use in source and binary forms, with or without
1756@@ -59,7 +60,7 @@ typedef struct {
1757 /** Pointers to previous and next drivers in linked list */
1758 link_t drivers;
1759 /** Pointer to the linked list of devices controlled by this driver */
1760- link_t devices;
1761+ list_t devices;
1762 /** Phone asociated with this driver */
1763 sysarg_t phone;
1764 /** Device driver name */
1765@@ -221,7 +222,7 @@ static devmap_namespace_t *devmap_namesp
1766
1767 assert(fibril_mutex_is_locked(&devices_list_mutex));
1768
1769- for (item = namespaces_list.next; item != &namespaces_list; item = item->next) {
1770+ for (item = namespaces_list.head.next; item != &namespaces_list.head; item = item->next) {
1771 devmap_namespace_t *namespace =
1772 list_get_instance(item, devmap_namespace_t, namespaces);
1773 if (str_cmp(namespace->name, name) == 0)
1774@@ -242,7 +243,7 @@ static devmap_namespace_t *devmap_namesp
1775
1776 assert(fibril_mutex_is_locked(&devices_list_mutex));
1777
1778- for (item = namespaces_list.next; item != &namespaces_list; item = item->next) {
1779+ for (item = namespaces_list.head.next; item != &namespaces_list.head; item = item->next) {
1780 devmap_namespace_t *namespace =
1781 list_get_instance(item, devmap_namespace_t, namespaces);
1782 if (namespace->handle == handle)
1783@@ -260,7 +261,7 @@ static devmap_device_t *devmap_device_fi
1784
1785 assert(fibril_mutex_is_locked(&devices_list_mutex));
1786
1787- for (item = devices_list.next; item != &devices_list; item = item->next) {
1788+ for (item = devices_list.head.next; item != &devices_list.head; item = item->next) {
1789 devmap_device_t *device =
1790 list_get_instance(item, devmap_device_t, devices);
1791 if ((str_cmp(device->namespace->name, ns_name) == 0)
1792@@ -282,7 +283,7 @@ static devmap_device_t *devmap_device_fi
1793
1794 assert(fibril_mutex_is_locked(&devices_list_mutex));
1795
1796- for (item = devices_list.next; item != &devices_list; item = item->next) {
1797+ for (item = devices_list.head.next; item != &devices_list.head; item = item->next) {
1798 devmap_device_t *device =
1799 list_get_instance(item, devmap_device_t, devices);
1800 if (device->handle == handle)
1801@@ -472,7 +473,8 @@ static int devmap_driver_unregister(devm
1802 fibril_mutex_lock(&driver->devices_mutex);
1803
1804 while (!list_empty(&(driver->devices))) {
1805- devmap_device_t *device = list_get_instance(driver->devices.next,
1806+ devmap_device_t *device =
1807+ list_get_instance(driver->devices.head.next,
1808 devmap_device_t, driver_devices);
1809 devmap_device_unregister_core(device);
1810 }
1811@@ -815,7 +817,7 @@ static void devmap_get_namespaces(ipc_ca
1812
1813 link_t *item;
1814 size_t pos = 0;
1815- for (item = namespaces_list.next; item != &namespaces_list;
1816+ for (item = namespaces_list.head.next; item != &namespaces_list.head;
1817 item = item->next) {
1818 devmap_namespace_t *namespace =
1819 list_get_instance(item, devmap_namespace_t, namespaces);
1820@@ -881,7 +883,7 @@ static void devmap_get_devices(ipc_calli
1821
1822 link_t *item;
1823 size_t pos = 0;
1824- for (item = devices_list.next; item != &devices_list; item = item->next) {
1825+ for (item = devices_list.head.next; item != &devices_list.head; item = item->next) {
1826 devmap_device_t *device =
1827 list_get_instance(item, devmap_device_t, devices);
1828
1829diff -rup HelenOS-0.4.3/uspace/srv/fs/fat/fat_idx.c HelenOS-0.4.3.new/uspace/srv/fs/fat/fat_idx.c
1830--- HelenOS-0.4.3/uspace/srv/fs/fat/fat_idx.c 2011-03-26 16:30:19.000000000 +0100
1831+++ HelenOS-0.4.3.new/uspace/srv/fs/fat/fat_idx.c 2011-04-02 20:48:10.000000000 +0200
1832@@ -65,7 +65,7 @@ typedef struct {
1833 uint64_t remaining;
1834
1835 /** Sorted list of intervals of freed indices. */
1836- link_t freed_head;
1837+ list_t freed_head;
1838 } unused_t;
1839
1840 /** Mutex protecting the list of unused structures. */
1841@@ -90,7 +90,7 @@ static unused_t *unused_find(devmap_hand
1842
1843 if (lock)
1844 fibril_mutex_lock(&unused_lock);
1845- for (l = unused_head.next; l != &unused_head; l = l->next) {
1846+ for (l = unused_head.head.next; l != &unused_head.head; l = l->next) {
1847 u = list_get_instance(l, unused_t, link);
1848 if (u->devmap_handle == devmap_handle)
1849 return u;
1850@@ -260,7 +260,7 @@ static bool fat_index_alloc(devmap_handl
1851 }
1852 } else {
1853 /* There are some freed indices which we can reuse. */
1854- freed_t *f = list_get_instance(u->freed_head.next, freed_t,
1855+ freed_t *f = list_get_instance(u->freed_head.head.next, freed_t,
1856 link);
1857 *index = f->first;
1858 if (f->first++ == f->last) {
1859@@ -318,12 +318,12 @@ static void fat_index_free(devmap_handle
1860 */
1861 link_t *lnk;
1862 freed_t *n;
1863- for (lnk = u->freed_head.next; lnk != &u->freed_head;
1864+ for (lnk = u->freed_head.head.next; lnk != &u->freed_head.head;
1865 lnk = lnk->next) {
1866 freed_t *f = list_get_instance(lnk, freed_t, link);
1867 if (f->first == index + 1) {
1868 f->first--;
1869- if (lnk->prev != &u->freed_head)
1870+ if (lnk->prev != &u->freed_head.head)
1871 try_coalesce_intervals(lnk->prev, lnk,
1872 lnk);
1873 fibril_mutex_unlock(&unused_lock);
1874@@ -331,7 +331,7 @@ static void fat_index_free(devmap_handle
1875 }
1876 if (f->last == index - 1) {
1877 f->last++;
1878- if (lnk->next != &u->freed_head)
1879+ if (lnk->next != &u->freed_head.head)
1880 try_coalesce_intervals(lnk, lnk->next,
1881 lnk);
1882 fibril_mutex_unlock(&unused_lock);
1883@@ -594,7 +594,7 @@ void fat_idx_fini_by_devmap_handle(devma
1884
1885 while (!list_empty(&u->freed_head)) {
1886 freed_t *f;
1887- f = list_get_instance(u->freed_head.next, freed_t, link);
1888+ f = list_get_instance(u->freed_head.head.next, freed_t, link);
1889 list_remove(&f->link);
1890 free(f);
1891 }
1892diff -rup HelenOS-0.4.3/uspace/srv/fs/fat/fat_ops.c HelenOS-0.4.3.new/uspace/srv/fs/fat/fat_ops.c
1893--- HelenOS-0.4.3/uspace/srv/fs/fat/fat_ops.c 2011-03-26 16:30:19.000000000 +0100
1894+++ HelenOS-0.4.3.new/uspace/srv/fs/fat/fat_ops.c 2011-04-02 20:46:25.000000000 +0200
1895@@ -157,7 +157,7 @@ static int fat_node_fini_by_devmap_handl
1896
1897 restart:
1898 fibril_mutex_lock(&ffn_mutex);
1899- for (lnk = ffn_head.next; lnk != &ffn_head; lnk = lnk->next) {
1900+ for (lnk = ffn_head.head.next; lnk != &ffn_head.head; lnk = lnk->next) {
1901 nodep = list_get_instance(lnk, fat_node_t, ffn_link);
1902 if (!fibril_mutex_trylock(&nodep->lock)) {
1903 fibril_mutex_unlock(&ffn_mutex);
1904@@ -212,7 +212,7 @@ static int fat_node_get_new(fat_node_t *
1905 if (!list_empty(&ffn_head)) {
1906 /* Try to use a cached free node structure. */
1907 fat_idx_t *idxp_tmp;
1908- nodep = list_get_instance(ffn_head.next, fat_node_t, ffn_link);
1909+ nodep = list_get_instance(ffn_head.head.next, fat_node_t, ffn_link);
1910 if (!fibril_mutex_trylock(&nodep->lock))
1911 goto skip_cache;
1912 idxp_tmp = nodep->idx;
1913diff -rup HelenOS-0.4.3/uspace/srv/fs/tmpfs/tmpfs.h HelenOS-0.4.3.new/uspace/srv/fs/tmpfs/tmpfs.h
1914--- HelenOS-0.4.3/uspace/srv/fs/tmpfs/tmpfs.h 2011-03-26 16:30:19.000000000 +0100
1915+++ HelenOS-0.4.3.new/uspace/srv/fs/tmpfs/tmpfs.h 2011-04-02 20:51:53.000000000 +0200
1916@@ -1,5 +1,6 @@
1917 /*
1918 * Copyright (c) 2008 Jakub Jermar
1919+ * Copyright (c) 2011 Mateusz Kocielski
1920 * All rights reserved.
1921 *
1922 * Redistribution and use in source and binary forms, with or without
1923@@ -66,7 +67,7 @@ typedef struct tmpfs_node {
1924 unsigned lnkcnt; /**< Link count. */
1925 size_t size; /**< File size if type is TMPFS_FILE. */
1926 void *data; /**< File content's if type is TMPFS_FILE. */
1927- link_t cs_head; /**< Head of child's siblings list. */
1928+ list_t cs_head; /**< Head of child's siblings list. */
1929 } tmpfs_node_t;
1930
1931 extern fs_reg_t tmpfs_reg;
1932diff -rup HelenOS-0.4.3/uspace/srv/fs/tmpfs/tmpfs_ops.c HelenOS-0.4.3.new/uspace/srv/fs/tmpfs/tmpfs_ops.c
1933--- HelenOS-0.4.3/uspace/srv/fs/tmpfs/tmpfs_ops.c 2011-03-26 16:30:19.000000000 +0100
1934+++ HelenOS-0.4.3.new/uspace/srv/fs/tmpfs/tmpfs_ops.c 2011-04-02 20:53:57.000000000 +0200
1935@@ -1,5 +1,6 @@
1936 /*
1937 * Copyright (c) 2008 Jakub Jermar
1938+ * Copyright (c) 2011 Mateusz Kocielski
1939 * All rights reserved.
1940 *
1941 * Redistribution and use in source and binary forms, with or without
1942@@ -180,7 +181,8 @@ static void nodes_remove_callback(link_t
1943 nh_link);
1944
1945 while (!list_empty(&nodep->cs_head)) {
1946- tmpfs_dentry_t *dentryp = list_get_instance(nodep->cs_head.next,
1947+ tmpfs_dentry_t *dentryp =
1948+ list_get_instance(nodep->cs_head.head.next,
1949 tmpfs_dentry_t, link);
1950
1951 assert(nodep->type == TMPFS_DIRECTORY);
1952@@ -263,7 +265,7 @@ int tmpfs_match(fs_node_t **rfn, fs_node
1953 tmpfs_node_t *parentp = TMPFS_NODE(pfn);
1954 link_t *lnk;
1955
1956- for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head;
1957+ for (lnk = parentp->cs_head.head.next; lnk != &parentp->cs_head.head;
1958 lnk = lnk->next) {
1959 tmpfs_dentry_t *dentryp;
1960 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link);
1961@@ -377,7 +379,7 @@ int tmpfs_link_node(fs_node_t *pfn, fs_n
1962 assert(parentp->type == TMPFS_DIRECTORY);
1963
1964 /* Check for duplicit entries. */
1965- for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head;
1966+ for (lnk = parentp->cs_head.head.next; lnk != &parentp->cs_head.head;
1967 lnk = lnk->next) {
1968 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link);
1969 if (!str_cmp(dentryp->name, nm))
1970@@ -415,7 +417,7 @@ int tmpfs_unlink_node(fs_node_t *pfn, fs
1971 if (!parentp)
1972 return EBUSY;
1973
1974- for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head;
1975+ for (lnk = parentp->cs_head.head.next; lnk != &parentp->cs_head.head;
1976 lnk = lnk->next) {
1977 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link);
1978 if (!str_cmp(dentryp->name, nm)) {
1979@@ -558,12 +560,12 @@ void tmpfs_read(ipc_callid_t rid, ipc_ca
1980 * If it bothers someone, it could be fixed by introducing a
1981 * hash table.
1982 */
1983- for (i = 0, lnk = nodep->cs_head.next;
1984- (i < pos) && (lnk != &nodep->cs_head);
1985+ for (i = 0, lnk = nodep->cs_head.head.next;
1986+ (i < pos) && (lnk != &nodep->cs_head.head);
1987 i++, lnk = lnk->next)
1988 ;
1989
1990- if (lnk == &nodep->cs_head) {
1991+ if (lnk == &nodep->cs_head.head) {
1992 async_answer_0(callid, ENOENT);
1993 async_answer_1(rid, ENOENT, 0);
1994 return;
1995diff -rup HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/dp8390.c HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/dp8390.c
1996--- HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/dp8390.c 2011-03-26 16:30:19.000000000 +0100
1997+++ HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/dp8390.c 2011-04-02 20:56:03.000000000 +0200
1998@@ -1,6 +1,7 @@
1999 /*
2000 * Copyright (c) 2009 Lukas Mejdrech
2001 * Copyright (c) 2011 Martin Decky
2002+ * Copyright (c) 2011 Mateusz Kocielski
2003 * All rights reserved.
2004 *
2005 * Redistribution and use in source and binary forms, with or without
2006@@ -480,14 +481,14 @@ static frame_t *ne2k_receive_frame(ne2k_
2007 return frame;
2008 }
2009
2010-static link_t *ne2k_receive(ne2k_t *ne2k)
2011+static list_t *ne2k_receive(ne2k_t *ne2k)
2012 {
2013 /*
2014 * Allocate memory for the list of received frames.
2015 * If the allocation fails here we still receive the
2016 * frames from the network, but they will be lost.
2017 */
2018- link_t *frames = (link_t *) malloc(sizeof(link_t));
2019+ list_t *frames = (list_t *) malloc(sizeof(list_t));
2020 if (frames != NULL)
2021 list_initialize(frames);
2022
2023@@ -564,10 +565,10 @@ static link_t *ne2k_receive(ne2k_t *ne2k
2024 return frames;
2025 }
2026
2027-link_t *ne2k_interrupt(ne2k_t *ne2k, uint8_t isr, uint8_t tsr)
2028+list_t *ne2k_interrupt(ne2k_t *ne2k, uint8_t isr, uint8_t tsr)
2029 {
2030 /* List of received frames */
2031- link_t *frames = NULL;
2032+ list_t *frames = NULL;
2033
2034 if (isr & (ISR_PTX | ISR_TXE)) {
2035 if (isr & ISR_TXE)
2036diff -rup HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/dp8390.h HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/dp8390.h
2037--- HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/dp8390.h 2011-03-26 16:30:19.000000000 +0100
2038+++ HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/dp8390.h 2011-04-02 20:57:02.000000000 +0200
2039@@ -1,6 +1,7 @@
2040 /*
2041 * Copyright (c) 2009 Lukas Mejdrech
2042 * Copyright (c) 2011 Martin Decky
2043+ * Copyright (c) 2011 Mateusz Kocielski
2044 * All rights reserved.
2045 *
2046 * Redistribution and use in source and binary forms, with or without
2047@@ -240,7 +241,7 @@ extern int ne2k_probe(ne2k_t *, void *,
2048 extern int ne2k_up(ne2k_t *);
2049 extern void ne2k_down(ne2k_t *);
2050 extern void ne2k_send(ne2k_t *, packet_t *);
2051-extern link_t *ne2k_interrupt(ne2k_t *, uint8_t, uint8_t);
2052+extern list_t *ne2k_interrupt(ne2k_t *, uint8_t, uint8_t);
2053
2054 #endif
2055
2056diff -rup HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/ne2000.c HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/ne2000.c
2057--- HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/ne2000.c 2011-03-26 16:30:19.000000000 +0100
2058+++ HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/ne2000.c 2011-04-02 20:58:00.000000000 +0200
2059@@ -1,6 +1,7 @@
2060 /*
2061 * Copyright (c) 2009 Lukas Mejdrech
2062 * Copyright (c) 2011 Martin Decky
2063+ * Copyright (c) 2011 Mateusz Kocielski
2064 * All rights reserved.
2065 *
2066 * Redistribution and use in source and binary forms, with or without
2067@@ -165,13 +166,13 @@ static void irq_handler(ipc_callid_t iid
2068 fibril_rwlock_read_unlock(&netif_globals.lock);
2069
2070 if (ne2k != NULL) {
2071- link_t *frames =
2072+ list_t *frames =
2073 ne2k_interrupt(ne2k, IRQ_GET_ISR(*call), IRQ_GET_TSR(*call));
2074
2075 if (frames != NULL) {
2076 while (!list_empty(frames)) {
2077 frame_t *frame =
2078- list_get_instance(frames->next, frame_t, link);
2079+ list_get_instance(frames->head.next, frame_t, link);
2080
2081 list_remove(&frame->link);
2082 nil_received_msg(nil_phone, device_id, frame->packet,
2083diff -rup HelenOS-0.4.3/uspace/srv/ns/clonable.c HelenOS-0.4.3.new/uspace/srv/ns/clonable.c
2084--- HelenOS-0.4.3/uspace/srv/ns/clonable.c 2011-03-26 16:30:19.000000000 +0100
2085+++ HelenOS-0.4.3.new/uspace/srv/ns/clonable.c 2011-04-02 20:41:24.000000000 +0200
2086@@ -1,5 +1,6 @@
2087 /*
2088 * Copyright (c) 2009 Martin Decky
2089+ * Copyright (c) 2011 Mateusz Kocielski
2090 * All rights reserved.
2091 *
2092 * Redistribution and use in source and binary forms, with or without
2093@@ -51,7 +52,7 @@ typedef struct {
2094 } cs_req_t;
2095
2096 /** List of clonable-service connection requests. */
2097-static link_t cs_req;
2098+static list_t cs_req;
2099
2100 int clonable_init(void)
2101 {
2102@@ -82,7 +83,7 @@ void register_clonable(sysarg_t service,
2103 return;
2104 }
2105
2106- cs_req_t *csr = list_get_instance(cs_req.next, cs_req_t, link);
2107+ cs_req_t *csr = list_get_instance(cs_req.head.next, cs_req_t, link);
2108 list_remove(&csr->link);
2109
2110 /* Currently we can only handle a single type of clonable service. */
2111diff -rup HelenOS-0.4.3/uspace/srv/ns/service.c HelenOS-0.4.3.new/uspace/srv/ns/service.c
2112--- HelenOS-0.4.3/uspace/srv/ns/service.c 2011-03-26 16:30:19.000000000 +0100
2113+++ HelenOS-0.4.3.new/uspace/srv/ns/service.c 2011-04-02 20:40:47.000000000 +0200
2114@@ -1,5 +1,6 @@
2115 /*
2116 * Copyright (c) 2009 Martin Decky
2117+ * Copyright (c) 2011 Mateusz Kocielski
2118 * All rights reserved.
2119 *
2120 * Redistribution and use in source and binary forms, with or without
2121@@ -120,7 +121,7 @@ typedef struct {
2122 sysarg_t arg3; /**< Third argument */
2123 } pending_conn_t;
2124
2125-static link_t pending_conn;
2126+static list_t pending_conn;
2127
2128 int service_init(void)
2129 {
2130@@ -141,7 +142,7 @@ void process_pending_conn(void)
2131 link_t *cur;
2132
2133 loop:
2134- for (cur = pending_conn.next; cur != &pending_conn; cur = cur->next) {
2135+ for (cur = pending_conn.head.next; cur != &pending_conn.head; cur = cur->next) {
2136 pending_conn_t *pr = list_get_instance(cur, pending_conn_t, link);
2137
2138 unsigned long keys[3] = {
2139diff -rup HelenOS-0.4.3/uspace/srv/ns/task.c HelenOS-0.4.3.new/uspace/srv/ns/task.c
2140--- HelenOS-0.4.3/uspace/srv/ns/task.c 2011-03-26 16:30:19.000000000 +0100
2141+++ HelenOS-0.4.3.new/uspace/srv/ns/task.c 2011-04-02 20:42:03.000000000 +0200
2142@@ -187,7 +187,7 @@ typedef struct {
2143 ipc_callid_t callid; /**< Call ID waiting for the connection */
2144 } pending_wait_t;
2145
2146-static link_t pending_wait;
2147+static list_t pending_wait;
2148
2149 int task_init(void)
2150 {
2151@@ -214,7 +214,7 @@ void process_pending_wait(void)
2152 task_exit_t texit;
2153
2154 loop:
2155- for (cur = pending_wait.next; cur != &pending_wait; cur = cur->next) {
2156+ for (cur = pending_wait.head.next; cur != &pending_wait.head; cur = cur->next) {
2157 pending_wait_t *pr = list_get_instance(cur, pending_wait_t, link);
2158
2159 unsigned long keys[2] = {
2160diff -rup HelenOS-0.4.3/uspace/srv/vfs/vfs.h HelenOS-0.4.3.new/uspace/srv/vfs/vfs.h
2161--- HelenOS-0.4.3/uspace/srv/vfs/vfs.h 2011-03-26 16:30:19.000000000 +0100
2162+++ HelenOS-0.4.3.new/uspace/srv/vfs/vfs.h 2011-04-02 20:44:22.000000000 +0200
2163@@ -146,7 +146,7 @@ extern fibril_mutex_t nodes_mutex;
2164
2165 extern fibril_condvar_t fs_head_cv;
2166 extern fibril_mutex_t fs_head_lock;
2167-extern link_t fs_head; /**< List of registered file systems. */
2168+extern list_t fs_head; /**< List of registered file systems. */
2169
2170 extern vfs_pair_t rootfs; /**< Root file system. */
2171
2172@@ -159,7 +159,7 @@ typedef struct {
2173
2174 extern fibril_mutex_t plb_mutex;/**< Mutex protecting plb and plb_head. */
2175 extern uint8_t *plb; /**< Path Lookup Buffer */
2176-extern link_t plb_head; /**< List of active PLB entries. */
2177+extern list_t plb_head; /**< List of active PLB entries. */
2178
2179 #define MAX_MNTOPTS_LEN 256
2180
2181diff -rup HelenOS-0.4.3/uspace/srv/vfs/vfs_lookup.c HelenOS-0.4.3.new/uspace/srv/vfs/vfs_lookup.c
2182--- HelenOS-0.4.3/uspace/srv/vfs/vfs_lookup.c 2011-03-26 16:30:19.000000000 +0100
2183+++ HelenOS-0.4.3.new/uspace/srv/vfs/vfs_lookup.c 2011-04-02 20:43:02.000000000 +0200
2184@@ -1,5 +1,6 @@
2185 /*
2186 * Copyright (c) 2008 Jakub Jermar
2187+ * Copyright (c) 2011 Mateusz Kocielski
2188 * All rights reserved.
2189 *
2190 * Redistribution and use in source and binary forms, with or without
2191@@ -105,9 +106,9 @@ int vfs_lookup_internal(char *path, int
2192 first = 0;
2193 last = PLB_SIZE - 1;
2194 } else {
2195- plb_entry_t *oldest = list_get_instance(plb_head.next,
2196+ plb_entry_t *oldest = list_get_instance(plb_head.head.next,
2197 plb_entry_t, plb_link);
2198- plb_entry_t *newest = list_get_instance(plb_head.prev,
2199+ plb_entry_t *newest = list_get_instance(plb_head.head.prev,
2200 plb_entry_t, plb_link);
2201
2202 first = (newest->index + newest->len) % PLB_SIZE;
2203diff -rup HelenOS-0.4.3/uspace/srv/vfs/vfs_register.c HelenOS-0.4.3.new/uspace/srv/vfs/vfs_register.c
2204--- HelenOS-0.4.3/uspace/srv/vfs/vfs_register.c 2011-03-26 16:30:19.000000000 +0100
2205+++ HelenOS-0.4.3.new/uspace/srv/vfs/vfs_register.c 2011-04-02 20:45:34.000000000 +0200
2206@@ -267,7 +267,7 @@ int vfs_grab_phone(fs_handle_t handle)
2207 * that they do not have to be reestablished over and over again.
2208 */
2209 fibril_mutex_lock(&fs_head_lock);
2210- for (cur = fs_head.next; cur != &fs_head; cur = cur->next) {
2211+ for (cur = fs_head.head.next; cur != &fs_head.head; cur = cur->next) {
2212 fs = list_get_instance(cur, fs_info_t, fs_link);
2213 if (fs->fs_handle == handle) {
2214 fibril_mutex_unlock(&fs_head_lock);
2215@@ -291,7 +291,7 @@ void vfs_release_phone(fs_handle_t handl
2216 fs_info_t *fs;
2217
2218 fibril_mutex_lock(&fs_head_lock);
2219- for (cur = fs_head.next; cur != &fs_head; cur = cur->next) {
2220+ for (cur = fs_head.head.next; cur != &fs_head.head; cur = cur->next) {
2221 fs = list_get_instance(cur, fs_info_t, fs_link);
2222 if (fs->fs_handle == handle) {
2223 fibril_mutex_unlock(&fs_head_lock);
2224@@ -319,7 +319,7 @@ fs_handle_t fs_name_to_handle(char *name
2225 if (lock)
2226 fibril_mutex_lock(&fs_head_lock);
2227 link_t *cur;
2228- for (cur = fs_head.next; cur != &fs_head; cur = cur->next) {
2229+ for (cur = fs_head.head.next; cur != &fs_head.head; cur = cur->next) {
2230 fs_info_t *fs = list_get_instance(cur, fs_info_t, fs_link);
2231 if (str_cmp(fs->vfs_info.name, name) == 0) {
2232 handle = fs->fs_handle;
2233@@ -342,7 +342,7 @@ vfs_info_t *fs_handle_to_info(fs_handle_
2234 link_t *cur;
2235
2236 fibril_mutex_lock(&fs_head_lock);
2237- for (cur = fs_head.next; cur != &fs_head; cur = cur->next) {
2238+ for (cur = fs_head.head.next; cur != &fs_head.head; cur = cur->next) {
2239 fs_info_t *fs = list_get_instance(cur, fs_info_t, fs_link);
2240 if (fs->fs_handle == handle) {
2241 info = &fs->vfs_info;