X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fbitmap.h;h=2dbf38a4bdfb9faa179cbb6daa7b82ad209db915;hb=dc83e159fc3dd0301a967aef2b84f1460aa3ef08;hp=ba4465e4e595cf040574f8388be5bade0f837d85;hpb=04584a49656ea770c77e3eee9537e1b726118cb6;p=pintos-anon diff --git a/src/lib/bitmap.h b/src/lib/bitmap.h index ba4465e..2dbf38a 100644 --- a/src/lib/bitmap.h +++ b/src/lib/bitmap.h @@ -4,16 +4,19 @@ #include #include +typedef unsigned long elem_type; + struct bitmap { size_t bit_cnt; elem_type *bits; }; -void bitmap_init (struct bitmap *, size_t bit_cnt); +bool bitmap_init (struct bitmap *, size_t bit_cnt); void bitmap_destroy (struct bitmap *); size_t bitmap_size (const struct bitmap *); +size_t bitmap_storage_size (const struct bitmap *); void bitmap_set (struct bitmap *, size_t idx, bool); void bitmap_set_all (struct bitmap *, bool); @@ -36,4 +39,12 @@ bool bitmap_any (const struct bitmap *); bool bitmap_none (const struct bitmap *); bool bitmap_all (const struct bitmap *); +#ifdef FILESYS +struct file; +void bitmap_read (struct bitmap *, struct file *); +void bitmap_write (const struct bitmap *, struct file *); +#endif + +void bitmap_dump (const struct bitmap *); + #endif /* bitmap.h */