bptarea.h

Go to the documentation of this file.
00001 /*
00002 ** bptarea.h for lseos in lseos-lib/libarea
00003 ** 
00004 ** Copyright (c)2004 Vianney Rancurel, Julien Quintard
00005 ** Login   <vianney@epita.fr>
00006 ** 
00007 ** Started on  Fri Oct 29 17:27:17 2004 Vianney Rancurel
00008 ** Last update Mon Dec  6 12:31:29 2004 Vianney Rancurel
00009 */
00010 #ifndef __LIBAREA_BPTAREA_H__
00011 #define __LIBAREA_BPTAREA_H__   1
00012 
00013 typedef struct          s_inentry
00014 {
00015   t_area_uint           key;
00016   t_area_uint           value;
00017   t_area_uint           interval;
00018 }                       t_inentry;
00019 
00020 typedef struct          s_lfentry
00021 {
00022   t_area_uint           key;
00023   t_area_uint           value;
00024   t_area_uint           interval;
00025 }                       t_lfentry;
00026 
00027 bpt_make_types(area_tree,
00028                t_area_uint,
00029                t_area_int,              /* ndi          */
00030                t_area_int,              /* uni          */
00031                t_area_uint,
00032                t_area_uint,
00033                t_area_uint,
00034                t_area_uint,
00035                t_inentry,
00036                t_lfentry)
00037 
00038 bpt_make_protos(area_tree)
00039 
00040 /* PROTO bptarea.c */
00041 /* bptarea.c */
00042 int bpt_list_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_entry_area_tree *entry, t_bpt_opts opts);
00043 int bpt_check_unused_area_tree(t_bpt_area_tree *bpt, t_bpt_unused_area_tree *unused, t_bpt_opts opts);
00044 int bpt_first_entry_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_ndi_area_tree *first);
00045 int bpt_prev_entry_area_tree(t_bpt_area_tree *bpt, t_bpt_entry_area_tree current, t_bpt_entry_area_tree *previous, t_bpt_opts opts);
00046 int bpt_next_entry_area_tree(t_bpt_area_tree *bpt, t_bpt_entry_area_tree current, t_bpt_entry_area_tree *next, t_bpt_opts opts);
00047 int bpt_last_entry_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_ndi_area_tree *last);
00048 void bpt_reinit_entries_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node);
00049 void bpt_make_node_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_type type, t_bpt_node_area_tree parent);
00050 void bpt_key_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_key_area_tree *key);
00051 int bpt_ndi_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_addr_area_tree value, t_bpt_ndi_area_tree *ndi);
00052 int bpt_update_node_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_node_area_tree addr, t_bpt_key_area_tree key, t_bpt_opts opts);
00053 void bpt_update_parent_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node);
00054 int bpt_update_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_opts opts);
00055 int bpt_linear_search_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_key_area_tree key, t_bpt_ndi_area_tree *ndi, t_bpt_opts opts);
00056 int bpt_dichotomic_search_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_key_area_tree key, t_bpt_ndi_area_tree *ndi, t_bpt_opts opts);
00057 int bpt_search_entry_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_key_area_tree key, t_bpt_ndi_area_tree *ndi, t_bpt_opts opts);
00058 int bpt_search_leaf_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_node_area_tree *leaf, t_bpt_key_area_tree key);
00059 int bpt_search_area_tree(t_bpt_area_tree *bpt, t_bpt_key_area_tree key, t_bpt_entry_area_tree *entry);
00060 int bpt_collide_next_area_tree(t_bpt_area_tree *bpt, t_bpt_key_area_tree key, t_bpt_entry_area_tree *entry);
00061 int bpt_collide_search_area_tree(t_bpt_area_tree *bpt, t_bpt_key_area_tree key, t_bpt_addr_area_tree value, t_bpt_entry_area_tree *entry);
00062 int bpt_check_collide_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_key_area_tree key, t_bpt_addr_area_tree value);
00063 t_bpt_ndi_area_tree bpt_node_size_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node);
00064 void bpt_simplify_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_unused_area_tree *unused);
00065 int bpt_balancein_1_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_imm_area_tree *node2, t_bpt_cbctx_area_tree *cbctx, t_bpt_entry_area_tree prev, t_bpt_unused_area_tree *unused);
00066 int bpt_balancein_2_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_imm_area_tree *node2, t_bpt_cbctx_area_tree *cbctx, t_bpt_entry_area_tree prev, t_bpt_unused_area_tree *unused);
00067 int bpt_balancein_3_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node2, t_bpt_imm_area_tree *node1, t_bpt_cbctx_area_tree *cbctx, t_bpt_entry_area_tree prev, t_bpt_unused_area_tree *unused);
00068 int bpt_balancein_4_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node2, t_bpt_imm_area_tree *node1, t_bpt_cbctx_area_tree *cbctx, t_bpt_entry_area_tree prev, t_bpt_unused_area_tree *unused);
00069 int bpt_delete_area_tree(t_bpt_area_tree *bpt, t_bpt_entry_area_tree entry, t_bpt_cbctx_area_tree *cbctx, t_bpt_unused_area_tree *unused);
00070 int bpt_remove_area_tree(t_bpt_area_tree *bpt, t_bpt_key_area_tree key, t_bpt_unused_area_tree *unused);
00071 int bpt_collide_remove_area_tree(t_bpt_area_tree *bpt, t_bpt_entry_area_tree entry, t_bpt_unused_area_tree *unused);
00072 int bpt_modify_area_tree(t_bpt_area_tree *bpt, t_bpt_key_area_tree key, t_bpt_lfentry_area_tree *lfentry, t_bpt_unused_area_tree *unused);
00073 int bpt_collide_modify_area_tree(t_bpt_area_tree *bpt, t_bpt_entry_area_tree entry, t_bpt_lfentry_area_tree *lfentry, t_bpt_unused_area_tree *unused);
00074 void bpt_insert_head_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_imm_area_tree *node2);
00075 void bpt_insert_tail_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_imm_area_tree *node2);
00076 void bpt_shift_sort_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node);
00077 void bpt_insert_sort_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_key_area_tree key, t_bpt_addr_area_tree value, t_bpt_ndi_area_tree *ndi, t_bpt_opts opts);
00078 void bpt_new_root_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_imm_area_tree *node2, t_bpt_unused_area_tree *unused);
00079 int bpt_balanceout_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_imm_area_tree *node2, void *entry, t_bpt_cbctx_area_tree *cbctx);
00080 int bpt_split_node_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, void *entry, t_bpt_cbctx_area_tree *cbctx, t_bpt_unused_area_tree *unused);
00081 int bpt_insert_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, void *entry, t_bpt_cbctx_area_tree *cbctx, t_bpt_unused_area_tree *unused);
00082 int bpt_add_area_tree(t_bpt_area_tree *bpt, t_bpt_lfentry_area_tree *lfentry, t_bpt_unused_area_tree *unused);
00083 int bpt_init_area_tree(t_bpt_area_tree *bpt, t_bpt_blksz_area_tree blksz, t_bpt_addr_area_tree unusedvalue, t_bpt_flags flags, t_bpt_load_fn_area_tree load, t_bpt_unload_fn_area_tree unload, t_bpt_callback_fn_area_tree callback, t_bpt_unused_area_tree *unused);
00084 int bpt_clean_node_area_tree(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_unused_area_tree *unused);
00085 int bpt_clean_area_tree(t_bpt_area_tree *bpt, t_bpt_unused_area_tree *unused);
00086 void bptarea_dump_node(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_area_uint level);
00087 void bptarea_dump(t_bpt_area_tree *bpt);
00088 void bptarea_load(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_node_area_tree addr);
00089 void bptarea_unload(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node);
00090 t_area_uint bptarea_get_interval(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, int how);
00091 void bptarea_cb_update_node(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node, t_bpt_node_area_tree addr, t_area_uint interval);
00092 void bptarea_cb_update(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node);
00093 void bptarea_cb_interval(t_bpt_area_tree *bpt, t_bpt_imm_area_tree *node1, t_bpt_ndi_area_tree ndi);
00094 void bptarea_cb_insert(t_bpt_area_tree *bpt, t_bpt_cbctx_area_tree *cbctx);
00095 void bptarea_cb_split(t_bpt_area_tree *bpt, t_bpt_cbctx_area_tree *cbctx);
00096 void bptarea_cb_modify(t_bpt_area_tree *bpt, t_bpt_cbctx_area_tree *cbctx);
00097 void bptarea_cb_delete(t_bpt_area_tree *bpt, t_bpt_cbctx_area_tree *cbctx);
00098 void bptarea_cb_migrate(t_bpt_area_tree *bpt, t_bpt_cbctx_area_tree *cbctx);
00099 void bptarea_cb_balance(t_bpt_area_tree *bpt, t_bpt_cbctx_area_tree *cbctx);
00100 void bptarea_callback(t_bpt_area_tree *bpt, t_bpt_cbctx_area_tree *cbctx);
00101 void bptarea_set_subinit(struct s_area_set *area_set);
00102 t_area_status bptarea_set_add(struct s_area_set *set, t_area **io);
00103 int bptarea_find_colliding_area(t_bpt_area_tree *bpt, t_bpt_entry_area_tree *entry, t_bpt_imm_area_tree *node, t_area_uint blk, int nb_blks);
00104 t_area_status bptarea_set_collide(struct s_area_set *set, t_area_uint blk, int nb_blks);
00105 int bptarea_find_enclosing_area(t_bpt_area_tree *bpt, t_bpt_entry_area_tree *entry, t_bpt_imm_area_tree *node, t_area_uint blk, int nb_blks);
00106 t_area_status bptarea_set_get_area(struct s_area_set *set, t_area_uint blk, int nb_blks, t_area **bptarea);
00107 t_area_status bptarea_set_remove(struct s_area_set *set, t_area **io, int no_alloc);
00108 t_area_status bptarea_set_modify(struct s_area_set *set, t_area **io, int no_alloc);
00109 int bptarea_find_best_interval(t_bpt_area_tree *bpt, t_bpt_entry_area_tree *entry, t_bpt_imm_area_tree *node, t_area_uint interval);
00110 t_area_status bptarea_set_find_space(struct s_area_set *set, int nb_blks, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *blk_returned);
00111 void bptarea_set_dump(t_area_printf_fn printf_fn, struct s_area_set *set, t_area_match_fn match, void *val);
00112 int bptarea_set_foreach(struct s_area_set *set, t_area_foreach_fn foreach, void *val);
00113 t_area_uint bptarea_set_used(struct s_area_set *set, t_area_match_fn match, void *val, int *nb_areas);
00114 int bptarea_set_empty(struct s_area_set *set);
00115 int bptarea_set_add_alloc(struct s_area_set *area_set);
00116 int bptarea_set_add_size(struct s_area_set *area_set);
00117 int bptarea_set_modify_alloc(struct s_area_set *area_set);
00118 int bptarea_set_modify_size(struct s_area_set *area_set);
00119 int bptarea_set_remove_alloc(struct s_area_set *area_set);
00120 int bptarea_set_remove_size(struct s_area_set *area_set);
00121 t_area_status bptarea_set_old_add(struct s_area_set *set, t_area **new, t_area **unused1);
00122 t_area_status bptarea_set_old_remove(struct s_area_set *set, t_area **todel, t_area **unused1, int no_alloc);
00123 t_area_status bptarea_set_old_modify(struct s_area_set *set, t_area **new, t_area **new2, t_area **unused1, t_area **unused2, int no_alloc);
00124 t_area_status bptarea_set_find_coalescible_space(struct s_area_set *set, t_area *ref_bptarea, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *blk_returned);
00125 #endif

Generated on Wed May 24 23:04:16 2006 for LSE/OS by  doxygen 1.4.6