area.h File Reference

#include <llarea.h>
#include <bptarea.h>

Go to the source code of this file.

Data Structures

struct  s_area
struct  s_area_set
struct  s_area_fns

Defines

#define __LIBAREA_AREA_H__   1
#define AREA_FOREACH_CONT   0
#define AREA_FOREACH_STOP   1
#define AREA_FITOPT_NOPAGE0   (1<<0u)
#define AREA_FITOPT_NOFIRSTMEG   (1<<1u)
#define AREA_LL   0
#define AREA_BPT   1
#define AREA_MAXTYPE   1
#define AREA_SET_SIZE(Set)   ((t_area_uint)(((Set)->last_blk - (Set)->first_blk + 1)))

Typedefs

typedef int(* t_area_printf_fn )(const char *fmt,...)
typedef unsigned int t_area_uint
typedef signed int t_area_int
typedef int(* t_area_data_coalesce_fn )(void *data1, void *data2)
typedef void(* t_area_data_print_fn )(void *data)
typedef void(* t_area_data_copy_fn )(void *data_src, void *data_dst)
typedef void(* t_area_xlate_fn )(void *data, signed int diff_pgs)
typedef int(* t_area_match_fn )(void *data, void *val)
typedef int(* t_area_foreach_fn )(void *data, void *val)
typedef s_area t_area
typedef s_area_list t_area_list
typedef s_area_set t_area_set
typedef void(* t_area_set_subinit_fn )(t_area_set *set)
typedef t_area_status(* t_area_set_add_fn )(t_area_set *set, t_area **io)
typedef t_area_status(* t_area_set_collide_fn )(t_area_set *set, t_area_uint blk, int nb_blks)
typedef t_area_status(* t_area_set_get_area_fn )(t_area_set *set, t_area_uint blk, int nb_blks, t_area **area)
typedef t_area_status(* t_area_set_remove_fn )(t_area_set *set, t_area **io, int no_alloc)
typedef t_area_status(* t_area_set_modify_fn )(t_area_set *set, t_area **io, int no_alloc)
typedef t_area_status(* t_area_set_find_space_fn )(t_area_set *set, int nb_blks, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *addr_returned)
typedef t_area_status(* t_area_set_find_coalescible_space_fn )(t_area_set *set, t_area *ref_area, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *blk_returned)
typedef void(* t_area_set_dump_fn )(t_area_printf_fn printf_fn, t_area_set *set, t_area_match_fn match, void *val)
typedef t_area_uint(* t_area_set_used_fn )(t_area_set *set, t_area_match_fn match, void *val, int *nb_areas)
typedef int(* t_area_set_foreach_fn )(t_area_set *set, t_area_foreach_fn foreach, void *val)
typedef int(* t_area_set_empty_fn )(t_area_set *set)
typedef int(* t_area_set_add_alloc_fn )(t_area_set *set)
typedef int(* t_area_set_add_size_fn )(t_area_set *set)
typedef int(* t_area_set_modify_alloc_fn )(t_area_set *set)
typedef int(* t_area_set_modify_size_fn )(t_area_set *set)
typedef int(* t_area_set_remove_alloc_fn )(t_area_set *set)
typedef int(* t_area_set_remove_size_fn )(t_area_set *set)
typedef s_area_fns t_area_fns

Enumerations

enum  t_area_status {
  AREA_EZERO, AREA_ECOLLIDE, AREA_ENOROOM, AREA_EINVAL,
  AREA_ELIMIT, AREA_ENODEV, AREA_ENOMATCH, AREA_ENOFIT
}
enum  t_area_fit_method { AREA_FIRST_FIT, AREA_WORST_FIT, AREA_ANY_FIT }

Functions

 LIST_HEAD (s_area_list, s_area)
