diff -rup HelenOS-0.4.3/uspace/app/edit/sheet.c HelenOS-0.4.3.new/uspace/app/edit/sheet.c --- HelenOS-0.4.3/uspace/app/edit/sheet.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/edit/sheet.c 2011-04-02 20:04:36.000000000 +0200 @@ -120,8 +120,8 @@ int sheet_insert(sheet_t *sh, spt_t *pos /* Adjust tags. */ - link = sh->tags_head.next; - while (link != &sh->tags_head) { + link = sh->tags_head.head.next; + while (link != &sh->tags_head.head) { tag = list_get_instance(link, tag_t, link); if (tag->b_off > pos->b_off) @@ -161,8 +161,8 @@ int sheet_delete(sheet_t *sh, spt_t *spo sh->text_size -= sz; /* Adjust tags. */ - link = sh->tags_head.next; - while (link != &sh->tags_head) { + link = sh->tags_head.head.next; + while (link != &sh->tags_head.head) { tag = list_get_instance(link, tag_t, link); if (tag->b_off >= epos->b_off) diff -rup HelenOS-0.4.3/uspace/app/edit/sheet.h HelenOS-0.4.3.new/uspace/app/edit/sheet.h --- HelenOS-0.4.3/uspace/app/edit/sheet.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/edit/sheet.h 2011-04-02 20:04:03.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009 Jiri Svoboda + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +57,7 @@ typedef struct { size_t dbuf_size; char *data; - link_t tags_head; + list_t tags_head; } sheet_t; /** Character cell coordinates diff -rup HelenOS-0.4.3/uspace/app/sbi/src/intmap_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/intmap_t.h --- HelenOS-0.4.3/uspace/app/sbi/src/intmap_t.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/intmap_t.h 2011-04-02 20:13:23.000000000 +0200 @@ -37,7 +37,7 @@ typedef struct { } map_elem_t; typedef struct intmap { - list_t elem; /* of (map_elem_t *) */ + list_head_t elem; /* of (map_elem_t *) */ } intmap_t; #endif diff -rup HelenOS-0.4.3/uspace/app/sbi/src/list.c HelenOS-0.4.3.new/uspace/app/sbi/src/list.c --- HelenOS-0.4.3/uspace/app/sbi/src/list.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/list.c 2011-04-02 20:13:23.000000000 +0200 @@ -44,13 +44,13 @@ static list_node_t *list_node_new(void * static void list_node_delete(list_node_t *node); static void list_node_insert_between(list_node_t *n, list_node_t *a, list_node_t *b); static void list_node_unlink(list_node_t *n); -static bool_t list_node_present(list_t *list, list_node_t *node); +static bool_t list_node_present(list_head_t *list, list_node_t *node); /** Initialize list. * * @param list List to initialize. */ -void list_init(list_t *list) +void list_init(list_head_t *list) { list->head.prev = &list->head; list->head.next = &list->head; @@ -60,7 +60,7 @@ void list_init(list_t *list) * * @param list List to deinitialize. */ -void list_fini(list_t *list) +void list_fini(list_head_t *list) { assert(list_is_empty(list)); @@ -75,7 +75,7 @@ void list_fini(list_t *list) * @param list Linked list. * @param data Data for the new node. */ -void list_append(list_t *list, void *data) +void list_append(list_head_t *list, void *data) { list_node_t *node; @@ -90,7 +90,7 @@ void list_append(list_t *list, void *dat * @param list Linked list. * @param data Data for the new node. */ -void list_prepend(list_t *list, void *data) +void list_prepend(list_head_t *list, void *data) { list_node_t *node; @@ -107,7 +107,7 @@ void list_prepend(list_t *list, void *da * @param list Linked list. * @param node List node to remove. */ -void list_remove(list_t *list, list_node_t *node) +void list_remove(list_head_t *list, list_node_t *node) { /* Check whether node is in the list as claimed. */ assert(list_node_present(list, node)); @@ -121,7 +121,7 @@ void list_remove(list_t *list, list_node * @param list Linked list. * @return First node of the list or @c NULL if the list is empty. */ -list_node_t *list_first(list_t *list) +list_node_t *list_first(list_head_t *list) { list_node_t *node; @@ -136,7 +136,7 @@ list_node_t *list_first(list_t *list) * @param list Linked list. * @return Last node of the list or @c NULL if the list is empty. */ -list_node_t *list_last(list_t *list) +list_node_t *list_last(list_head_t *list) { list_node_t *node; @@ -152,7 +152,7 @@ list_node_t *list_last(list_t *list) * @param node Node whose successor we are interested in. * @return Following list node or @c NULL if @a node is last. */ -list_node_t *list_next(list_t *list, list_node_t *node) +list_node_t *list_next(list_head_t *list, list_node_t *node) { (void) list; assert(list != NULL); @@ -167,7 +167,7 @@ list_node_t *list_next(list_t *list, lis * @param node Node whose predecessor we are interested in. * @return Preceding list node or @c NULL if @a node is last. */ -list_node_t *list_prev(list_t *list, list_node_t *node) +list_node_t *list_prev(list_head_t *list, list_node_t *node) { (void) list; assert(list != NULL); @@ -181,7 +181,7 @@ list_node_t *list_prev(list_t *list, lis * @param list Linked list. * @return @c b_true if list is empty, @c b_false otherwise. */ -bool_t list_is_empty(list_t *list) +bool_t list_is_empty(list_head_t *list) { return (list_first(list) == NULL); } @@ -285,7 +285,7 @@ static void list_node_unlink(list_node_t * @param node Node. * @return @c b_true if @a node is part of @a list, @c b_false otherwise. */ -static bool_t list_node_present(list_t *list, list_node_t *node) +static bool_t list_node_present(list_head_t *list, list_node_t *node) { list_node_t *m; diff -rup HelenOS-0.4.3/uspace/app/sbi/src/list.h HelenOS-0.4.3.new/uspace/app/sbi/src/list.h --- HelenOS-0.4.3/uspace/app/sbi/src/list.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/list.h 2011-04-02 20:13:23.000000000 +0200 @@ -32,17 +32,17 @@ #include "mytypes.h" #include "compat.h" -void list_init(list_t *list); -void list_fini(list_t *list); -void list_append(list_t *list, void *data); -void list_prepend(list_t *list, void *data); -void list_remove(list_t *list, list_node_t *node); +void list_init(list_head_t *list); +void list_fini(list_head_t *list); +void list_append(list_head_t *list, void *data); +void list_prepend(list_head_t *list, void *data); +void list_remove(list_head_t *list, list_node_t *node); -list_node_t *list_first(list_t *list); -list_node_t *list_last(list_t *list); -list_node_t *list_next(list_t *list, list_node_t *node); -list_node_t *list_prev(list_t *list, list_node_t *node); -bool_t list_is_empty(list_t *list); +list_node_t *list_first(list_head_t *list); +list_node_t *list_last(list_head_t *list); +list_node_t *list_next(list_head_t *list, list_node_t *node); +list_node_t *list_prev(list_head_t *list, list_node_t *node); +bool_t list_is_empty(list_head_t *list); void list_node_setdata(list_node_t *node, void *data); diff -rup HelenOS-0.4.3/uspace/app/sbi/src/list_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/list_t.h --- HelenOS-0.4.3/uspace/app/sbi/src/list_t.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/list_t.h 2011-04-02 20:13:23.000000000 +0200 @@ -37,6 +37,6 @@ typedef struct list_node { typedef struct list { /** Empty head (no data) */ list_node_t head; -} list_t; +} list_head_t; #endif diff -rup HelenOS-0.4.3/uspace/app/sbi/src/rdata_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/rdata_t.h --- HelenOS-0.4.3/uspace/app/sbi/src/rdata_t.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/rdata_t.h 2011-04-02 20:13:23.000000000 +0200 @@ -219,7 +219,7 @@ typedef struct { rdata_deleg_t *object_d; /** Arguments (indices) */ - list_t args; /* of rdata_item_t */ + list_head_t args; /* of rdata_item_t */ } rdata_aprop_indexed_t; typedef enum { diff -rup HelenOS-0.4.3/uspace/app/sbi/src/run.c HelenOS-0.4.3.new/uspace/app/sbi/src/run.c --- HelenOS-0.4.3/uspace/app/sbi/src/run.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/run.c 2011-04-02 20:13:23.000000000 +0200 @@ -101,7 +101,7 @@ void run_program(run_t *run, stree_progr stree_fun_t *main_fun; rdata_var_t *main_obj; stree_ident_t *fake_ident; - list_t main_args; + list_head_t main_args; run_proc_ar_t *proc_ar; rdata_item_t *res; @@ -1181,12 +1181,12 @@ void run_proc_ar_destroy(run_t *run, run * @param arg_vals List of value items (rdata_item_t *) -- real * argument values */ -void run_proc_ar_set_args(run_t *run, run_proc_ar_t *proc_ar, list_t *arg_vals) +void run_proc_ar_set_args(run_t *run, run_proc_ar_t *proc_ar, list_head_t *arg_vals) { stree_ctor_t *ctor; stree_fun_t *fun; stree_prop_t *prop; - list_t *args; + list_head_t *args; stree_proc_arg_t *varg; stree_symbol_t *outer_symbol; diff -rup HelenOS-0.4.3/uspace/app/sbi/src/run_expr.c HelenOS-0.4.3.new/uspace/app/sbi/src/run_expr.c --- HelenOS-0.4.3/uspace/app/sbi/src/run_expr.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/run_expr.c 2011-04-02 20:13:23.000000000 +0200 @@ -92,7 +92,7 @@ static void run_new_array(run_t *run, st static void run_new_object(run_t *run, stree_new_t *new_op, tdata_item_t *titem, rdata_item_t **res); -static void run_object_ctor(run_t *run, rdata_var_t *obj, list_t *arg_vals); +static void run_object_ctor(run_t *run, rdata_var_t *obj, list_head_t *arg_vals); static void run_access(run_t *run, stree_access_t *access, rdata_item_t **res); static void run_access_item(run_t *run, stree_access_t *access, @@ -111,16 +111,16 @@ static void run_access_symbol(run_t *run rdata_item_t *arg, rdata_item_t **res); static void run_call(run_t *run, stree_call_t *call, rdata_item_t **res); -static void run_call_args(run_t *run, list_t *args, list_t *arg_vals); -static void run_destroy_arg_vals(list_t *arg_vals); +static void run_call_args(run_t *run, list_head_t *args, list_head_t *arg_vals); +static void run_destroy_arg_vals(list_head_t *arg_vals); static void run_index(run_t *run, stree_index_t *index, rdata_item_t **res); static void run_index_array(run_t *run, stree_index_t *index, - rdata_item_t *base, list_t *args, rdata_item_t **res); + rdata_item_t *base, list_head_t *args, rdata_item_t **res); static void run_index_object(run_t *run, stree_index_t *index, - rdata_item_t *base, list_t *args, rdata_item_t **res); + rdata_item_t *base, list_head_t *args, rdata_item_t **res); static void run_index_string(run_t *run, stree_index_t *index, - rdata_item_t *base, list_t *args, rdata_item_t **res); + rdata_item_t *base, list_head_t *args, rdata_item_t **res); static void run_assign(run_t *run, stree_assign_t *assign, rdata_item_t **res); static void run_as(run_t *run, stree_as_t *as_op, rdata_item_t **res); static void run_box(run_t *run, stree_box_t *box, rdata_item_t **res); @@ -1510,7 +1510,7 @@ static void run_new_object(run_t *run, s { stree_csi_t *csi; rdata_item_t *obj_i; - list_t arg_vals; + list_head_t arg_vals; #ifdef DEBUG_RUN_TRACE printf("Create new object.\n"); @@ -1999,7 +1999,7 @@ static void run_call(run_t *run, stree_c { rdata_item_t *rdeleg, *rdeleg_vi; rdata_deleg_t *deleg_v; - list_t arg_vals; + list_head_t arg_vals; stree_fun_t *fun; run_proc_ar_t *proc_ar; @@ -2095,7 +2095,7 @@ cleanup: * @param arg_vals Address of uninitialized list to store argument values * (list of rdata_item_t). */ -static void run_call_args(run_t *run, list_t *args, list_t *arg_vals) +static void run_call_args(run_t *run, list_head_t *args, list_head_t *arg_vals) { list_node_t *arg_n; stree_expr_t *arg; @@ -2138,7 +2138,7 @@ error: * @param arg_vals List of evaluated arguments (value items, * rdata_item_t). */ -static void run_destroy_arg_vals(list_t *arg_vals) +static void run_destroy_arg_vals(list_head_t *arg_vals) { list_node_t *val_n; rdata_item_t *val_i; @@ -2174,7 +2174,7 @@ static void run_index(run_t *run, stree_ stree_expr_t *arg; rdata_item_t *rarg_i, *rarg_vi; var_class_t vc; - list_t arg_vals; + list_head_t arg_vals; list_node_t *val_n; rdata_item_t *val_i; @@ -2270,7 +2270,7 @@ cleanup: * @param res Place to store result */ static void run_index_array(run_t *run, stree_index_t *index, - rdata_item_t *base, list_t *args, rdata_item_t **res) + rdata_item_t *base, list_head_t *args, rdata_item_t **res) { list_node_t *node; rdata_array_t *array; @@ -2370,7 +2370,7 @@ static void run_index_array(run_t *run, * @param res Place to store result */ static void run_index_object(run_t *run, stree_index_t *index, - rdata_item_t *base, list_t *args, rdata_item_t **res) + rdata_item_t *base, list_head_t *args, rdata_item_t **res) { rdata_item_t *ritem; rdata_address_t *address; @@ -2458,7 +2458,7 @@ static void run_index_object(run_t *run, * @param res Place to store result */ static void run_index_string(run_t *run, stree_index_t *index, - rdata_item_t *base, list_t *args, rdata_item_t **res) + rdata_item_t *base, list_head_t *args, rdata_item_t **res) { list_node_t *node; rdata_string_t *string; @@ -2907,7 +2907,7 @@ void run_new_csi_inst(run_t *run, stree_ * @param obj Object to run constructor on * @param arg_vals Argument values (list of rdata_item_t) */ -static void run_object_ctor(run_t *run, rdata_var_t *obj, list_t *arg_vals) +static void run_object_ctor(run_t *run, rdata_var_t *obj, list_head_t *arg_vals) { stree_ident_t *ctor_ident; stree_symbol_t *csi_sym; diff -rup HelenOS-0.4.3/uspace/app/sbi/src/run.h HelenOS-0.4.3.new/uspace/app/sbi/src/run.h --- HelenOS-0.4.3/uspace/app/sbi/src/run.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/run.h 2011-04-02 20:13:23.000000000 +0200 @@ -55,7 +55,7 @@ rdata_var_t *run_fun_sobject_find(run_t void run_value_item_to_var(rdata_item_t *item, rdata_var_t **var); void run_proc_ar_set_args(run_t *run, run_proc_ar_t *proc_ar, - list_t *arg_vals); + list_head_t *arg_vals); void run_proc_ar_set_setter_arg(run_t *run, run_proc_ar_t *proc_ar, rdata_item_t *arg_val); void run_proc_ar_create(run_t *run, rdata_var_t *obj, stree_proc_t *proc, diff -rup HelenOS-0.4.3/uspace/app/sbi/src/run_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/run_t.h --- HelenOS-0.4.3/uspace/app/sbi/src/run_t.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/run_t.h 2011-04-02 20:13:23.000000000 +0200 @@ -58,7 +58,7 @@ typedef struct run_proc_ar { struct stree_proc *proc; /** Block activation records */ - list_t block_ar; /* of run_block_ar_t */ + list_head_t block_ar; /* of run_block_ar_t */ /** Procedure return value or @c NULL if not set. */ struct rdata_item *retval; @@ -91,7 +91,7 @@ typedef enum { */ typedef struct run_thread_ar { /** Function activation records */ - list_t proc_ar; /* of run_proc_ar_t */ + list_head_t proc_ar; /* of run_proc_ar_t */ /** Bailout mode */ run_bailout_mode_t bo_mode; diff -rup HelenOS-0.4.3/uspace/app/sbi/src/stree_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/stree_t.h --- HelenOS-0.4.3/uspace/app/sbi/src/stree_t.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/stree_t.h 2011-04-02 20:13:23.000000000 +0200 @@ -161,7 +161,7 @@ typedef struct { struct stree_texpr *texpr; /** Constructor arguments */ - list_t ctor_args; /* of stree_expr_t */ + list_head_t ctor_args; /* of stree_expr_t */ } stree_new_t; /** Member access operation */ @@ -184,7 +184,7 @@ typedef struct { struct stree_expr *fun; /** Arguments */ - list_t args; /* of stree_expr_t */ + list_head_t args; /* of stree_expr_t */ } stree_call_t; typedef enum { @@ -210,7 +210,7 @@ typedef struct { struct stree_expr *base; /** Arguments (indices) */ - list_t args; /* of stree_expr_t */ + list_head_t args; /* of stree_expr_t */ } stree_index_t; /** @c as conversion operation */ @@ -333,7 +333,7 @@ typedef struct { struct stree_texpr *gtype; /** (Formal) type arguments */ - list_t targs; /* of stree_texpr_t */ + list_head_t targs; /* of stree_texpr_t */ } stree_tapply_t; /** Type index operation */ @@ -351,7 +351,7 @@ typedef struct { int n_args; /** Arguments (extents) */ - list_t args; /* of stree_expr_t */ + list_head_t args; /* of stree_expr_t */ } stree_tindex_t; /** Type expression class */ @@ -386,7 +386,7 @@ typedef struct stree_texpr { /** Statement block */ typedef struct stree_block { /** List of statements in the block */ - list_t stats; /* of stree_stat_t */ + list_head_t stats; /* of stree_stat_t */ } stree_block_t; /** Variable declaration */ @@ -417,7 +417,7 @@ typedef struct { /** If statement */ typedef struct { /** If and elif clauses */ - list_t if_clauses; /* of stree_if_clause_t */ + list_head_t if_clauses; /* of stree_if_clause_t */ /** Else block */ stree_block_t *else_block; @@ -426,7 +426,7 @@ typedef struct { /** @c when clause */ typedef struct { /** List of expressions -- cases -- for this clause */ - list_t exprs; /* of stree_expr_t */ + list_head_t exprs; /* of stree_expr_t */ stree_block_t *block; } stree_when_t; @@ -436,7 +436,7 @@ typedef struct { stree_expr_t *expr; /** When clauses */ - list_t when_clauses; /* of stree_when_t */ + list_head_t when_clauses; /* of stree_when_t */ /** Else block */ stree_block_t *else_block; @@ -475,7 +475,7 @@ typedef struct { /** With-try-except-finally (WEF) statement */ typedef struct { stree_block_t *with_block; - list_t except_clauses; /* of stree_except_t */ + list_head_t except_clauses; /* of stree_except_t */ stree_block_t *finally_block; } stree_wef_t; @@ -531,7 +531,7 @@ typedef struct { stree_texpr_t *type; /* Attributes */ - list_t attr; /* of stree_arg_attr_t */ + list_head_t attr; /* of stree_arg_attr_t */ } stree_proc_arg_t; /** Function signature. @@ -541,7 +541,7 @@ typedef struct { */ typedef struct { /** Formal parameters */ - list_t args; /* of stree_proc_arg_t */ + list_head_t args; /* of stree_proc_arg_t */ /** Variadic argument or @c NULL if none. */ stree_proc_arg_t *varg; @@ -618,7 +618,7 @@ typedef struct stree_enum { struct stree_symbol *symbol; /** List of enum members */ - list_t members; /* of stree_embr_t */ + list_head_t members; /* of stree_embr_t */ /** Type item describing the enum */ struct tdata_item *titem; @@ -661,7 +661,7 @@ typedef struct stree_prop { stree_proc_arg_t *setter_arg; /** Formal parameters (for indexed properties) */ - list_t args; /* of stree_proc_arg_t */ + list_head_t args; /* of stree_proc_arg_t */ /** Variadic argument or @c NULL if none. */ stree_proc_arg_t *varg; @@ -722,25 +722,25 @@ typedef struct stree_csi { stree_ident_t *name; /** List of type arguments */ - list_t targ; /* of stree_targ_t */ + list_head_t targ; /* of stree_targ_t */ /** Symbol for this CSI */ struct stree_symbol *symbol; /** Type expressions referencing inherited CSIs. */ - list_t inherit; /* of stree_texpr_t */ + list_head_t inherit; /* of stree_texpr_t */ /** Base CSI. Only available when ancr_state == ws_visited. */ struct stree_csi *base_csi; /** Types of implemented or accumulated interfaces. */ - list_t impl_if_ti; /* of tdata_item_t */ + list_head_t impl_if_ti; /* of tdata_item_t */ /** Node state for ancr walks. */ walk_state_t ancr_state; /** List of CSI members */ - list_t members; /* of stree_csimbr_t */ + list_head_t members; /* of stree_csimbr_t */ } stree_csi_t; typedef enum { @@ -762,7 +762,7 @@ typedef struct { /** Module */ typedef struct stree_module { /** List of module members */ - list_t members; /* of stree_modm_t */ + list_head_t members; /* of stree_modm_t */ } stree_module_t; /** Symbol attribute class */ @@ -818,7 +818,7 @@ typedef struct stree_symbol { stree_csi_t *outer_csi; /** Symbol attributes */ - list_t attr; /* of stree_symbol_attr_t */ + list_head_t attr; /* of stree_symbol_attr_t */ } stree_symbol_t; /** Program */ diff -rup HelenOS-0.4.3/uspace/app/sbi/src/strtab.c HelenOS-0.4.3.new/uspace/app/sbi/src/strtab.c --- HelenOS-0.4.3/uspace/app/sbi/src/strtab.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/strtab.c 2011-04-02 20:13:23.000000000 +0200 @@ -45,7 +45,7 @@ #include "strtab.h" -static list_t str_list; +static list_head_t str_list; /** Initialize string table. */ void strtab_init(void) diff -rup HelenOS-0.4.3/uspace/app/sbi/src/stype.c HelenOS-0.4.3.new/uspace/app/sbi/src/stype.c --- HelenOS-0.4.3/uspace/app/sbi/src/stype.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/stype.c 2011-04-02 20:13:23.000000000 +0200 @@ -2121,7 +2121,7 @@ stree_proc_arg_t *stype_proc_args_lookup stree_fun_t *fun; stree_prop_t *prop; - list_t *args; + list_head_t *args; list_node_t *arg_node; stree_proc_arg_t *varg; stree_proc_arg_t *arg; diff -rup HelenOS-0.4.3/uspace/app/sbi/src/stype_expr.c HelenOS-0.4.3.new/uspace/app/sbi/src/stype_expr.c --- HelenOS-0.4.3/uspace/app/sbi/src/stype_expr.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/stype_expr.c 2011-04-02 20:13:23.000000000 +0200 @@ -112,8 +112,8 @@ static void stype_access_tebase(stype_t static void stype_call(stype_t *stype, stree_call_t *call, tdata_item_t **rtitem); -static void stype_call_args(stype_t *stype, cspan_t *cspan, list_t *farg_tis, - tdata_item_t *fvarg_ti, list_t *args); +static void stype_call_args(stype_t *stype, cspan_t *cspan, list_head_t *farg_tis, + tdata_item_t *fvarg_ti, list_head_t *args); static void stype_index(stype_t *stype, stree_index_t *index, tdata_item_t **rtitem); @@ -1420,8 +1420,8 @@ static void stype_call(stype_t *stype, s * @param farg_tis Formal argument types (list of tdata_item_t) * @param args Real arguments (list of stree_expr_t) */ -static void stype_call_args(stype_t *stype, cspan_t *cspan, list_t *farg_tis, - tdata_item_t *fvarg_ti, list_t *args) +static void stype_call_args(stype_t *stype, cspan_t *cspan, list_head_t *farg_tis, + tdata_item_t *fvarg_ti, list_head_t *args) { list_node_t *fargt_n; tdata_item_t *farg_ti; diff -rup HelenOS-0.4.3/uspace/app/sbi/src/stype_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/stype_t.h --- HelenOS-0.4.3/uspace/app/sbi/src/stype_t.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/stype_t.h 2011-04-02 20:13:24.000000000 +0200 @@ -52,7 +52,7 @@ typedef struct run_proc_vr { struct stree_proc *proc; /** Block activation records */ - list_t block_vr; /* of run_block_ar_t */ + list_head_t block_vr; /* of run_block_ar_t */ /** Number of active breakable statements (for break checking). */ int bstat_cnt; diff -rup HelenOS-0.4.3/uspace/app/sbi/src/tdata_t.h HelenOS-0.4.3.new/uspace/app/sbi/src/tdata_t.h --- HelenOS-0.4.3/uspace/app/sbi/src/tdata_t.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/sbi/src/tdata_t.h 2011-04-02 20:13:24.000000000 +0200 @@ -64,7 +64,7 @@ typedef struct { struct stree_csi *csi; /** (Real) type arguments */ - list_t targs; /* of tdata_item_t */ + list_head_t targs; /* of tdata_item_t */ } tdata_object_t; /** Array type. */ @@ -76,7 +76,7 @@ typedef struct { int rank; /** Extents */ - list_t extents; /* of stree_expr_t */ + list_head_t extents; /* of stree_expr_t */ } tdata_array_t; /** Function signature type. @@ -85,7 +85,7 @@ typedef struct { */ typedef struct { /** Types of fixed arguments. */ - list_t arg_ti; /* of tdata_item_t */ + list_head_t arg_ti; /* of tdata_item_t */ /** Type of variadic argument */ struct tdata_item *varg_ti; diff -rup HelenOS-0.4.3/uspace/app/tester/mm/malloc1.c HelenOS-0.4.3.new/uspace/app/tester/mm/malloc1.c --- HelenOS-0.4.3/uspace/app/tester/mm/malloc1.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/app/tester/mm/malloc1.c 2011-04-02 20:16:22.000000000 +0200 @@ -2,6 +2,7 @@ * Copyright (c) 2009 Martin Decky * Copyright (c) 2009 Tomas Bures * Copyright (c) 2009 Lubomir Bulej + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -342,7 +343,7 @@ static int test_overlap(void *addr, size link_t *entry; bool fnd = false; - for (entry = mem_blocks.next; entry != &mem_blocks; entry = entry->next) { + for (entry = mem_blocks.head.next; entry != &mem_blocks.head; entry = entry->next) { if (overlap_match(entry, addr, size)) { fnd = true; break; @@ -505,12 +506,12 @@ static void check_block(mem_block_t blk) } -static link_t *list_get_nth(link_t *list, unsigned int i) +static link_t *list_get_nth(list_t *list, unsigned int i) { unsigned int cnt = 0; link_t *entry; - for (entry = list->next; entry != list; entry = entry->next) { + for (entry = list->head.next; entry != &list->head; entry = entry->next) { if (cnt == i) return entry; diff -rup HelenOS-0.4.3/uspace/lib/block/libblock.c HelenOS-0.4.3.new/uspace/lib/block/libblock.c --- HelenOS-0.4.3/uspace/lib/block/libblock.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/block/libblock.c 2011-04-02 20:02:36.000000000 +0200 @@ -1,6 +1,7 @@ /* * Copyright (c) 2008 Jakub Jermar * Copyright (c) 2008 Martin Decky + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,7 +69,7 @@ typedef struct { unsigned block_count; /**< Total number of blocks. */ unsigned blocks_cached; /**< Number of cached blocks. */ hash_table_t block_hash; - link_t free_head; + list_t free_head; enum cache_mode mode; } cache_t; @@ -96,7 +97,7 @@ static devcon_t *devcon_search(devmap_ha link_t *cur; fibril_mutex_lock(&dcl_lock); - for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) { + for (cur = dcl_head.head.next; cur != &dcl_head.head; cur = cur->next) { devcon_t *devcon = list_get_instance(cur, devcon_t, link); if (devcon->devmap_handle == devmap_handle) { fibril_mutex_unlock(&dcl_lock); @@ -132,7 +133,7 @@ static int devcon_add(devmap_handle_t de devcon->cache = NULL; fibril_mutex_lock(&dcl_lock); - for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) { + for (cur = dcl_head.head.next; cur != &dcl_head.head; cur = cur->next) { devcon_t *d = list_get_instance(cur, devcon_t, link); if (d->devmap_handle == devmap_handle) { fibril_mutex_unlock(&dcl_lock); @@ -328,7 +329,7 @@ int block_cache_fini(devmap_handle_t dev * bother with the cache and block locks because we are single-threaded. */ while (!list_empty(&cache->free_head)) { - block_t *b = list_get_instance(cache->free_head.next, + block_t *b = list_get_instance(cache->free_head.head.next, block_t, free_link); list_remove(&b->free_link); @@ -453,7 +454,7 @@ recycle: rc = ENOMEM; goto out; } - l = cache->free_head.next; + l = cache->free_head.head.next; b = list_get_instance(l, block_t, free_link); fibril_mutex_lock(&b->lock); diff -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 --- HelenOS-0.4.3/uspace/lib/c/generic/adt/hash_table.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/adt/hash_table.c 2011-04-02 19:52:56.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,11 +61,11 @@ int hash_table_create(hash_table_t *h, h assert(op && op->hash && op->compare); assert(max_keys > 0); - h->entry = malloc(m * sizeof(link_t)); + h->entry = malloc(m * sizeof(list_t)); if (!h->entry) return false; - memset((void *) h->entry, 0, m * sizeof(link_t)); + memset((void *) h->entry, 0, m * sizeof(list_t)); hash_count_t i; for (i = 0; i < m; i++) @@ -123,7 +124,7 @@ link_t *hash_table_find(hash_table_t *h, assert(chain < h->entries); link_t *cur; - for (cur = h->entry[chain].next; cur != &h->entry[chain]; + for (cur = h->entry[chain].head.next; cur != &h->entry[chain].head; cur = cur->next) { if (h->op->compare(key, h->max_keys, cur)) { /* @@ -175,7 +176,8 @@ void hash_table_remove(hash_table_t *h, */ hash_index_t chain; for (chain = 0; chain < h->entries; chain++) { - for (cur = h->entry[chain].next; cur != &h->entry[chain]; + for (cur = h->entry[chain].head.next; cur != + &h->entry[chain].head; cur = cur->next) { if (h->op->compare(key, keys, cur)) { link_t *hlp; @@ -205,7 +207,8 @@ void hash_table_apply(hash_table_t *h, v link_t *cur; for (bucket = 0; bucket < h->entries; bucket++) { - for (cur = h->entry[bucket].next; cur != &h->entry[bucket]; + for (cur = h->entry[bucket].head.next; cur != + &h->entry[bucket].head; cur = cur->next) { f(cur, arg); } diff -rup HelenOS-0.4.3/uspace/lib/c/generic/adt/list.c HelenOS-0.4.3.new/uspace/lib/c/generic/adt/list.c --- HelenOS-0.4.3/uspace/lib/c/generic/adt/list.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/adt/list.c 2011-04-02 19:48:56.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2004 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,12 +47,12 @@ * @return true if link is contained in head, false otherwise. * */ -int list_member(const link_t *link, const link_t *head) +int list_member(const link_t *link, const list_t *list) { int found = 0; - link_t *hlp = head->next; + link_t *hlp = list->head.next; - while (hlp != head) { + while (hlp != &list->head) { if (hlp == link) { found = 1; break; @@ -69,20 +70,20 @@ int list_member(const link_t *link, cons * list head1 containing items from both (in head1, head2 * order) and empty list head2. * - * @param head1 First list and concatenated output - * @param head2 Second list and empty output. + * @param list1 First list and concatenated output + * @param list2 Second list and empty output. * */ -void list_concat(link_t *head1, link_t *head2) +void list_concat(list_t *list1, list_t *list2) { - if (list_empty(head2)) + if (list_empty(list2)) return; - head2->next->prev = head1->prev; - head2->prev->next = head1; - head1->prev->next = head2->next; - head1->prev = head2->prev; - list_initialize(head2); + list2->head.next->prev = list1->head.prev; + list2->head.prev->next = &list1->head; + list1->head.prev->next = list1->head.next; + list1->head.prev = list2->head.prev; + list_initialize(list2); } @@ -95,12 +96,12 @@ void list_concat(link_t *head1, link_t * * @return Number of items in the list. * */ -unsigned int list_count(const link_t *link) +unsigned int list_count(const list_t *list) { unsigned int count = 0; - link_t *hlp = link->next; + link_t *hlp = list->head.next; - while (hlp != link) { + while (hlp != &list->head) { count++; hlp = hlp->next; } diff -rup HelenOS-0.4.3/uspace/lib/c/generic/async.c HelenOS-0.4.3.new/uspace/lib/c/generic/async.c --- HelenOS-0.4.3/uspace/lib/c/generic/async.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/async.c 2011-04-02 19:40:03.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2006 Ondrej Palkovsky + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -152,7 +153,7 @@ typedef struct { client_t *client; /** Messages that should be delivered to this fibril. */ - link_t msg_queue; + list_t msg_queue; /** Identification of the opening call. */ ipc_callid_t callid; @@ -314,8 +315,8 @@ void async_insert_timeout(awaiter_t *wd) wd->to_event.occurred = false; wd->to_event.inlist = true; - link_t *tmp = timeout_list.next; - while (tmp != &timeout_list) { + link_t *tmp = timeout_list.head.next; + while (tmp != &timeout_list.head) { awaiter_t *cur = list_get_instance(tmp, awaiter_t, to_event.link); @@ -325,7 +326,7 @@ void async_insert_timeout(awaiter_t *wd) tmp = tmp->next; } - list_append(&wd->to_event.link, tmp); + list_append(&wd->to_event.link, &timeout_list); } /** Try to route a call to an appropriate connection fibril. @@ -515,7 +516,7 @@ ipc_callid_t async_get_call_timeout(ipc_ } } - msg_t *msg = list_get_instance(conn->msg_queue.next, msg_t, link); + msg_t *msg = list_get_instance(conn->msg_queue.head.next, msg_t, link); list_remove(&msg->link); ipc_callid_t callid = msg->callid; @@ -622,7 +623,7 @@ static int connection_fibril(void *arg) */ while (!list_empty(&FIBRIL_connection->msg_queue)) { msg_t *msg = - list_get_instance(FIBRIL_connection->msg_queue.next, msg_t, + list_get_instance(FIBRIL_connection->msg_queue.head.next, msg_t, link); list_remove(&msg->link); @@ -749,8 +750,8 @@ static void handle_expired_timeouts(void futex_down(&async_futex); - link_t *cur = timeout_list.next; - while (cur != &timeout_list) { + link_t *cur = timeout_list.head.next; + while (cur != &timeout_list.head) { awaiter_t *waiter = list_get_instance(cur, awaiter_t, to_event.link); @@ -797,7 +798,8 @@ static int async_manager_worker(void) suseconds_t timeout; if (!list_empty(&timeout_list)) { - awaiter_t *waiter = list_get_instance(timeout_list.next, + awaiter_t *waiter = + list_get_instance(timeout_list.head.next, awaiter_t, to_event.link); struct timeval tv; diff -rup HelenOS-0.4.3/uspace/lib/c/generic/async_sess.c HelenOS-0.4.3.new/uspace/lib/c/generic/async_sess.c --- HelenOS-0.4.3/uspace/lib/c/generic/async_sess.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/async_sess.c 2011-04-02 19:44:03.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2010 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,7 +195,7 @@ void async_session_destroy(async_sess_t /* Tear down all data connections. */ while (!list_empty(&sess->conn_head)) { - conn = list_get_instance(sess->conn_head.next, conn_node_t, + conn = list_get_instance(sess->conn_head.head.next, conn_node_t, sess_link); list_remove(&conn->sess_link); @@ -231,7 +232,7 @@ int async_exchange_begin(async_sess_t *s /* * There are inactive connections in the session. */ - conn = list_get_instance(sess->conn_head.next, conn_node_t, + conn = list_get_instance(sess->conn_head.head.next, conn_node_t, sess_link); list_remove(&conn->sess_link); list_remove(&conn->global_link); @@ -254,7 +255,7 @@ retry: * try to close some of the currently inactive * connections in other sessions and try again. */ - conn = list_get_instance(inactive_conn_head.next, + conn = list_get_instance(inactive_conn_head.head.next, conn_node_t, global_link); list_remove(&conn->global_link); list_remove(&conn->sess_link); diff -rup HelenOS-0.4.3/uspace/lib/c/generic/devman.c HelenOS-0.4.3.new/uspace/lib/c/generic/devman.c --- HelenOS-0.4.3/uspace/lib/c/generic/devman.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/devman.c 2011-04-02 18:54:33.000000000 +0200 @@ -138,11 +138,11 @@ static int devman_send_match_id(int phon static int devman_send_match_ids(int phone, match_id_list_t *match_ids) { - link_t *link = match_ids->ids.next; + link_t *link = match_ids->ids.head.next; match_id_t *match_id = NULL; int ret = EOK; - while (link != &match_ids->ids) { + while (link != &match_ids->ids.head) { match_id = list_get_instance(link, match_id_t, link); ret = devman_send_match_id(phone, match_id); if (ret != EOK) { diff -rup HelenOS-0.4.3/uspace/lib/c/generic/fibril.c HelenOS-0.4.3.new/uspace/lib/c/generic/fibril.c --- HelenOS-0.4.3/uspace/lib/c/generic/fibril.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/fibril.c 2011-04-02 19:16:14.000000000 +0200 @@ -1,6 +1,7 @@ /* * Copyright (c) 2006 Ondrej Palkovsky * Copyright (c) 2007 Jakub Jermar + * Copyright (c) 2010 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -221,7 +222,7 @@ int fibril_switch(fibril_switch_type_t s /* Choose a new fibril to run */ fibril_t *dstf; if ((stype == FIBRIL_TO_MANAGER) || (stype == FIBRIL_FROM_DEAD)) { - dstf = list_get_instance(manager_list.next, fibril_t, link); + dstf = list_get_instance(manager_list.head.next, fibril_t, link); if (serialization_count && stype == FIBRIL_TO_MANAGER) { serialized_threads++; srcf->flags |= FIBRIL_SERIALIZED; @@ -232,11 +233,11 @@ int fibril_switch(fibril_switch_type_t s dstf->clean_after_me = srcf; } else { if (!list_empty(&serialized_list)) { - dstf = list_get_instance(serialized_list.next, fibril_t, + dstf = list_get_instance(serialized_list.head.next, fibril_t, link); serialized_threads--; } else { - dstf = list_get_instance(ready_list.next, fibril_t, + dstf = list_get_instance(ready_list.head.next, fibril_t, link); } } @@ -325,7 +326,7 @@ void fibril_remove_manager(void) futex_down(&fibril_futex); if (!list_empty(&manager_list)) - list_remove(manager_list.next); + list_remove(manager_list.head.next); futex_up(&fibril_futex); } diff -rup HelenOS-0.4.3/uspace/lib/c/generic/fibril_synch.c HelenOS-0.4.3.new/uspace/lib/c/generic/fibril_synch.c --- HelenOS-0.4.3/uspace/lib/c/generic/fibril_synch.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/fibril_synch.c 2011-04-02 19:26:36.000000000 +0200 @@ -147,7 +147,7 @@ static void _fibril_mutex_unlock_unsafe( fibril_t *f; assert(!list_empty(&fm->waiters)); - tmp = fm->waiters.next; + tmp = fm->waiters.head.next; wdp = list_get_instance(tmp, awaiter_t, wu_event.link); wdp->active = true; wdp->wu_event.inlist = false; @@ -277,7 +277,7 @@ static void _fibril_rwlock_common_unlock frw->oi.owned_by = NULL; while (!list_empty(&frw->waiters)) { - link_t *tmp = frw->waiters.next; + link_t *tmp = frw->waiters.head.next; awaiter_t *wdp; fibril_t *f; @@ -420,7 +420,7 @@ static void _fibril_condvar_wakeup_commo futex_down(&async_futex); while (!list_empty(&fcv->waiters)) { - tmp = fcv->waiters.next; + tmp = fcv->waiters.head.next; wdp = list_get_instance(tmp, awaiter_t, wu_event.link); list_remove(&wdp->wu_event.link); wdp->wu_event.inlist = false; diff -rup HelenOS-0.4.3/uspace/lib/c/generic/io/io.c HelenOS-0.4.3.new/uspace/lib/c/generic/io/io.c --- HelenOS-0.4.3/uspace/lib/c/generic/io/io.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/io/io.c 2011-04-02 19:27:47.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2005 Martin Decky + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -124,12 +125,12 @@ void __stdio_init(int filc, fdi_node_t * void __stdio_done(void) { - link_t *link = files.next; + link_t *link = files.head.next; - while (link != &files) { + while (link != &files.head) { FILE *file = list_get_instance(link, FILE, link); fclose(file); - link = files.next; + link = files.head.next; } } diff -rup HelenOS-0.4.3/uspace/lib/c/generic/ipc.c HelenOS-0.4.3.new/uspace/lib/c/generic/ipc.c --- HelenOS-0.4.3/uspace/lib/c/generic/ipc.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/generic/ipc.c 2011-04-02 19:29:28.000000000 +0200 @@ -457,7 +457,7 @@ static void dispatch_queued_calls(void) while (!list_empty(&queued_calls)) { async_call_t *call = - list_get_instance(queued_calls.next, async_call_t, list); + list_get_instance(queued_calls.head.next, async_call_t, list); ipc_callid_t callid = ipc_call_async_internal(call->u.msg.phoneid, &call->u.msg.data); @@ -510,7 +510,7 @@ static void handle_answer(ipc_callid_t c futex_down(&ipc_futex); link_t *item; - for (item = dispatched_calls.next; item != &dispatched_calls; + for (item = dispatched_calls.head.next; item != &dispatched_calls.head; item = item->next) { async_call_t *call = list_get_instance(item, async_call_t, list); diff -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 --- HelenOS-0.4.3/uspace/lib/c/include/adt/hash_table.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/include/adt/hash_table.h 2011-04-02 19:51:33.000000000 +0200 @@ -73,7 +73,7 @@ typedef struct { /** Hash table structure. */ typedef struct { - link_t *entry; + list_t *entry; hash_count_t entries; hash_count_t max_keys; hash_table_operations_t *op; diff -rup HelenOS-0.4.3/uspace/lib/c/include/adt/list.h HelenOS-0.4.3.new/uspace/lib/c/include/adt/list.h --- HelenOS-0.4.3/uspace/lib/c/include/adt/list.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/include/adt/list.h 2011-04-02 19:14:57.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2001-2004 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,19 +38,23 @@ #include -/** Doubly linked list head and link type. */ +/** Doubly linked list link type. */ typedef struct link { struct link *prev; /**< Pointer to the previous item in the list. */ struct link *next; /**< Pointer to the next item in the list. */ } link_t; +/** Doubly linked list head type. */ +typedef struct { + struct link head; +} list_t; + /** Declare and initialize statically allocated list. * * @param name Name of the new statically allocated list. */ -#define LIST_INITIALIZE(name) link_t name = { \ - .prev = &name, \ - .next = &name \ +#define LIST_INITIALIZE(name) list_t name = { \ + .head = { .prev = &name.head, .next = &name.head } \ } /** Initialize doubly-linked circular list link @@ -70,10 +75,10 @@ static inline void link_initialize(link_ * * @param head Pointer to link_t structure representing head of the list. */ -static inline void list_initialize(link_t *head) +static inline void list_initialize(list_t *list) { - head->prev = head; - head->next = head; + list->head.prev = &list->head; + list->head.next = &list->head; } /** Add item to the beginning of doubly-linked circular list @@ -81,14 +86,14 @@ static inline void list_initialize(link_ * Add item to the beginning of doubly-linked circular list. * * @param link Pointer to link_t structure to be added. - * @param head Pointer to link_t structure representing head of the list. + * @param list Pointer to list_t structure representing head of the list. */ -static inline void list_prepend(link_t *link, link_t *head) +static inline void list_prepend(link_t *link, list_t *list) { - link->next = head->next; - link->prev = head; - head->next->prev = link; - head->next = link; + link->next = list->head.next; + link->prev = &list->head; + list->head.next->prev = link; + list->head.next = link; } /** Add item to the end of doubly-linked circular list @@ -96,26 +101,32 @@ static inline void list_prepend(link_t * * Add item to the end of doubly-linked circular list. * * @param link Pointer to link_t structure to be added. - * @param head Pointer to link_t structure representing head of the list. + * @param list Pointer to list_t structure representing head of the list. */ -static inline void list_append(link_t *link, link_t *head) +static inline void list_append(link_t *link, list_t *list) { - link->prev = head->prev; - link->next = head; - head->prev->next = link; - head->prev = link; + link->prev = list->head.prev; + link->next = &list->head; + list->head.prev->next = link; + list->head.prev = link; } /** Insert item before another item in doubly-linked circular list. */ static inline void list_insert_before(link_t *l, link_t *r) { - list_append(l, r); -} + r->prev->next = l; + l->prev = r->prev; + r->prev = l; + l->next = r; +} /** Insert item after another item in doubly-linked circular list. */ static inline void list_insert_after(link_t *r, link_t *l) { - list_prepend(l, r); + l->next->prev = r; + r->next = l->next; + l->next = r; + r->prev = l; } /** Remove item from doubly-linked circular list @@ -137,9 +148,9 @@ static inline void list_remove(link_t *l * * @param head Pointer to link_t structure representing head of the list. */ -static inline int list_empty(link_t *head) +static inline int list_empty(list_t *list) { - return ((head->next == head) ? 1 : 0); + return ((list->head.next == &list->head) ? 1 : 0); } @@ -191,9 +202,9 @@ static inline void headless_list_concat( #define list_get_instance(link, type, member) ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member)))) -extern int list_member(const link_t *link, const link_t *head); -extern void list_concat(link_t *head1, link_t *head2); -extern unsigned int list_count(const link_t *link); +extern int list_member(const link_t *link, const list_t *head); +extern void list_concat(list_t *head1, list_t *head2); +extern unsigned int list_count(const list_t *link); #endif diff -rup HelenOS-0.4.3/uspace/lib/c/include/async_sess.h HelenOS-0.4.3.new/uspace/lib/c/include/async_sess.h --- HelenOS-0.4.3/uspace/lib/c/include/async_sess.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/include/async_sess.h 2011-04-02 19:43:03.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2010 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,7 +41,7 @@ typedef struct { int sess_phone; /**< Phone for cloning off the connections. */ sysarg_t connect_arg1; /**< Argument for CONNECT_ME_TO. */ - link_t conn_head; /**< List of open data connections. */ + list_t conn_head; /**< List of open data connections. */ link_t sess_link; /**< Link in global list of open sessions. */ } async_sess_t; diff -rup HelenOS-0.4.3/uspace/lib/c/include/fibril_synch.h HelenOS-0.4.3.new/uspace/lib/c/include/fibril_synch.h --- HelenOS-0.4.3/uspace/lib/c/include/fibril_synch.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/include/fibril_synch.h 2011-04-02 19:26:04.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,7 +45,7 @@ typedef struct { fibril_owner_info_t oi; /* Keep this the first thing. */ int counter; - link_t waiters; + list_t waiters; } fibril_mutex_t; #define FIBRIL_MUTEX_INITIALIZER(name) \ @@ -54,8 +55,10 @@ typedef struct { }, \ .counter = 1, \ .waiters = { \ - .prev = &name.waiters, \ - .next = &name.waiters, \ + .head = { \ + .prev = &name.waiters.head, \ + .next = &name.waiters.head, \ + }, \ } \ } @@ -66,7 +69,7 @@ typedef struct { fibril_owner_info_t oi; /* Keep this the first thing. */ unsigned writers; unsigned readers; - link_t waiters; + list_t waiters; } fibril_rwlock_t; #define FIBRIL_RWLOCK_INITIALIZER(name) \ @@ -77,8 +80,10 @@ typedef struct { .readers = 0, \ .writers = 0, \ .waiters = { \ - .prev = &name.waiters, \ - .next = &name.waiters, \ + .head = { \ + .prev = &name.waiters.head, \ + .next = &name.waiters.head, \ + } \ } \ } @@ -86,14 +91,16 @@ typedef struct { fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name) typedef struct { - link_t waiters; + list_t waiters; } fibril_condvar_t; #define FIBRIL_CONDVAR_INITIALIZER(name) \ { \ .waiters = { \ - .next = &name.waiters, \ - .prev = &name.waiters, \ + .head = { \ + .next = &name.waiters.head, \ + .prev = &name.waiters.head, \ + } \ } \ } diff -rup HelenOS-0.4.3/uspace/lib/c/include/ipc/devman.h HelenOS-0.4.3.new/uspace/lib/c/include/ipc/devman.h --- HelenOS-0.4.3/uspace/lib/c/include/ipc/devman.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/c/include/ipc/devman.h 2011-04-02 18:59:10.000000000 +0200 @@ -1,5 +1,7 @@ /* * Copyright (c) 2010 Lenka Trochtova + * Copyright (c) 2011 Mateusz Kocielski + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +58,7 @@ typedef enum { typedef struct match_id { /** Pointers to next and previous ids. */ - link_t link; + link_t link; /** Id of device model. */ const char *id; @@ -71,7 +73,7 @@ typedef struct match_id { * according to match scores in descending order. */ typedef struct match_id_list { - link_t ids; + list_t ids; } match_id_list_t; static inline match_id_t *create_match_id(void) @@ -94,9 +96,9 @@ static inline void delete_match_id(match static inline void add_match_id(match_id_list_t *ids, match_id_t *id) { match_id_t *mid = NULL; - link_t *link = ids->ids.next; + link_t *link = ids->ids.head.next; - while (link != &ids->ids) { + while (link != &ids->ids.head) { mid = list_get_instance(link, match_id_t,link); if (mid->score < id->score) { break; @@ -118,7 +120,7 @@ static inline void clean_match_ids(match match_id_t *id; while(!list_empty(&ids->ids)) { - link = ids->ids.next; + link = ids->ids.head.next; list_remove(link); id = list_get_instance(link, match_id_t, link); delete_match_id(id); diff -rup HelenOS-0.4.3/uspace/lib/drv/generic/driver.c HelenOS-0.4.3.new/uspace/lib/drv/generic/driver.c --- HelenOS-0.4.3/uspace/lib/drv/generic/driver.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/drv/generic/driver.c 2011-04-02 20:02:16.000000000 +0200 @@ -1,6 +1,7 @@ /* * Copyright (c) 2010 Lenka Trochtova * Copyright (c) 2011 Jiri Svoboda + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -139,10 +140,10 @@ find_interrupt_context_by_id(interrupt_c { fibril_mutex_lock(&list->mutex); - link_t *link = list->contexts.next; + link_t *link = list->contexts.head.next; interrupt_context_t *ctx; - while (link != &list->contexts) { + while (link != &list->contexts.head) { ctx = list_get_instance(link, interrupt_context_t, link); if (ctx->id == id) { fibril_mutex_unlock(&list->mutex); @@ -160,10 +161,10 @@ find_interrupt_context(interrupt_context { fibril_mutex_lock(&list->mutex); - link_t *link = list->contexts.next; + link_t *link = list->contexts.head.next; interrupt_context_t *ctx; - while (link != &list->contexts) { + while (link != &list->contexts.head) { ctx = list_get_instance(link, interrupt_context_t, link); if (ctx->irq == irq && ctx->dev == dev) { fibril_mutex_unlock(&list->mutex); @@ -229,14 +230,14 @@ static void remove_from_functions_list(d fibril_mutex_unlock(&functions_mutex); } -static ddf_fun_t *driver_get_function(link_t *functions, devman_handle_t handle) +static ddf_fun_t *driver_get_function(list_t *functions, devman_handle_t handle) { ddf_fun_t *fun = NULL; fibril_mutex_lock(&functions_mutex); - link_t *link = functions->next; + link_t *link = functions->head.next; - while (link != functions) { + while (link != &functions->head) { fun = list_get_instance(link, ddf_fun_t, link); if (fun->handle == handle) { fibril_mutex_unlock(&functions_mutex); diff -rup HelenOS-0.4.3/uspace/lib/drv/include/ddf/interrupt.h HelenOS-0.4.3.new/uspace/lib/drv/include/ddf/interrupt.h --- HelenOS-0.4.3/uspace/lib/drv/include/ddf/interrupt.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/lib/drv/include/ddf/interrupt.h 2011-04-02 20:00:01.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2010 Lenka Trochtova + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,7 +60,7 @@ typedef struct interrupt_context { typedef struct interrupt_context_list { int curr_id; - link_t contexts; + list_t contexts; fibril_mutex_t mutex; } interrupt_context_list_t; diff -rup HelenOS-0.4.3/uspace/srv/devman/devman.c HelenOS-0.4.3.new/uspace/srv/devman/devman.c --- HelenOS-0.4.3/uspace/srv/devman/devman.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/devman/devman.c 2011-04-02 20:36:22.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2010 Lenka Trochtova + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -459,8 +460,8 @@ driver_t *find_best_match_driver(driver_ fibril_mutex_lock(&drivers_list->drivers_mutex); - link_t *link = drivers_list->drivers.next; - while (link != &drivers_list->drivers) { + link_t *link = drivers_list->drivers.head.next; + while (link != &drivers_list->drivers.head) { drv = list_get_instance(link, driver_t, drivers); score = get_match_score(drv, node); if (score > best_score) { @@ -533,8 +534,8 @@ driver_t *find_driver(driver_list_t *drv fibril_mutex_lock(&drv_list->drivers_mutex); - link = drv_list->drivers.next; - while (link != &drv_list->drivers) { + link = drv_list->drivers.head.next; + while (link != &drv_list->drivers.head) { drv = list_get_instance(link, driver_t, drivers); if (str_cmp(drv->name, drv_name) == 0) { res = drv; @@ -587,8 +588,8 @@ static void pass_devices_to_driver(drive * Go through devices list as long as there is some device * that has not been passed to the driver. */ - link = driver->devices.next; - while (link != &driver->devices) { + link = driver->devices.head.next; + while (link != &driver->devices.head) { dev = list_get_instance(link, dev_node_t, driver_devices); if (dev->passed_to_driver) { link = link->next; @@ -625,7 +626,7 @@ static void pass_devices_to_driver(drive /* * Restart the cycle to go through all devices again. */ - link = driver->devices.next; + link = driver->devices.head.next; } async_hangup(phone); @@ -881,7 +882,7 @@ dev_node_t *create_dev_node(void) memset(res, 0, sizeof(dev_node_t)); list_initialize(&res->functions); link_initialize(&res->driver_devices); - link_initialize(&res->devman_dev); + link_initialize(&res->devman_dev.head); } return res; @@ -949,8 +950,8 @@ fun_node_t *create_fun_node(void) link_initialize(&res->dev_functions); list_initialize(&res->match_ids.ids); list_initialize(&res->classes); - link_initialize(&res->devman_fun); - link_initialize(&res->devmap_fun); + link_initialize(&res->devman_fun.head); + link_initialize(&res->devmap_fun.head); } return res; @@ -1059,7 +1060,7 @@ bool insert_dev_node(dev_tree_t *tree, d /* Add the node to the handle-to-node map. */ dev->handle = ++tree->current_handle; unsigned long key = dev->handle; - hash_table_insert(&tree->devman_devices, &key, &dev->devman_dev); + hash_table_insert(&tree->devman_devices, &key, &dev->devman_dev.head); /* Add the node to the list of its parent's children. */ printf("insert_dev_node: dev=%p, dev->pfun := %p\n", dev, pfun); @@ -1103,7 +1104,7 @@ bool insert_fun_node(dev_tree_t *tree, f /* Add the node to the handle-to-node map. */ fun->handle = ++tree->current_handle; unsigned long key = fun->handle; - hash_table_insert(&tree->devman_functions, &key, &fun->devman_fun); + hash_table_insert(&tree->devman_functions, &key, &fun->devman_fun.head); /* Add the node to the list of its parent's children. */ fun->dev = dev; @@ -1169,9 +1170,9 @@ fun_node_t *find_node_child(fun_node_t * fun_node_t *fun; link_t *link; - link = pfun->child->functions.next; + link = pfun->child->functions.head.next; - while (link != &pfun->child->functions) { + while (link != &pfun->child->functions.head) { fun = list_get_instance(link, fun_node_t, dev_functions); if (str_cmp(name, fun->name) == 0) @@ -1324,9 +1325,9 @@ dev_class_t *find_dev_class_no_lock(clas const char *class_name) { dev_class_t *cl; - link_t *link = class_list->classes.next; + link_t *link = class_list->classes.head.next; - while (link != &class_list->classes) { + while (link != &class_list->classes.head) { cl = list_get_instance(link, dev_class_t, link); if (str_cmp(cl->name, class_name) == 0) { return cl; @@ -1403,7 +1404,7 @@ void tree_add_devmap_function(dev_tree_t { unsigned long key = (unsigned long) fun->devmap_handle; fibril_rwlock_write_lock(&tree->rwlock); - hash_table_insert(&tree->devmap_functions, &key, &fun->devmap_fun); + hash_table_insert(&tree->devmap_functions, &key, &fun->devmap_fun.head); fibril_rwlock_write_unlock(&tree->rwlock); } diff -rup HelenOS-0.4.3/uspace/srv/devman/devman.h HelenOS-0.4.3.new/uspace/srv/devman/devman.h --- HelenOS-0.4.3/uspace/srv/devman/devman.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/devman/devman.h 2011-04-02 20:36:01.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2010 Lenka Trochtova + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -95,7 +96,7 @@ typedef struct driver { /** List of device ids for device-to-driver matching. */ match_id_list_t match_ids; /** Pointer to the linked list of devices controlled by this driver. */ - link_t devices; + list_t devices; /** * Fibril mutex for this driver - driver state, list of devices, phone. @@ -106,7 +107,7 @@ typedef struct driver { /** The list of drivers. */ typedef struct driver_list { /** List of drivers */ - link_t drivers; + list_t drivers; /** Fibril mutex for list of drivers. */ fibril_mutex_t drivers_mutex; } driver_list_t; @@ -128,7 +129,7 @@ struct dev_node { fun_node_t *pfun; /** List of device functions. */ - link_t functions; + list_t functions; /** Driver of this device. */ driver_t *drv; /** The state of the device. */ @@ -139,7 +140,7 @@ struct dev_node { /** * Used by the hash table of devices indexed by devman device handles. */ - link_t devman_dev; + list_t devman_dev; /** * Whether this device was already passed to the driver. @@ -169,19 +170,19 @@ struct fun_node { match_id_list_t match_ids; /** The list of device classes to which this device function belongs. */ - link_t classes; + list_t classes; /** Devmap handle if the device function is registered by devmap. */ devmap_handle_t devmap_handle; /** * Used by the hash table of functions indexed by devman device handles. */ - link_t devman_fun; + list_t devman_fun; /** * Used by the hash table of functions indexed by devmap device handles. */ - link_t devmap_fun; + list_t devmap_fun; }; @@ -226,7 +227,7 @@ typedef struct dev_class { * List of dev_class_info structures - one for each device registered by * this class. */ - link_t devices; + list_t devices; /** * Default base name for the device within the class, might be overrided @@ -278,7 +279,7 @@ typedef struct dev_class_info { /** The list of device classes. */ typedef struct class_list { /** List of classes. */ - link_t classes; + list_t classes; /** * Hash table of devices registered by devmapper using their class name, diff -rup HelenOS-0.4.3/uspace/srv/devman/match.c HelenOS-0.4.3.new/uspace/srv/devman/match.c --- HelenOS-0.4.3/uspace/srv/devman/match.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/devman/match.c 2011-04-02 20:38:55.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2010 Lenka Trochtova + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,8 +59,8 @@ static int compute_match_score(match_id_ int get_match_score(driver_t *drv, dev_node_t *dev) { - link_t *drv_head = &drv->match_ids.ids; - link_t *dev_head = &dev->pfun->match_ids.ids; + list_t *drv_head = &drv->match_ids.ids; + list_t *dev_head = &dev->pfun->match_ids.ids; if (list_empty(drv_head) || list_empty(dev_head)) return 0; @@ -69,10 +70,10 @@ int get_match_score(driver_t *drv, dev_n */ int highest_score = 0; - link_t *drv_link = drv->match_ids.ids.next; - while (drv_link != drv_head) { - link_t *dev_link = dev_head->next; - while (dev_link != dev_head) { + link_t *drv_link = drv->match_ids.ids.head.next; + while (drv_link != &drv_head->head) { + link_t *dev_link = dev_head->head.next; + while (dev_link != &dev_head->head) { match_id_t *drv_id = list_get_instance(drv_link, match_id_t, link); match_id_t *dev_id = list_get_instance(dev_link, match_id_t, link); diff -rup HelenOS-0.4.3/uspace/srv/devmap/devmap.c HelenOS-0.4.3.new/uspace/srv/devmap/devmap.c --- HelenOS-0.4.3/uspace/srv/devmap/devmap.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/devmap/devmap.c 2011-04-02 20:20:15.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2007 Josef Cejka + * Copyright (c) 2011 Matuesz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,7 +60,7 @@ typedef struct { /** Pointers to previous and next drivers in linked list */ link_t drivers; /** Pointer to the linked list of devices controlled by this driver */ - link_t devices; + list_t devices; /** Phone asociated with this driver */ sysarg_t phone; /** Device driver name */ @@ -221,7 +222,7 @@ static devmap_namespace_t *devmap_namesp assert(fibril_mutex_is_locked(&devices_list_mutex)); - for (item = namespaces_list.next; item != &namespaces_list; item = item->next) { + for (item = namespaces_list.head.next; item != &namespaces_list.head; item = item->next) { devmap_namespace_t *namespace = list_get_instance(item, devmap_namespace_t, namespaces); if (str_cmp(namespace->name, name) == 0) @@ -242,7 +243,7 @@ static devmap_namespace_t *devmap_namesp assert(fibril_mutex_is_locked(&devices_list_mutex)); - for (item = namespaces_list.next; item != &namespaces_list; item = item->next) { + for (item = namespaces_list.head.next; item != &namespaces_list.head; item = item->next) { devmap_namespace_t *namespace = list_get_instance(item, devmap_namespace_t, namespaces); if (namespace->handle == handle) @@ -260,7 +261,7 @@ static devmap_device_t *devmap_device_fi assert(fibril_mutex_is_locked(&devices_list_mutex)); - for (item = devices_list.next; item != &devices_list; item = item->next) { + for (item = devices_list.head.next; item != &devices_list.head; item = item->next) { devmap_device_t *device = list_get_instance(item, devmap_device_t, devices); if ((str_cmp(device->namespace->name, ns_name) == 0) @@ -282,7 +283,7 @@ static devmap_device_t *devmap_device_fi assert(fibril_mutex_is_locked(&devices_list_mutex)); - for (item = devices_list.next; item != &devices_list; item = item->next) { + for (item = devices_list.head.next; item != &devices_list.head; item = item->next) { devmap_device_t *device = list_get_instance(item, devmap_device_t, devices); if (device->handle == handle) @@ -472,7 +473,8 @@ static int devmap_driver_unregister(devm fibril_mutex_lock(&driver->devices_mutex); while (!list_empty(&(driver->devices))) { - devmap_device_t *device = list_get_instance(driver->devices.next, + devmap_device_t *device = + list_get_instance(driver->devices.head.next, devmap_device_t, driver_devices); devmap_device_unregister_core(device); } @@ -815,7 +817,7 @@ static void devmap_get_namespaces(ipc_ca link_t *item; size_t pos = 0; - for (item = namespaces_list.next; item != &namespaces_list; + for (item = namespaces_list.head.next; item != &namespaces_list.head; item = item->next) { devmap_namespace_t *namespace = list_get_instance(item, devmap_namespace_t, namespaces); @@ -881,7 +883,7 @@ static void devmap_get_devices(ipc_calli link_t *item; size_t pos = 0; - for (item = devices_list.next; item != &devices_list; item = item->next) { + for (item = devices_list.head.next; item != &devices_list.head; item = item->next) { devmap_device_t *device = list_get_instance(item, devmap_device_t, devices); diff -rup HelenOS-0.4.3/uspace/srv/fs/fat/fat_idx.c HelenOS-0.4.3.new/uspace/srv/fs/fat/fat_idx.c --- HelenOS-0.4.3/uspace/srv/fs/fat/fat_idx.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/fs/fat/fat_idx.c 2011-04-02 20:48:10.000000000 +0200 @@ -65,7 +65,7 @@ typedef struct { uint64_t remaining; /** Sorted list of intervals of freed indices. */ - link_t freed_head; + list_t freed_head; } unused_t; /** Mutex protecting the list of unused structures. */ @@ -90,7 +90,7 @@ static unused_t *unused_find(devmap_hand if (lock) fibril_mutex_lock(&unused_lock); - for (l = unused_head.next; l != &unused_head; l = l->next) { + for (l = unused_head.head.next; l != &unused_head.head; l = l->next) { u = list_get_instance(l, unused_t, link); if (u->devmap_handle == devmap_handle) return u; @@ -260,7 +260,7 @@ static bool fat_index_alloc(devmap_handl } } else { /* There are some freed indices which we can reuse. */ - freed_t *f = list_get_instance(u->freed_head.next, freed_t, + freed_t *f = list_get_instance(u->freed_head.head.next, freed_t, link); *index = f->first; if (f->first++ == f->last) { @@ -318,12 +318,12 @@ static void fat_index_free(devmap_handle */ link_t *lnk; freed_t *n; - for (lnk = u->freed_head.next; lnk != &u->freed_head; + for (lnk = u->freed_head.head.next; lnk != &u->freed_head.head; lnk = lnk->next) { freed_t *f = list_get_instance(lnk, freed_t, link); if (f->first == index + 1) { f->first--; - if (lnk->prev != &u->freed_head) + if (lnk->prev != &u->freed_head.head) try_coalesce_intervals(lnk->prev, lnk, lnk); fibril_mutex_unlock(&unused_lock); @@ -331,7 +331,7 @@ static void fat_index_free(devmap_handle } if (f->last == index - 1) { f->last++; - if (lnk->next != &u->freed_head) + if (lnk->next != &u->freed_head.head) try_coalesce_intervals(lnk, lnk->next, lnk); fibril_mutex_unlock(&unused_lock); @@ -594,7 +594,7 @@ void fat_idx_fini_by_devmap_handle(devma while (!list_empty(&u->freed_head)) { freed_t *f; - f = list_get_instance(u->freed_head.next, freed_t, link); + f = list_get_instance(u->freed_head.head.next, freed_t, link); list_remove(&f->link); free(f); } diff -rup HelenOS-0.4.3/uspace/srv/fs/fat/fat_ops.c HelenOS-0.4.3.new/uspace/srv/fs/fat/fat_ops.c --- HelenOS-0.4.3/uspace/srv/fs/fat/fat_ops.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/fs/fat/fat_ops.c 2011-04-02 20:46:25.000000000 +0200 @@ -157,7 +157,7 @@ static int fat_node_fini_by_devmap_handl restart: fibril_mutex_lock(&ffn_mutex); - for (lnk = ffn_head.next; lnk != &ffn_head; lnk = lnk->next) { + for (lnk = ffn_head.head.next; lnk != &ffn_head.head; lnk = lnk->next) { nodep = list_get_instance(lnk, fat_node_t, ffn_link); if (!fibril_mutex_trylock(&nodep->lock)) { fibril_mutex_unlock(&ffn_mutex); @@ -212,7 +212,7 @@ static int fat_node_get_new(fat_node_t * if (!list_empty(&ffn_head)) { /* Try to use a cached free node structure. */ fat_idx_t *idxp_tmp; - nodep = list_get_instance(ffn_head.next, fat_node_t, ffn_link); + nodep = list_get_instance(ffn_head.head.next, fat_node_t, ffn_link); if (!fibril_mutex_trylock(&nodep->lock)) goto skip_cache; idxp_tmp = nodep->idx; diff -rup HelenOS-0.4.3/uspace/srv/fs/tmpfs/tmpfs.h HelenOS-0.4.3.new/uspace/srv/fs/tmpfs/tmpfs.h --- HelenOS-0.4.3/uspace/srv/fs/tmpfs/tmpfs.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/fs/tmpfs/tmpfs.h 2011-04-02 20:51:53.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,7 +67,7 @@ typedef struct tmpfs_node { unsigned lnkcnt; /**< Link count. */ size_t size; /**< File size if type is TMPFS_FILE. */ void *data; /**< File content's if type is TMPFS_FILE. */ - link_t cs_head; /**< Head of child's siblings list. */ + list_t cs_head; /**< Head of child's siblings list. */ } tmpfs_node_t; extern fs_reg_t tmpfs_reg; diff -rup HelenOS-0.4.3/uspace/srv/fs/tmpfs/tmpfs_ops.c HelenOS-0.4.3.new/uspace/srv/fs/tmpfs/tmpfs_ops.c --- HelenOS-0.4.3/uspace/srv/fs/tmpfs/tmpfs_ops.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/fs/tmpfs/tmpfs_ops.c 2011-04-02 20:53:57.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -180,7 +181,8 @@ static void nodes_remove_callback(link_t nh_link); while (!list_empty(&nodep->cs_head)) { - tmpfs_dentry_t *dentryp = list_get_instance(nodep->cs_head.next, + tmpfs_dentry_t *dentryp = + list_get_instance(nodep->cs_head.head.next, tmpfs_dentry_t, link); assert(nodep->type == TMPFS_DIRECTORY); @@ -263,7 +265,7 @@ int tmpfs_match(fs_node_t **rfn, fs_node tmpfs_node_t *parentp = TMPFS_NODE(pfn); link_t *lnk; - for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; + for (lnk = parentp->cs_head.head.next; lnk != &parentp->cs_head.head; lnk = lnk->next) { tmpfs_dentry_t *dentryp; dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); @@ -377,7 +379,7 @@ int tmpfs_link_node(fs_node_t *pfn, fs_n assert(parentp->type == TMPFS_DIRECTORY); /* Check for duplicit entries. */ - for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; + for (lnk = parentp->cs_head.head.next; lnk != &parentp->cs_head.head; lnk = lnk->next) { dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); if (!str_cmp(dentryp->name, nm)) @@ -415,7 +417,7 @@ int tmpfs_unlink_node(fs_node_t *pfn, fs if (!parentp) return EBUSY; - for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; + for (lnk = parentp->cs_head.head.next; lnk != &parentp->cs_head.head; lnk = lnk->next) { dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); if (!str_cmp(dentryp->name, nm)) { @@ -558,12 +560,12 @@ void tmpfs_read(ipc_callid_t rid, ipc_ca * If it bothers someone, it could be fixed by introducing a * hash table. */ - for (i = 0, lnk = nodep->cs_head.next; - (i < pos) && (lnk != &nodep->cs_head); + for (i = 0, lnk = nodep->cs_head.head.next; + (i < pos) && (lnk != &nodep->cs_head.head); i++, lnk = lnk->next) ; - if (lnk == &nodep->cs_head) { + if (lnk == &nodep->cs_head.head) { async_answer_0(callid, ENOENT); async_answer_1(rid, ENOENT, 0); return; diff -rup HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/dp8390.c HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/dp8390.c --- HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/dp8390.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/dp8390.c 2011-04-02 20:56:03.000000000 +0200 @@ -1,6 +1,7 @@ /* * Copyright (c) 2009 Lukas Mejdrech * Copyright (c) 2011 Martin Decky + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -480,14 +481,14 @@ static frame_t *ne2k_receive_frame(ne2k_ return frame; } -static link_t *ne2k_receive(ne2k_t *ne2k) +static list_t *ne2k_receive(ne2k_t *ne2k) { /* * Allocate memory for the list of received frames. * If the allocation fails here we still receive the * frames from the network, but they will be lost. */ - link_t *frames = (link_t *) malloc(sizeof(link_t)); + list_t *frames = (list_t *) malloc(sizeof(list_t)); if (frames != NULL) list_initialize(frames); @@ -564,10 +565,10 @@ static link_t *ne2k_receive(ne2k_t *ne2k return frames; } -link_t *ne2k_interrupt(ne2k_t *ne2k, uint8_t isr, uint8_t tsr) +list_t *ne2k_interrupt(ne2k_t *ne2k, uint8_t isr, uint8_t tsr) { /* List of received frames */ - link_t *frames = NULL; + list_t *frames = NULL; if (isr & (ISR_PTX | ISR_TXE)) { if (isr & ISR_TXE) diff -rup HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/dp8390.h HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/dp8390.h --- HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/dp8390.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/dp8390.h 2011-04-02 20:57:02.000000000 +0200 @@ -1,6 +1,7 @@ /* * Copyright (c) 2009 Lukas Mejdrech * Copyright (c) 2011 Martin Decky + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -240,7 +241,7 @@ extern int ne2k_probe(ne2k_t *, void *, extern int ne2k_up(ne2k_t *); extern void ne2k_down(ne2k_t *); extern void ne2k_send(ne2k_t *, packet_t *); -extern link_t *ne2k_interrupt(ne2k_t *, uint8_t, uint8_t); +extern list_t *ne2k_interrupt(ne2k_t *, uint8_t, uint8_t); #endif diff -rup HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/ne2000.c HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/ne2000.c --- HelenOS-0.4.3/uspace/srv/hw/netif/ne2000/ne2000.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/hw/netif/ne2000/ne2000.c 2011-04-02 20:58:00.000000000 +0200 @@ -1,6 +1,7 @@ /* * Copyright (c) 2009 Lukas Mejdrech * Copyright (c) 2011 Martin Decky + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -165,13 +166,13 @@ static void irq_handler(ipc_callid_t iid fibril_rwlock_read_unlock(&netif_globals.lock); if (ne2k != NULL) { - link_t *frames = + list_t *frames = ne2k_interrupt(ne2k, IRQ_GET_ISR(*call), IRQ_GET_TSR(*call)); if (frames != NULL) { while (!list_empty(frames)) { frame_t *frame = - list_get_instance(frames->next, frame_t, link); + list_get_instance(frames->head.next, frame_t, link); list_remove(&frame->link); nil_received_msg(nil_phone, device_id, frame->packet, diff -rup HelenOS-0.4.3/uspace/srv/ns/clonable.c HelenOS-0.4.3.new/uspace/srv/ns/clonable.c --- HelenOS-0.4.3/uspace/srv/ns/clonable.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/ns/clonable.c 2011-04-02 20:41:24.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009 Martin Decky + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,7 +52,7 @@ typedef struct { } cs_req_t; /** List of clonable-service connection requests. */ -static link_t cs_req; +static list_t cs_req; int clonable_init(void) { @@ -82,7 +83,7 @@ void register_clonable(sysarg_t service, return; } - cs_req_t *csr = list_get_instance(cs_req.next, cs_req_t, link); + cs_req_t *csr = list_get_instance(cs_req.head.next, cs_req_t, link); list_remove(&csr->link); /* Currently we can only handle a single type of clonable service. */ diff -rup HelenOS-0.4.3/uspace/srv/ns/service.c HelenOS-0.4.3.new/uspace/srv/ns/service.c --- HelenOS-0.4.3/uspace/srv/ns/service.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/ns/service.c 2011-04-02 20:40:47.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009 Martin Decky + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -120,7 +121,7 @@ typedef struct { sysarg_t arg3; /**< Third argument */ } pending_conn_t; -static link_t pending_conn; +static list_t pending_conn; int service_init(void) { @@ -141,7 +142,7 @@ void process_pending_conn(void) link_t *cur; loop: - for (cur = pending_conn.next; cur != &pending_conn; cur = cur->next) { + for (cur = pending_conn.head.next; cur != &pending_conn.head; cur = cur->next) { pending_conn_t *pr = list_get_instance(cur, pending_conn_t, link); unsigned long keys[3] = { diff -rup HelenOS-0.4.3/uspace/srv/ns/task.c HelenOS-0.4.3.new/uspace/srv/ns/task.c --- HelenOS-0.4.3/uspace/srv/ns/task.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/ns/task.c 2011-04-02 20:42:03.000000000 +0200 @@ -187,7 +187,7 @@ typedef struct { ipc_callid_t callid; /**< Call ID waiting for the connection */ } pending_wait_t; -static link_t pending_wait; +static list_t pending_wait; int task_init(void) { @@ -214,7 +214,7 @@ void process_pending_wait(void) task_exit_t texit; loop: - for (cur = pending_wait.next; cur != &pending_wait; cur = cur->next) { + for (cur = pending_wait.head.next; cur != &pending_wait.head; cur = cur->next) { pending_wait_t *pr = list_get_instance(cur, pending_wait_t, link); unsigned long keys[2] = { diff -rup HelenOS-0.4.3/uspace/srv/vfs/vfs.h HelenOS-0.4.3.new/uspace/srv/vfs/vfs.h --- HelenOS-0.4.3/uspace/srv/vfs/vfs.h 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/vfs/vfs.h 2011-04-02 20:44:22.000000000 +0200 @@ -146,7 +146,7 @@ extern fibril_mutex_t nodes_mutex; extern fibril_condvar_t fs_head_cv; extern fibril_mutex_t fs_head_lock; -extern link_t fs_head; /**< List of registered file systems. */ +extern list_t fs_head; /**< List of registered file systems. */ extern vfs_pair_t rootfs; /**< Root file system. */ @@ -159,7 +159,7 @@ typedef struct { extern fibril_mutex_t plb_mutex;/**< Mutex protecting plb and plb_head. */ extern uint8_t *plb; /**< Path Lookup Buffer */ -extern link_t plb_head; /**< List of active PLB entries. */ +extern list_t plb_head; /**< List of active PLB entries. */ #define MAX_MNTOPTS_LEN 256 diff -rup HelenOS-0.4.3/uspace/srv/vfs/vfs_lookup.c HelenOS-0.4.3.new/uspace/srv/vfs/vfs_lookup.c --- HelenOS-0.4.3/uspace/srv/vfs/vfs_lookup.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/vfs/vfs_lookup.c 2011-04-02 20:43:02.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Jakub Jermar + * Copyright (c) 2011 Mateusz Kocielski * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -105,9 +106,9 @@ int vfs_lookup_internal(char *path, int first = 0; last = PLB_SIZE - 1; } else { - plb_entry_t *oldest = list_get_instance(plb_head.next, + plb_entry_t *oldest = list_get_instance(plb_head.head.next, plb_entry_t, plb_link); - plb_entry_t *newest = list_get_instance(plb_head.prev, + plb_entry_t *newest = list_get_instance(plb_head.head.prev, plb_entry_t, plb_link); first = (newest->index + newest->len) % PLB_SIZE; diff -rup HelenOS-0.4.3/uspace/srv/vfs/vfs_register.c HelenOS-0.4.3.new/uspace/srv/vfs/vfs_register.c --- HelenOS-0.4.3/uspace/srv/vfs/vfs_register.c 2011-03-26 16:30:19.000000000 +0100 +++ HelenOS-0.4.3.new/uspace/srv/vfs/vfs_register.c 2011-04-02 20:45:34.000000000 +0200 @@ -267,7 +267,7 @@ int vfs_grab_phone(fs_handle_t handle) * that they do not have to be reestablished over and over again. */ fibril_mutex_lock(&fs_head_lock); - for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { + for (cur = fs_head.head.next; cur != &fs_head.head; cur = cur->next) { fs = list_get_instance(cur, fs_info_t, fs_link); if (fs->fs_handle == handle) { fibril_mutex_unlock(&fs_head_lock); @@ -291,7 +291,7 @@ void vfs_release_phone(fs_handle_t handl fs_info_t *fs; fibril_mutex_lock(&fs_head_lock); - for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { + for (cur = fs_head.head.next; cur != &fs_head.head; cur = cur->next) { fs = list_get_instance(cur, fs_info_t, fs_link); if (fs->fs_handle == handle) { fibril_mutex_unlock(&fs_head_lock); @@ -319,7 +319,7 @@ fs_handle_t fs_name_to_handle(char *name if (lock) fibril_mutex_lock(&fs_head_lock); link_t *cur; - for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { + for (cur = fs_head.head.next; cur != &fs_head.head; cur = cur->next) { fs_info_t *fs = list_get_instance(cur, fs_info_t, fs_link); if (str_cmp(fs->vfs_info.name, name) == 0) { handle = fs->fs_handle; @@ -342,7 +342,7 @@ vfs_info_t *fs_handle_to_info(fs_handle_ link_t *cur; fibril_mutex_lock(&fs_head_lock); - for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { + for (cur = fs_head.head.next; cur != &fs_head.head; cur = cur->next) { fs_info_t *fs = list_get_instance(cur, fs_info_t, fs_link); if (fs->fs_handle == handle) { info = &fs->vfs_info;