llarea.c File Reference

#include <libc.h>

Functions

void llarea_set_subinit (struct s_area_set *area_set)
t_area_status llarea_set_insert_ordered (struct s_area_set *set, t_area *new)
t_area_status llarea_set_old_add (struct s_area_set *set, t_area **new, t_area **unused1)
t_area_status llarea_set_add (struct s_area_set *set, t_area **io)
t_area_status llarea_set_collide (struct s_area_set *set, t_area_uint blk, int nb_blks)
t_area_status llarea_set_get_area (struct s_area_set *set, t_area_uint blk, int nb_blks, t_area **llarea)
t_area_status llarea_set_old_remove (struct s_area_set *set, t_area **todel, t_area **unused1, int no_alloc)
t_area_status llarea_set_remove (struct s_area_set *set, t_area **io, int no_alloc)
t_area_status llarea_set_old_modify (struct s_area_set *set, t_area **new, t_area **new2, t_area **unused1, t_area **unused2, int no_alloc)
t_area_status llarea_set_modify (struct s_area_set *set, t_area **io, int no_alloc)
t_area_status llarea_set_find_space_first_fit (struct s_area_set *set, int nb_blks, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *blk_returned)
t_area_status llarea_set_find_space_worst_fit (struct s_area_set *set, int nb_blks, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *blk_returned)
t_area_status llarea_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)
t_area_status llarea_set_find_coalescible_space (struct s_area_set *set, t_area *ref_llarea, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *blk_returned)
void llarea_set_dump (t_area_printf_fn printf_fn, struct s_area_set *set, t_area_match_fn match, void *val)
t_area_uint llarea_set_used (struct s_area_set *set, t_area_match_fn match, void *val, int *nb_areas)
int llarea_set_foreach (struct s_area_set *set, t_area_foreach_fn foreach, void *val)
int llarea_set_empty (struct s_area_set *area_set)
int llarea_set_add_alloc (struct s_area_set *area_set)
int llarea_set_add_size (struct s_area_set *area_set)
int llarea_set_modify_alloc (struct s_area_set *area_set)
int llarea_set_modify_size (struct s_area_set *area_set)
int llarea_set_remove_alloc (struct s_area_set *area_set)
int llarea_set_remove_size (struct s_area_set *area_set)

Function Documentation

t_area_status llarea_set_add struct s_area_set set,
t_area **  io
 

int llarea_set_add_alloc struct s_area_set area_set  ) 
 

int llarea_set_add_size struct s_area_set area_set  ) 
 

t_area_status llarea_set_collide struct s_area_set set,
t_area_uint  blk,
int  nb_blks
 

returns an error if {blk,nb_blks} collides whith an elt from the set, else AREA_EZERO

void llarea_set_dump t_area_printf_fn  printf_fn,
struct s_area_set set,
t_area_match_fn  match,
void *  val
 

dump the set (debug)

int llarea_set_empty struct s_area_set area_set  ) 
 

returns 1 if list is empty, else 0

t_area_status llarea_set_find_coalescible_space struct s_area_set set,
t_area ref_llarea,
t_area_fit_method  fit,
u_int32_t  fitopts,
t_area_uint blk_returned
 

find space coalescible with ref_llarea. all field of ref_llarea should be set excepted blk (included rec specific fields as it will call coalesce() )

t_area_status llarea_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
 

get the space matching nb_blks according to fit_method

t_area_status llarea_set_find_space_first_fit struct s_area_set set,
int  nb_blks,
t_area_fit_method  fit,
u_int32_t  fitopts,
t_area_uint blk_returned
 

get the first empty space matching nb_blks

t_area_status llarea_set_find_space_worst_fit struct s_area_set set,
int  nb_blks,
t_area_fit_method  fit,
u_int32_t  fitopts,
t_area_uint blk_returned
 

get the worst empty space matching nb_blks

int llarea_set_foreach struct s_area_set set,
t_area_foreach_fn  foreach,
void *  val
 

apply a function to all area_list in the set

t_area_status llarea_set_get_area struct s_area_set set,
t_area_uint  blk,
int  nb_blks,
t_area **  llarea
 

this function returns the best matching llarea.

t_area_status llarea_set_insert_ordered struct s_area_set set,
t_area new
 

should not be called directly as it doesn't check anything, see rather llarea_set_add(9)

t_area_status llarea_set_modify struct s_area_set set,
t_area **  io,
int  no_alloc
 

int llarea_set_modify_alloc struct s_area_set area_set  ) 
 

int llarea_set_modify_size struct s_area_set area_set  ) 
 

t_area_status llarea_set_old_add struct s_area_set set,
t_area **  new,
t_area **  unused1
 

Descr: Add specified llarea to set. Glue zones if possible (if they match). note there could be 0, 1 or 2 unused (or released) area_list.

Input: Caller allocates "new" and set it with values. No need to set "unused1" and "unused2".

Output: Free pointers "new" and "unused1" which are not NULL.

t_area_status llarea_set_old_modify struct s_area_set set,
t_area **  new,
t_area **  new2,
t_area **  unused1,
t_area **  unused2,
int  no_alloc
 

Descr: Modify the specified llarea, eventually split existing llarea in zero, one or two pieces. this function eventually glue modified llarea to enclosing area_list if they matches.

Input: Protocol here is the following: caller allocates 2 area_list and set a pointer to their address. "New" should be initialized with fields {blk, nb_blks, data+content}, and "new2" should be initialized with fields {data} (no content). After call, if they are set to NULL, it means they have been used. Two records, unused1 and unused2 could also be sent back. If "no_alloc" is set to 1 then one assertion will be done when using "new" and "new2".

Output: free pointers "new", "new2", "unused1", "unused2" which are not NULL.

t_area_status llarea_set_old_remove struct s_area_set set,
t_area **  todel,
t_area **  unused1,
int  no_alloc
 

Descr: Remove an arbitrary llarea from set.

Input: "Todel" fields {blk, nb_blks, data} must be correctly filled altough "data" content has not to be initialized. Please note "todel" is not a pointer to an existing llarea but a newly allocated pointer that can be eventually used by API. "Unused1" is not allocated and not set to anything. If "no_alloc" is set to 1 then one assertion will be done when using "todel"

Output: Free pointers "todel", "unused1" which are not used.

Notes: copy() might be used on some parts of "todel".

t_area_status llarea_set_remove struct s_area_set set,
t_area **  io,
int  no_alloc
 

int llarea_set_remove_alloc struct s_area_set area_set  ) 
 

int llarea_set_remove_size struct s_area_set area_set  ) 
 

void llarea_set_subinit struct s_area_set area_set  ) 
 

t_area_uint llarea_set_used struct s_area_set set,
t_area_match_fn  match,
void *  val,
int *  nb_areas
 

returns total size of set. match might be NULL


Generated on Wed May 24 23:05:53 2006 for LSE/OS by  doxygen 1.4.6