00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __CONVEN_PGALLOC_H__
00011 #define __CONVEN_PGALLOC_H__ 1
00012 #include <libc.h>
00013
00014 typedef struct s_pgblock
00015 {
00016 #define PGBLOCK_MAGIC 0x42aabbcc
00017 u_int32_t magic;
00018 struct s_pgblock *next;
00019 int offset;
00020 int count;
00021 } t_pgblock;
00022
00023 typedef struct s_pgset
00024 {
00025 #define PGSET_MAGIC 0x43ddeeff
00026 u_int32_t magic;
00027 t_pgblock *block;
00028 asid_t asid;
00029 vaddr_t va;
00030 int nb_pgs;
00031 } t_pgset;
00032
00033 typedef struct s_pgchunk
00034 {
00035 #define PGCHUNK_MAGIC 0x44001122
00036 u_int32_t magic;
00037 vaddr_t va;
00038 paddr_t pa;
00039 int nb_pgs;
00040 } t_pgchunk;
00041
00042
00043
00044 vaddr_t pgalloc2(asid_t asid, paddr_t fixed_pa, int nb_pgs, paddr_t *pa_returned);
00045 vaddr_t pgalloc(asid_t asid, int nb_pgs);
00046 int pgfree(asid_t asid, vaddr_t vpages, int nb_pgs);
00047 int ppgalloc(asid_t asid, int nb_pgs, paddr_t *pa_returned, int *nb_pgs_returned);
00048 int bigfree(t_pgset *set);
00049 t_pgset *bigalloc(asid_t asid, int nb_pgs);
00050 void bigdump(t_pgset *set);
00051 #endif