char * area_get_err_str (t_area_status status)
int area_collide (t_area *area1, t_area *area2)
t_area_status area_set_init (int type, t_area_set *new, t_area_data_coalesce_fn coalesce, t_area_data_print_fn print, t_area_data_copy_fn copy, t_area_xlate_fn xlate, t_area_uint blk_size, t_area_uint first_blk, t_area_uint last_blk, void *set_data)
void area_set_subinit (t_area_set *set)
t_area_status area_set_find_space (t_area_set *set, int nb_blks, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *addr_returned)
t_area_status area_set_add (t_area_set *set, t_area **io)
t_area_status area_set_collide (t_area_set *set, t_area_uint blk, int nb_blks)
t_area_status area_set_find_coalescible_space (t_area_set *set, t_area *ref_area, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *blk_returned)
t_area_status area_set_get_area (t_area_set *set, t_area_uint blk, int nb_blks, t_area **area)
t_area_status area_set_remove (t_area_set *set, t_area **io, int no_alloc)
t_area_status area_set_modify (t_area_set *set, t_area **io, int no_alloc)
int area_set_foreach (t_area_set *set, t_area_foreach_fn foreach, void *val)
void area_set_dump (t_area_printf_fn printf_fn, t_area_set *set, t_area_match_fn match, void *val)
t_area_uint area_set_used (t_area_set *set, t_area_match_fn match, void *val, int *nb_areas)
int area_set_empty (t_area_set *set)
int area_set_add_alloc (t_area_set *set)
int area_set_add_size (t_area_set *set)
int area_set_modify_alloc (t_area_set *set)
int area_set_modify_size (t_area_set *set)
int area_set_remove_alloc (t_area_set *set)
int area_set_remove_size (t_area_set *set)
t_area_status area_set_old_add (t_area_set *set, t_area **new, t_area **unused1)
t_area_status area_set_old_remove (t_area_set *set, t_area **todel, t_area **unused1, int no_alloc)
t_area_status area_set_old_modify (t_area_set *set, t_area **new, t_area **new2, t_area **unused1, t_area **unused2, int no_alloc)


Define Documentation

#define __LIBAREA_AREA_H__   1
 

#define AREA_BPT   1
 

#define AREA_FITOPT_NOFIRSTMEG   (1<<1u)
 

dont return first meg

#define AREA_FITOPT_NOPAGE0   (1<<0u)
 

dont return page zero

#define AREA_FOREACH_CONT   0
 

#define AREA_FOREACH_STOP   1
 

#define AREA_LL   0
 

#define AREA_MAXTYPE   1
 

#define AREA_SET_SIZE Set   )     ((t_area_uint)(((Set)->last_blk - (Set)->first_blk + 1)))
 


Typedef Documentation

typedef struct s_area t_area
 

typedef int(* t_area_data_coalesce_fn)(void *data1, void *data2)
 

please note this method is used to determine if two contiguous zones area coalescible, *not* to check if two zones are identical:

typedef void(* t_area_data_copy_fn)(void *data_src, void *data_dst)
 

inherit specific properties:

typedef void(* t_area_data_print_fn)(void *data)
 

should print a short message in area_set_dump(9):

typedef struct s_area_fns t_area_fns
 

typedef int(* t_area_foreach_fn)(void *data, void *val)
 

typedef signed int t_area_int
 

typedef struct s_area_list t_area_list
 

typedef int(* t_area_match_fn)(void *data, void *val)
 

returns 0 on matches

typedef int(* t_area_printf_fn)(const char *fmt,...)
 

typedef struct s_area_set t_area_set
 

typedef int(* t_area_set_add_alloc_fn)(t_area_set *set)
 

typedef t_area_status(* t_area_set_add_fn)(t_area_set *set, t_area **io)
 

input: io array must be of length area_set_add_size() and area_set_add_alloc() entries must be allocated. io[0] must contain rec to register.

output: free entries that are not set to NULL in io array.

typedef int(* t_area_set_add_size_fn)(t_area_set *set)
 

typedef t_area_status(* t_area_set_collide_fn)(t_area_set *set, t_area_uint blk, int nb_blks)
 

typedef void(* t_area_set_dump_fn)(t_area_printf_fn printf_fn, t_area_set *set, t_area_match_fn match, void *val)
 

typedef int(* t_area_set_empty_fn)(t_area_set *set)
 

typedef t_area_status(* t_area_set_find_coalescible_space_fn)(t_area_set *set, t_area *ref_area, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *blk_returned)
 

typedef t_area_status(* t_area_set_find_space_fn)(t_area_set *set, int nb_blks, t_area_fit_method fit, u_int32_t fitopts, t_area_uint *addr_returned)
 

typedef int(* t_area_set_foreach_fn)(t_area_set *set, t_area_foreach_fn foreach, void *val)
 

typedef t_area_status(* t_area_set_get_area_fn)(t_area_set *set, t_area_uint blk, int nb_blks, t_area **area)
 

typedef int(* t_area_set_modify_alloc_fn)(t_area_set *set)
 

typedef t_area_status(* t_area_set_modify_fn)(t_area_set *set, t_area **io, int no_alloc)
 

input: io array must be of length area_set_modify_size() and area_set_modify_alloc() entries must be allocated. io[0] must contain rec to register. io[1] data pointer must be set. if no_alloc is set to TRUE then io[] is of size 2 and io[0] and io[1] must point to fake recs (e.g in stack).

output: free entries that are not set to NULL in io array. If no_alloc is TRUE then caller should not free io[0] as it will be the fake rec but only doing an assertion of its non-nullness.

typedef int(* t_area_set_modify_size_fn)(t_area_set *set)
 

typedef int(* t_area_set_remove_alloc_fn)(t_area_set *set)
 

typedef t_area_status(* t_area_set_remove_fn)(t_area_set *set, t_area **io, int no_alloc)
 

input: io array must be of length area_set_remove_size() and area_set_remove_alloc() entries must be allocated. io[0] must contain rec to register. if no_alloc is set to TRUE then io[] is of size 1 and io[0] must point to a fake rec (e.g in stack).

output: free entries that are not set to NULL in io array. If no_alloc is TRUE then caller should not free io[0] as it will be the fake rec but only doing an assertion of its non-nullness.

typedef int(* t_area_set_remove_size_fn)(t_area_set *set)
 

typedef void(* t_area_set_subinit_fn)(t_area_set *set)
 

typedef t_area_uint(* t_area_set_used_fn)(t_area_set *set, t_area_match_fn match, void *val, int *nb_areas)
 

typedef unsigned int t_area_uint
 

typedef void(* t_area_xlate_fn)(void *data, signed int diff_pgs)
 

used when resizing areas to transpose private properties like eventual corresponding addresses:


Enumeration Type Documentation

enum t_area_fit_method
 

Enumerator:
AREA_FIRST_FIT 
AREA_WORST_FIT 
AREA_ANY_FIT  choose whatany space

enum t_area_status
 

Enumerator:
AREA_EZERO 
AREA_ECOLLIDE 
AREA_ENOROOM 
AREA_EINVAL 
AREA_ELIMIT 
AREA_ENODEV 
AREA_ENOMATCH 
AREA_ENOFIT 


Function Documentation

int area_collide t_area area1,
t_area area2
 

char* area_get_err_str t_area_status  status  ) 
 

get error string

t_area_status area_set_add t_area_set set,
t_area **  io
 

int area_set_add_alloc t_area_set set  ) 
 

int area_set_add_size t_area_set set  ) 
 

t_area_status area_set_collide t_area_set set,
t_area_uint  blk,
int  nb_blks
 

void area_set_dump t_area_printf_fn  printf_fn,
t_area_set set,
t_area_match_fn  match,
void *  val
 

int area_set_empty t_area_set set  ) 
 

t_area_status area_set_find_coalescible_space t_area_set set,
t_area ref_area,
t_area_fit_method  fit,
u_int32_t  fitopts,
t_area_uint blk_returned
 

t_area_status area_set_find_space t_area_set set,
int  nb_blks,
t_area_fit_method  fit,
u_int32_t  fitopts,
t_area_uint addr_returned
 

int area_set_foreach t_area_set set,
t_area_foreach_fn  foreach,
void *  val
 

t_area_status area_set_get_area t_area_set set,
t_area_uint  blk,
int  nb_blks,
t_area **  area
 

t_area_status area_set_init int  type,
t_area_set new,
t_area_data_coalesce_fn  coalesce,
t_area_data_print_fn  print,
t_area_data_copy_fn  copy,
t_area_xlate_fn  xlate,
t_area_uint  blk_size,
t_area_uint  first_blk,
t_area_uint  last_blk,
void *  set_data
 

initializes a area_set. xlate() can be NULL

t_area_status area_set_modify t_area_set set,
t_area **  io,
int  no_alloc
 

int area_set_modify_alloc t_area_set set  ) 
 

int area_set_modify_size t_area_set set  ) 
 

t_area_status area_set_old_add t_area_set set,
t_area **  new,
t_area **  unused1
 

t_area_status area_set_old_modify t_area_set set,
t_area **  new,
t_area **  new2,
t_area **  unused1,
t_area **  unused2,
int  no_alloc
 

t_area_status area_set_old_remove t_area_set set,
t_area **  todel,
t_area **  unused1,
int  no_alloc
 

t_area_status area_set_remove t_area_set set,
t_area **  io,
int  no_alloc
 

int area_set_remove_alloc t_area_set set  ) 
 

int area_set_remove_size t_area_set set  ) 
 

void area_set_subinit t_area_set set  ) 
 

t_area_uint area_set_used t_area_set set,
t_area_match_fn  match,
void *  val,
int *  nb_areas
 

LIST_HEAD s_area_list  ,
s_area 
 


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